Jump to content

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

Link to comment
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 ...

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...