Jump to content
gubar

A question on an expression, and one about caching sims

Recommended Posts

Hi,

I've been experimenting and following some tutorials and have 2 questions.

The first relates to this expression:

fit01(rand($OBJID),.1,.7)

This is used in a tutorial to assign a value to a randomly chosen OBJID. I would then generate another random value which would be the value assigned to the OBJID, so for example OBJ 1 would get a value of .3, OBJ2 a value of .6 and so on. But when I paste it in different channels, the same value is displayed in each one. I don't understand expressions well so am probably missing something obvious.

My second question relates to caching sims using a file node inside a DOP. Inside a DOP I have a small flow that ends with a rbdsolver. I have tried to connect this to a file node and set the mode to write, but no files are written when I run the sim.

Any help appreciated,

thanks,

g

Share this post


Link to post
Share on other sites

The argument for the rand() function is the seed, if you give it the same seed, you get get the same 'random' number back. So just offset each seed: rand($OBJID + 2.54), rand($OBJID + 2.54) etc. etc.

Don't know about the file node in DOPs sorry, I just do it in SOPs ...

Share this post


Link to post
Share on other sites

Hi,

I've been experimenting and following some tutorials and have 2 questions.

The first relates to this expression:

fit01(rand($OBJID),.1,.7)

This is used in a tutorial to assign a value to a randomly chosen OBJID. I would then generate another random value which would be the value assigned to the OBJID, so for example OBJ 1 would get a value of .3, OBJ2 a value of .6 and so on. But when I paste it in different channels, the same value is displayed in each one. I don't understand expressions well so am probably missing something obvious.

My second question relates to caching sims using a file node inside a DOP. Inside a DOP I have a small flow that ends with a rbdsolver. I have tried to connect this to a file node and set the mode to write, but no files are written when I run the sim.

Any help appreciated,

thanks,

g

What did you set the file name to? It has to be something like "$SF" for simulation frame, or "$ST" for simulation time (for timewarping, scale, etc).

Filename I use is "cache.$SF.sim". Works everytime, both on the DOP explicit cache filename, and inside the DOP itself with a "file" node.

Share this post


Link to post
Share on other sites

Thanks for the explanations. The use of the random variable makes more sense to me now. As for the file node, I have re-created my scene from scratch and it works now. I'm not sure what I was overlooking before or what I had set up wrong but it's working now.

thanks for replying,

gubar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×