Jump to content

What is wrong with my VEXpression?

Recommended Posts

Dear ODForcers,


I have this inside a popcurveforce inside a DOPNET and am attempting to make each packed prim start moving (by this force) at a random time up to 50 frames (my scene starts at 1001)


float random = rand(@ptnum);
float framestart = (random * 50) + 1000;
if (@Frame < framestart) {
    airresist = 0;
else {
    airresist = 15;


Can you see what is wrong here, it doesn't seem to work?


I have left out the .hip because everything else works just not my code.





Link to comment
Share on other sites

I pasted your code into my hip file and it works. Depending on your setup, you can try

1. Use the @id attribute instead of @ptnum (in case you have particles dying).

2. make sure your time slider is in between 1000-1200


If that doesn't work you can group the particles you want to advect and then use that group in the popcurveforce. To do this:

1. popgroup DOP - set the group name to followCurve: paste this into the wex code 

float random = rand(@id);
float framestart = (random * 50) + 1000;
if (@Frame > framestart) ingroup = 1;

2. popcurvefirce DOP - turn on group and set it to followCurve; set air resistance to 15


Best regards, 



Link to comment
Share on other sites

Sometimes it's a little clearer to just use a fit01 in this case to specify the range.

integer frame_start = int(fit01(rand(@id),240,480)); // Frame range to possibly start on.


  • Like 1
Link to comment
Share on other sites

OK! Thanks guys.

The problem was NOT my code it turned out, but that I also had a POP VOP doing something, so it therefor appeared they were still all moving from the beginning, when that curveforce was not actually acting until commanded.

Thanks anyway =)

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.

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...