Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Initialize a softbody on scaled objects via script
#4
(23-08-2019, 10:16 AM)aznaf Wrote: Thank you for your reply, but I couldn't find a scene named "RuntimeCloth".

Are we still talking about Obi Softbody Huh

My apologies, since you were talking about character skin, I assumed we were talking about ObiCloth. Didn't even realize we are in the ObiSoftbody subforum  Triste .

Same thing applies to soft bodies though. Keep in mind that softbody generation involves two steps:
generate the particle representation using a skinned mesh, then bind another skinned mesh to it via ObiSoftbodySkinner. Both meshes don't need to be the same one.

I assume you use the same mesh for both generation and skinning. Once you have your bone scale baked into your shared mesh vertices as I described in the previous post (which is outside of the scope of Obi), generating the soft body is done by calling the GeneratePhysicRepresentationFromMesh coroutine.

Code:
yield return softbody.StartCoroutine(actor.GeneratePhysicRepresentationForMesh());

After this coroutine is completed, then bind the skin by calling the skinner's BindSkin coroutine:
Code:
yield return skinner.StartCoroutine(skinner.BindSkin());

Finally, assuming your softbody has been assigned a solver, add it to the solver to start simulation:
Code:
softbody.AddToSolver(null);
Reply


Messages In This Thread
RE: Initialize a softbody on scaled objects via script - by josemendez - 23-08-2019, 10:47 AM