Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  Problems integrating Obi Cloth with UMA 2, no particle contacts
#1
Corazón 
Hello!

I'm currently trying to integrate UMA and OBI Cloth for more realism.
Basically, all I did is detect when I add a ''Wardrobe Item' and then add Obi skinned components with the right blueprint. Btw the blueprint mesh was pre-generated from the slot mesh data generated by UMA so they are the same... For now, there is no painting on blueprints.

Video: https://youtu.be/WdDoFctGanU\

But I have 3 problems:

- At the start, the top cloth is colliding properly with the top cloth but as soon as I change the TOP item the top part is not colliding anymore, all I do is switch the blueprint, do I have to destroy everything and add new components? How can I improve TOP and BOTTOM collision?

- I noticed that I'm getting this error:
   
Is it because the ObiSkinnedRenderer replaces the generated mesh by UMA with the mesh from the blueprint? Do you know how to create a copy of the mesh at runtime so UMA can delete it and it will not cause problems... 

- The sleeves of the shirt are always clipping? I'm not sure why but If I paint low skin radius they will not move as much as they should move. Do you have some tips for the sleeves of the shirt?

The simulation is pretty good, I'm sure that with proper painting will be amazing!! Thank you again for the amazing asset. I can't wait for new updates!!!
Reply
#2
(10-11-2021, 12:59 AM)chris_stamati Wrote: - At the start, the top cloth is colliding properly with the top cloth but as soon as I change the TOP item the top part is not colliding anymore, all I do is switch the blueprint, do I have to destroy everything and add new components? How can I improve TOP and BOTTOM collision?

If you're simply switching blueprints, the skin constraints specified by the blueprint will be used. These are responsible for "collisions" in skinned cloth (though as you know, they're not really collisions). It *should* work. How are you switching to the new blueprint? Is the blueprint being generated at runtime, or pre-made in editor?

(10-11-2021, 12:59 AM)chris_stamati Wrote: - I noticed that I'm getting this error:

Is it because the ObiSkinnedRenderer replaces the generated mesh by UMA with the mesh from the blueprint? Do you know how to create a copy of the mesh at runtime so UMA can delete it and it will not cause problems... 

Obi already creates a copy of the SkinnedMeshRenderer's mesh, and uses it for deformation and rendering. Not sure how UMA handles meshes internally, but making a copy of a mesh at runtime is as simple as:

Code:
var copy = Instantiate(mesh);

(10-11-2021, 12:59 AM)chris_stamati Wrote: - The sleeves of the shirt are always clipping? I'm not sure why but If I paint low skin radius they will not move as much as they should move. Do you have some tips for the sleeves of the shirt?

Either skin backstop parameters are not properly set, or there's a delay between the animation and the simulation. I'd bet its the latter.
Make sure that simulation is being updated after character animation (otherwise you'll always have a 1-frame delay between them). This means using the right combination of update modes for the animator and Obi. For instance: set the animator to "update physics", and use a ObiLateFixedUpdater component to update Obi. Or, set the animator mode to "normal", and use ObiLateUpdater. See:
https://docs.unity3d.com/Manual/ExecutionOrder.html

If you leave the animator in normal mode (the default) and use ObiLateFixedUpdater, the simulation will be updated at the end of FixedUpdate() and the animation will be updated in Update(). This will cause the simulation to work with animation data that is 1-frame old.

Quote:The simulation is pretty good, I'm sure that with proper painting will be amazing!! Thank you again for the amazing asset. I can't wait for new updates!!!

Thanks! there's a small update to cloth coming soon, though it focuses more on softbodies and ropes. A big cloth update is scheduled a couple months from now Sonrisa.
Reply
#3
Hello,

thanks for the quick reply!

Basically, I made an ObiSetupManager component that listens for character updates (Add or Remove Clothes). 
1. When I click on a UI item Uma automatically adds a cloth to an avatar on a separated skinned mesh renderer, when the cloth is generated OnCharacterUpdated gets called.
2. I then loop through all the skinnedmeshrenderers and if it's a cloth item I add an ObiSetupComponent that will add the Skinned Cloth and Skinned Cloth Renderer.
3. I assign the BlueprintProvider which is a scriptable object containing all the references to blueprints
4. When the name of the current skin renderer gets updated with a new cloth item I just get the new blueprint and assign it...

Here's the video: https://youtu.be/MCGP2yXBa5I

This is how I assign a blueprint
   

I really have no clue!! I'm desperately searching for a solution ahah
Thanks again!!
Reply
#4
(10-11-2021, 12:07 PM)chris_stamati Wrote: Hello,

thanks for the quick reply!

Basically, I made an ObiSetupManager component that listens for character updates (Add or Remove Clothes). 
1. When I click on a UI item Uma automatically adds a cloth to an avatar on a separated skinned mesh renderer, when the cloth is generated OnCharacterUpdated gets called.
2. I then loop through all the skinnedmeshrenderers and if it's a cloth item I add an ObiSetupComponent that will add the Skinned Cloth and Skinned Cloth Renderer.
3. I assign the BlueprintProvider which is a scriptable object containing all the references to blueprints
4. When the name of the current skin renderer gets updated with a new cloth item I just get the new blueprint and assign it...

Here's the video: https://youtu.be/MCGP2yXBa5I

This is how I assign a blueprint


I really have no clue!! I'm desperately searching for a solution ahah
Thanks again!!

Hi!

I just tried very similar code and it works fine for me. Assigning a new blueprint just takes the actor out of the solver, loads the new blueprint data, and readds the actor to the solver. This is basically the same thing that happens when you first start the scene.

I don't think I can be of any help without further details about your project.
Reply
#5
(12-11-2021, 10:36 AM)josemendez Wrote: Hi!

I just tried very similar code and it works fine for me. Assigning a new blueprint just takes the actor out of the solver, loads the new blueprint data, and readds the actor to the solver. This is basically the same thing that happens when you first start the scene.

I don't think I can be of any help without further details about your project.

Hi Jose!

Here is a video in where I present more about the problem: https://youtu.be/ce7T2Y0d-28
I kinda found the solution but Idk if it's the right one! But it works. If you have some tips on how to improve the simulation it would be great!

And if you need, this is the sample: https://github.com/christianstamati/obi-cloth-test.git

Thanks again for the great support! 
Reply