Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to set relaxed state on first frame? (Sth. similar to prewarm?)
#2
Hi there,

You can use actor.SaveStateToBlueprint(blueprint). This will save current particle positions and velocities to a blueprint. Make sure you save to a copy of your current blueprint, though! (that is, var passThisOne = Instantiate<ObiActorBlueprint>(rope.blueprint); )

Then use it the next time you want to instantiate the actor.

Btw, this is the method Obi uses internally when you switch to a new solver at runtime, to ensure data from the current solver is passed on to the new one: before leaving the current solver, it calls SaveStateToBlueprint on a copy of its current blueprint, and after entering the new solver, it loads this copy instead of the original blueprint.

cheers!
Reply


Messages In This Thread
RE: How to set relaxed state on first frame? (Sth. similar to prewarm?) - by josemendez - 27-04-2020, 03:17 PM