Jump to content

VEX, evaluate once for creating attribute


Recommended Posts

Whenever this VEX code is being evaluated, it is done so as if it was for the first time. It has no knowledge of previous evaluations (frames?)—the variable values are not persisted across the evaluations, and thus you will never end up having `temp` being equal to 0 before evaluating your `if` condition.

 

Evaluating and manipulating the values of an entire frame range is a job well suited for CHOPs. I've modified your scene to do just that.

 

Note that since CHOP evaluates the full frame range before outputting its result, things might get slow if the input graph is slow to evaluate. Maybe there's a better approach?

 

example_0-Edit1.hipnc

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