Profile Picture

Soft cloth physics - How to freeze / stop animation?

Posted By mrl 4 Years Ago
You don't have permission to rate!
Author
Message
mrl
mrl
Posted 4 Years Ago
View Quick Profile
Veteran Member

Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 84, Visits: 1.1K
4u2ges (4/25/2020)
Here is a physics simulation/morphs combo. Done in Blender and iClone.



This is fantastic! Any suggestions for how I could learn to do something similar?



Mirror Valley
*Tales of the Strange and Unusual*
Mirror Valley on Youtube
4u2ges
4u2ges
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 5.2K, Visits: 16.4K
Thank you rosuckmedia and mrl


There are a few phases and each phase can be completed in a few different ways depending on requirements for quality,
degree of realism and the amount of time you would like to spend with it.

Here is my workflow/phases.

1 Base blanket simulation.

There are 2 ways of doing that:
a. In iClone
b. Elsewhere (Blender or other)

I used "b", but will describe both.

a. Simulate in iClone

* Simulate with Physics (Avatars must have all related collision shapes enabled and tweaked).
* Bake simulation and make it static:
* Bake baked simulation. The problem is, that baked simulation in iClone is still a simulation. It does not deform mesh statically.
That is you cannot export and apply morphs to it. To make it static you may exported it as Alembic, import into Blender, export as OBJ and import back to iClone.
You would now have a totally static mesh.

b. Simulate in Blender. This is what I used for this project.

* I exported posed avatars, a bed and high resolution mesh plane to FBX out of iClone.
* Imported all to Blender.
* In physics tab I enabled "Collision" for bed and avatars body and "Cloth" go the plane.
"Outer" setting in "Collision" controls how close simulated mesh should be to the objects beneath.
("Cloth" setting you need to play with to understand it well. There are many tutorial on YouTube.)
* Played animation, stopped it at some point when blanket is settled and exported blanket to FBX and then brought to iClone.

https://forum.reallusion.com/uploads/images/cadd7ab6-3159-41ed-a80b-f9d8.jpg

The advantage of Blender simulation is, that you do not need to play with collision shapes.
Once collision is enabled for avatars, they become a "Self-Mesh" type, which bare in more accurate cloth simulation.
In iClone "Self-Mesh" type does not interact with cloth.
And the reason for that, is way too many calculation required, which in turn is not suitable with real-time engine.

2. Breath morphs

I needed to make each avatar to breath and make blanket to follow.
It might have been a lot easier if Morph Creator would not reset the posed characters to the root (resetting current Transform and Rotation to 0,0,0).
Otherwise I settled with the following routine:

* Created breath morphs for each avatar from T-pose.
This could be done before posing avatars for a bed, or setting a T-pose somewhere on the timeline,
making morphs and then deleting a T-pose key). See this tut for breathing: https://youtu.be/wURKXuRGZOU
* Exported posed avatars and simulated blanket to FBX from iClone and then to Blender.
* Both Avatars have breath morphs in Shape Keys section at this point (along with all those face morphs).
* Slide Breath shape keys to the value of 1.000 for both avatars and create 2 morphs for a blanket so that they raise the mesh above chest/stomach for both avatars.
See this tut on how to make multiple morphs for object at once: (arbitrary use relevant parts of it).

Note: Before exporting anything FBX out of Blender make sure to reset the root/origin to 0,0,0. CTRL+A and then "Location" and CTRL+A and then "Rotation and Scale".
Can't stress enough that 90% of misalignment and weird scaling of objects in iClone occur because of this rule was not followed.


3. Animating breath.

Now that you have both avatars and blanket morphs for breathing, you may animate it.
If unlike me, you use a synced breathing for avatars, then create one cycle for each avatar and a blanket, save them as Motion Plus, reapply and replicate clips along the timeline.
If you decide that avatars should be breathing with different intervals (like me), then the blanket should have clip made when 2 avatars exhale is matched at some point on the timeline.
This is what I mean:

https://forum.reallusion.com/uploads/images/c1eaafdd-03ab-449e-b23f-9d07.jpg


Note: You may use clip extend (instead of copy/paste replication as I did). It is faster but not precise.
There is bug somewhere, which adds 1 frame with clip extend and that would eventually cause de-synchronization between avatars/blanket morphs.

4. Animating characters.

This is hardest part of all. Because it would involve enabling soft cloth for the blanket again so that characters can fool around and blanket would follow.
So for this example I picked a minimal interaction and only enabled "active" cloth interaction of the blanket portion between the character where I needed it.
Here is my blanket settings and a weight map for it:

https://forum.reallusion.com/uploads/images/c7a80f94-a009-402f-bee1-897f.jpg

Regardless how well you tweaked collision shapes and how well you crafted physics settings a poke through might still occur.
Do not bother to fix them all.
Once you are done with final animation, bake the soft cloth blanket (in ByFrame mode of course) and disable physics for it.
Now you may switch to Realtime mode, move timeline scrabber and inspect all "poke" inconsistencies.
At this point either use Edit Motion Layer for characters and tweak bones fixing pokes, or you may simply hide avatars mesh with Alpha map.
As the matter of fact you may hide ALL body mesh under the blanket if the there is no intention to reveal it at some point.

Hope you find useful tips in this review and can apply them to your project.






Edited
2 Years Ago by 4u2ges
toystorylab
toystorylab
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (17.1K reputation)Distinguished Member (17.1K reputation)Distinguished Member (17.1K reputation)Distinguished Member (17.1K reputation)Distinguished Member (17.1K reputation)Distinguished Member (17.1K reputation)Distinguished Member (17.1K reputation)Distinguished Member (17.1K reputation)Distinguished Member (17.1K reputation)

Group: Forum Members
Last Active: 3 hours ago
Posts: 4.6K, Visits: 29.8K
4u2ges (4/25/2020)
Here is my workflow/phases.

Thanx for "insight" Wink



Toystorylab on Vimeo : https://forum.reallusion.com/uploads/images/ce44ea78-6984-47d8-9bf4-b783.png    Crassitudes (my "Alter Ego") on Youtube: https://forum.reallusion.com/uploads/images/fcc4df30-b3a8-40a5-a427-0735.png

rosuckmedia
rosuckmedia
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (9.4K reputation)Distinguished Member (9.4K reputation)Distinguished Member (9.4K reputation)Distinguished Member (9.4K reputation)Distinguished Member (9.4K reputation)Distinguished Member (9.4K reputation)Distinguished Member (9.4K reputation)Distinguished Member (9.4K reputation)Distinguished Member (9.4K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 3.2K, Visits: 4.8K
@4u2ges
Thank you for the workflow.Smile
Best regards rosuckmedia
mrl
mrl
Posted 4 Years Ago
View Quick Profile
Veteran Member

Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)Veteran Member (994 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 84, Visits: 1.1K
Thank you, 4u2ges! This is amazing!


Mirror Valley
*Tales of the Strange and Unusual*
Mirror Valley on Youtube
4u2ges
4u2ges
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 5.2K, Visits: 16.4K
Thank you folks! Smile




ultimativity
ultimativity
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)Distinguished Member (3.9K reputation)

Group: Forum Members
Last Active: 2 Months Ago
Posts: 356, Visits: 736
Could you share your physics settings for the sheet? This has been plaguing me for a while.

Nathan

4u2ges
4u2ges
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)Distinguished Member (22.1K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 5.2K, Visits: 16.4K
ultimativity (5/1/2020)
Could you share your physics settings for the sheet? This has been plaguing me for a while.



It is generally not easy. But please read my post with workflow. I does contain screenshots for simulation in Blender and iClone.
And also somewhat describes the process.







Reading This Topic