Evaluate scripts during % of substeps

Post Reply
Jorge Medina
Posts: 71
Joined: Wed Jun 09, 2010 6:23 pm

Evaluate scripts during % of substeps

Post by Jorge Medina » Mon Aug 01, 2011 3:44 pm

Hi!
I am working on a script is only evaluated during a % selected by the user. For istance, given a simulation frame that need 120 substeps to simulate, I would like be able to evaluate the script only 50% or less of the simulated substeps.
Is there any function to manage the substeps?
Jorge Medina Alix
VFX TD / 3DFluids Consultancy

Tech RF Blog: RF Wisdom
Personal works (WIP): Liquid Entropy

User avatar
Alex
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: Evaluate scripts during % of substeps

Post by Alex » Tue Aug 30, 2011 3:14 pm

Hi Jorge,

at the moment all you can use to check the step is getting the current time of the simulation and comparing it with some threshold of your own.

For example, you might save the last simulation time you executed your function and don't execute it again unless X time has passed.
in a 200 substeps simulation at 30 FPS you would set this threshold to 1/30/200 * 100/X%
Alex Ribao
RealFlow Team
Next Limit Technologies

Jorge Medina
Posts: 71
Joined: Wed Jun 09, 2010 6:23 pm

Re: Evaluate scripts during % of substeps

Post by Jorge Medina » Tue Aug 30, 2011 3:24 pm

Thank you, I´ll test this.

Post Reply