gubar Posted June 23, 2011 Share Posted June 23, 2011 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 Quote Link to comment Share on other sites More sharing options...
sam.h Posted June 24, 2011 Share Posted June 24, 2011 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 ... Quote Link to comment Share on other sites More sharing options...
dangerweenie Posted June 27, 2011 Share Posted June 27, 2011 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. Quote Link to comment Share on other sites More sharing options...
gubar Posted June 27, 2011 Author Share Posted June 27, 2011 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.