tinboy Posted January 26, 2015 Share Posted January 26, 2015 Hi guysThe following reads when a particle comes in a group and creates an attribute assigning the frame number when it came in the group for it: Attribute Node: Default: -1 Value: if(ENTER_RELEASE == -1, $F, @ENTER_RELEASE) I'm trying to re-write it as a vex expression in a popwrangle node as follow:@enter_release = -1;if(@enter_release==-1)@enter_release = @Frame; else @enter_release = @enter_release;It displays the frame number when the particle came into the group but instead of displaying the same frame number when it came in it keeps on displaying the current frame number the whole time.What am I missing here? Quote Link to comment Share on other sites More sharing options...
tinboy Posted January 26, 2015 Author Share Posted January 26, 2015 I've tried writing it like this and it still doesn't work:@enter_release = -1;if(@enter_release==-1) { @enter_release = @Frame; } else { @enter_release==@enter_release;} Quote Link to comment Share on other sites More sharing options...
Skybar Posted January 26, 2015 Share Posted January 26, 2015 Because you are setting enter_release = -1 at the beginning, the if-statement will always return true. Quote Link to comment Share on other sites More sharing options...
rayman Posted January 26, 2015 Share Posted January 26, 2015 use float @enter_release = -1; to set the default. Quote Link to comment Share on other sites More sharing options...
tinboy Posted January 26, 2015 Author Share Posted January 26, 2015 Cool! Thanks guys, it worked 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.