Jump to content

Need help with expression


halion

Recommended Posts

I have this scene where I want particles to rotate once their age is at 8. I have life expectancy at 10 and variance at 2 which is where I got the value 8 from. Now I can't figure how to write a expression where it will read each particles age and then rotate once it gets to 8. Heres what I have right now.

In the rotate pop activation field: if($F>1,ageCheck($MYAGE),0)

Variables: $MYAGE = $AGE and $TESTAGE = 0

float ageCheck(float x)

{

if($MYAGE>=8)

execute("setenv $TESTAGE=1");

else

execute("setenv $TESTAGE=0");

return $TESTAGE;

}

It only evaluates to 0. Am I using the age variable right? I know that in the age pop, age is in seconds.

Link to comment
Share on other sites

well i think you're complicating it slightly more than you should be :)

do this:

throw down a group pop and give it a name.. something like "Age_Over_2"..

Check off "Rule" and "Enable" and put "$AGE > 2" in for the rule.

Throw down your rotation pop.. keep activation to 1 and as your source group, put "Age_Over_2"

Thats about it :D (of course omit all " " )

EDIT:

and if you want to see the change in rotation, go to the spreadsheet and you will see those particular ones gain a different rotation value.

Link to comment
Share on other sites

Thanks for the reply. Funny that no more than 2 minutes ago I had the same idea. :D I started thinking I had these groups that group particles depening on their tx values and I thought wait what if I added age to that too. So $TX < 0 && $AGE >= 8 and there it goes. :rolleyes: Now I feel bad that I wasted so much time yelling and punching my monitor when the answer was right in front of me. <_<

Link to comment
Share on other sites

I find Houdini will do that to you :).

You come up with all these grand ideas on how to achieve something and charge off on some complex method of getting it done. And then when the dust settles you look at the result and realise that you could've achieved the same thing in about 4-5 SOPs (and it would be quicker too).

Well.... in my experience anyway :D

Marc

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