Obi Official Forum
Help Make cloth grow if inside collider? - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: Help Make cloth grow if inside collider? (/thread-781.html)



Make cloth grow if inside collider? - aelbannan - 07-12-2018

Hi,

Any way to make a cloth grow if it is completely inside a collider? For example, a XS tshirt inside of a very big guy. Any way to make it stretch to fit the guy?

Thanks.


RE: Make cloth grow if inside collider? - josemendez - 07-12-2018

(07-12-2018, 04:16 PM)aelbannan Wrote: Hi,

Any way to make a cloth grow if it is completely inside a collider? For example, a XS tshirt inside of a very big guy. Any way to make it stretch to fit the guy?

Thanks.

Not in a very controllable or meaningful way for your purpose, but can be done to some extent.

You can stretch or enlarge cloth by altering the distance constraints' stretching scale property:
http://obi.virtualmethodstudio.com/tutorials/distanceconstraints.html

You can also tell if particles are close or inside a collider by using collision callbacks:
http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html


RE: Make cloth grow if inside collider? - aelbannan - 08-12-2018

(07-12-2018, 05:04 PM)josemendez Wrote: Not in a very controllable or meaningful way for your purpose, but can be done to some extent.

You can stretch or enlarge cloth by altering the distance constraints' stretching scale property:
http://obi.virtualmethodstudio.com/tutorials/distanceconstraints.html

You can also tell if particles are close or inside a collider by using collision callbacks:
http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html

Thank you!

Is there any way to programatically move a particle (give it a new position)? I'm not having any luck finding this in the API.


RE: Make cloth grow if inside collider? - josemendez - 08-12-2018

(08-12-2018, 04:36 AM)aelbannan Wrote: Thank you!

Is there any way to programatically move a particle (give it a new position)? I'm not having any luck finding this in the API.

Yep. Use Oni.SetParticlePositions(). See:
http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html


RE: Make cloth grow if inside collider? - aelbannan - 09-12-2018

(08-12-2018, 02:15 PM)josemendez Wrote: Yep. Use Oni.SetParticlePositions(). See:
http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html

Thank you!