Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to set initial cloth shape
#1
Hi,
I need to simulate the following:
There is a cloth is covering a table, and a character should be able to pull it to uncover the table.
I've been able to make it work for the most part but the issue I am trying to solve is that it takes ~15 seconds for the cloth that I set on the table to take its final 'rested' position (it moves a bit during that time based on the simulation).
I do not want to have to wait for that time when I start my scene.
Is there a way to maybe have the cloth initial shape/position to be that 'final' resting state (instead of flat)? Or somehow accelerate the simulation so it takes close to 0 seconds?

My question is somewhat similar to http://obi.virtualmethodstudio.com/forum...p?tid=1613 except that I need the table cloth to still be 'live' when it rests on the table (as a character will pick it up and I need it to move/be simulated then). So I am not sure if/how I can use 'bake mesh' in this use case.
I tried using bake mesh to save a mesh and setting it as the 'input mesh' in the cloth blueprint, but not confident this is the right approach..(I am new to Obi cloth..)
Reply
#2
(02-06-2020, 06:31 AM)lbouis Wrote: Hi,
I need to simulate the following:
There is a cloth is covering a table, and a character should be able to pull it to uncover the table.
I've been able to make it work for the most part but the issue I am trying to solve is that it takes ~15 seconds for the cloth that I set on the table to take its final 'rested' position (it moves a bit during that time based on the simulation).
I do not want to have to wait for that time when I start my scene.
Is there a way to maybe have the cloth initial shape/position to be that 'final' resting state (instead of flat)? Or somehow accelerate the simulation so it takes close to 0 seconds?

My question is somewhat similar to http://obi.virtualmethodstudio.com/forum...p?tid=1613 except that I need the table cloth to still be 'live' when it rests on the table (as a character will pick it up and I need it to move/be simulated then). So I am not sure if/how I can use 'bake mesh' in this use case.
I tried using bake mesh to save a mesh and setting it as the 'input mesh' in the cloth blueprint, but not confident this is the right approach..(I am new to Obi cloth..)

Hi,

Baking the mesh, then generating a new blueprint our of it is a possibility.

An easier way is using 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 just use the new blueprint next time you want to instantiate the cloth.

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.
Reply
#3
(02-06-2020, 09:02 AM)josemendez Wrote: Hi,

Baking the mesh, then generating a new blueprint our of it is a possibility.

An easier way is using 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 just use the new blueprint next time you want to instantiate the cloth.

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.

Hi Jose,
Can you please clarify when I should call actor.SaveStateToBlueprint(blueprint)? (trying to fully understand your solution)
thanks.
Laurent
Reply