Jump to content
charly

set and get persistant attibute

Recommended Posts

Hi,

I'm trying to increment a point attibute value over time in vex.

A basic exemple would be to animate a group node to increment a counter each time it select points.

Then, emitt particles if the points have been selected 3 times, or be able to know if a point has already been selected before.

 

So I tryed to do a setpointattrib to a node that is not time dependent, but it doesn't seem to work.

Is there a way to do it in vex ?

 

Thanks,

Charles

 

 

set_get_persistant_value.jpg

Share this post


Link to post
Share on other sites

You don't need to use setpointattrib inside a point wrangle. Just assign your value directly to the attribute. The attribute wrangle acts as an implied for/loop which loops over all the points automatically.

f@my_float = 1.0;
i@my_int = 1;
s@my_string = "Hello World";
f@my_frame = @Frame;
f@mytime = @Time;

 

Share this post


Link to post
Share on other sites

I find out how to increment the value the way I want using the sop solver.

But I'm still interested in a clener way to do it, like using an array for the selected points.

Because the Wrangle get generate each frame, the best solution to keep an array seems to be with Python.

 

Charles

 

 

increment_value.jpg

increment_value_new_selection.hiplc

Share this post


Link to post
Share on other sites

Hi Atom, thanks for your answer,

My issue was to increment only on time when it's selected and not every frames.

Then increment again only if the bounding box leaves and come back.

 

Charles

Share this post


Link to post
Share on other sites

Shorter version ("trigger_grp" renamed to "trigger"):

i@count = i@opinput1_count + (i@group_trigger && !i@opinput1_group_trigger);

Solver is a cleanest way to do something over time, I think. Everything after animated Group node will be time dependent and cook every frame.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×