Page 1 of 1

Evaluate scripts during % of substeps

Posted: Mon Aug 01, 2011 3:44 pm
by Jorge Medina
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?

Re: Evaluate scripts during % of substeps

Posted: Tue Aug 30, 2011 3:14 pm
by Alex
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%

Re: Evaluate scripts during % of substeps

Posted: Tue Aug 30, 2011 3:24 pm
by Jorge Medina
Thank you, I´ll test this.