How to store frame numbers based on attribute

   2328   1   1
User Avatar
Member
47 posts
Joined: Feb. 2015
Offline
Hello everyone.

I have a long sequence where changes happen in the geometry, I have an attribute that changes to 1 whenever the geometry change happens. I would like to store which frames the attribute jumps to 1 in something like an array, does anyone know whether this is possible in VEX? and if so how?

I hope I am clear enough in what I want.
Windows 7| 24 GB RAM DDR3| AMD Athlon X4 760K Quad Core Processor 3,8 Ghz | Nvidia GTX 970 4GB
User Avatar
Member
456 posts
Joined: Nov. 2016
Offline
Yes, VEX can do that! Create an array attribute, then use a solver to compare the current frame's value to the previous one's, and push [www.sidefx.com] @Frame to your array if your conditions are met. In a wrangle node, with your current frame in input 0 and previous frame in input 1:

f[]@frameArray;
if(@testAttribute == 1 && @testAttribute != @opinput1_testAttribute) push(@frameArray, @Frame);

Hope that helps.
  • Quick Links