benttoenail Posted September 6, 2019 Share Posted September 6, 2019 (edited) Simple problem, cannot find the solution. I need to set an attribute based on the current frame, something like this: if(@Cd.r >= 0.9){ f@t = @Frame; } ...and I need @t to hold that value, and not change along with the current frames. Why I need this: I'm trying to control the offset of animated redshift instances by starting the animation once @Cd.r passes a certain threshold. Once the animation starts, the counter for that specific instanced object needs to start at 0, and increase along with the time slider, like so: @f = @Frame - @t; string frameNumber = sprintf("%g%", @f); s@instancefile = concat("$HIP/filepath.", framenumber, ".rs"); Any idea on how to do this? Edited September 6, 2019 by benttoenail Quote Link to comment Share on other sites More sharing options...
Atom Posted September 6, 2019 Share Posted September 6, 2019 (edited) What I have done before is to pre-generate the start and end frame, then only generate a valid s@instancefile, when I am within that frame range. Use a null based geo file to reference in all other cases. if((@Frame>@start) && (@Frame<@end)){ int current_frame = @Frame-@start; s@instancefile = sprintf("myfile_%02d.rs",current_frame); } else { s@instancefile = "my_blank.rs"; } Edited September 6, 2019 by Atom Quote Link to comment Share on other sites More sharing options...
tamagochy Posted September 6, 2019 Share Posted September 6, 2019 use sop solver to hold this value by checking if @t already >0 Quote Link to comment Share on other sites More sharing options...
Dubtronics Posted February 18, 2021 Share Posted February 18, 2021 Hey did you manage to get a system working for this? I am trying out the two suggestions above. 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.