On 08/03/2017 at 19:04, xxxxxxxx wrote:
I am using random values in my Python effector. The tag refreshes every frame or every change in the interface so I get different values constantly. Say I want to stick with the first random values I get, how can I compare those first values with the following values in the python effector, so it always stays the same?
On 09/03/2017 at 01:04, xxxxxxxx wrote:
You can implement a seed value. And according to this seed the "random" value will be alway the same.
If you have your own "random" function take it like an hashing function who only return number
If you use the random module from python simply do
seed = random.seed(your seed (can be exposed for more choice for the user)
A good read https://pymotw.com/2/random/
Hope it's help you.
On 09/03/2017 at 06:54, xxxxxxxx wrote:
gr4ph0s was too fast for me. That's basically what I wanted to post as well.
Just a small additional idea. Depending on your needs you could for example derive the seed value from the current frame to get a different random value per frame. Or you could have a user parameter for the seed, that would be saved with the scene, so the user can change the random value but it stays constant with the scene.
One thing I was confused about, you are talking about the Python Effector and on the other hand about a tag refreshing every frame. So if you keep having problems with this, you probably should shed some light here.
On 09/03/2017 at 12:34, xxxxxxxx wrote:
Thanks so much, gr4ph0s and Andreas! It worked perfect!