Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Skinned Cloth with Proxy
#1
Hi, is it still possible to use skinned mesh renderers with cloth proxies? I have a source skinned mesh renderer that simulates fine on its own, and a target skinned mesh renderer with a proxy component on it. However, the target does not appear to be affected by the simulation at all. The only difference I can think of when I compare it to the tutorial is that the tutorial uses regular mesh renderers and cloths instead, is this necessary?
Reply
#2
(16-12-2019, 09:33 PM)jp715 Wrote: Hi, is it still possible to use skinned mesh renderers with cloth proxies? I have a source skinned mesh renderer that simulates fine on its own, and a target skinned mesh renderer with a proxy component on it. However, the target does not appear to be affected by the simulation at all. The only difference I can think of when I compare it to the tutorial is that the tutorial uses regular mesh renderers and cloths instead, is this necessary?

SkinnedMeshRenderers with proxies are fully supported, in fact the CharacterCloth sample scene uses them.

Can you provide more details about your setup?
Reply
#3
(16-12-2019, 09:34 PM)josemendez Wrote: SkinnedMeshRenderers with proxies are fully supported, in fact the CharacterCloth sample scene uses them.

Can you provide more details about your setup?

So I've tested this with:
  • Two solvers/fixed updaters, one with a source child object with the low poly mesh, the other with a target child object with the high poly mesh
  • One solver/fixed updater, with one child object with a low poly skinned mesh renderer source with skinned cloth and skinned cloth renderer components, and another child object with the high poly skinned mesh renderer target with a cloth proxy component
  • One solver/fixed updater with one high poly skinned mesh renderer, that has all three components on it, the skinned cloth component (using the low poly mesh's cloth blueprint), skinned cloth renderer, and cloth proxy component (pointing to the skinned cloth component on the same object)
  • One solver/fixed updater with one high poly skinned mesh renderer, that has all three components on it, the skinned cloth component (using the high poly mesh's cloth blueprint), skinned cloth renderer, and cloth proxy component (pointing to the skinned cloth component on the same object)
Unfortunately none of these configurations work. In the first two cases, the low poly mesh renders and simulates but the high poly mesh does not move at all. In the third case, the high poly mesh becomes massively distorted, and I get a bunch of errors about an index outside of bounds. In the fourth case, the high poly mesh does appear simulated, but this seems to be driven only by the skinned cloth and skinned cloth renderer components. Just to test this, I made a triangle skin map with only the left sides of the source and target meshes selected, assuming this would result in those particles remaining fixed, but when I ran the simulation, all of the particles were simulated, as though I were only using the skinned cloth blueprint and renderer. Enabling and disabling the cloth proxy didn't seem to have any effect on the simulation.

I've also each mesh separately with their own blueprints and skinned cloth/skinned cloth renderer components and they work fine.

I took a look at the sample scene that you mentioned and noticed that it only uses one mesh as both the target and the source, so I tried replicating this, as mentioned in the last two cases above. Just out of curiosity, I went into the sample scene, and duplicated the skinned mesh renderer object and deleted some components so that one "source" object had just a skinned cloth and skinned cloth renderer component, and one "target" object had just a cloth proxy component (in addition to each regular skinned mesh renderer). This didn't seem to work either, and the mesh of the source object was simulated and the mesh of the target object was not.

I really can't think of anything else to try, if you can think of anything else that might work or if I'm doing something wrong, please let me know.

(17-12-2019, 06:56 PM)jp715 Wrote: So I've tested this with:
  • Two solvers/fixed updaters, one with a source child object with the low poly mesh, the other with a target child object with the high poly mesh
  • One solver/fixed updater, with one child object with a low poly skinned mesh renderer source with skinned cloth and skinned cloth renderer components, and another child object with the high poly skinned mesh renderer target with a cloth proxy component
  • One solver/fixed updater with one high poly skinned mesh renderer, that has all three components on it, the skinned cloth component (using the low poly mesh's cloth blueprint), skinned cloth renderer, and cloth proxy component (pointing to the skinned cloth component on the same object)
  • One solver/fixed updater with one high poly skinned mesh renderer, that has all three components on it, the skinned cloth component (using the high poly mesh's cloth blueprint), skinned cloth renderer, and cloth proxy component (pointing to the skinned cloth component on the same object)
Unfortunately none of these configurations work. In the first two cases, the low poly mesh renders and simulates but the high poly mesh does not move at all. In the third case, the high poly mesh becomes massively distorted, and I get a bunch of errors about an index outside of bounds. In the fourth case, the high poly mesh does appear simulated, but this seems to be driven only by the skinned cloth and skinned cloth renderer components. Just to test this, I made a triangle skin map with only the left sides of the source and target meshes selected, assuming this would result in those particles remaining fixed, but when I ran the simulation, all of the particles were simulated, as though I were only using the skinned cloth blueprint and renderer. Enabling and disabling the cloth proxy didn't seem to have any effect on the simulation.

I've also each mesh separately with their own blueprints and skinned cloth/skinned cloth renderer components and they work fine.

I took a look at the sample scene that you mentioned and noticed that it only uses one mesh as both the target and the source, so I tried replicating this, as mentioned in the last two cases above. Just out of curiosity, I went into the sample scene, and duplicated the skinned mesh renderer object and deleted some components so that one "source" object had just a skinned cloth and skinned cloth renderer component, and one "target" object had just a cloth proxy component (in addition to each regular skinned mesh renderer). This didn't seem to work either, and the mesh of the source object was simulated and the mesh of the target object was not.

I really can't think of anything else to try, if you can think of anything else that might work or if I'm doing something wrong, please let me know.

Should also mention, I'm using Unity 2018.4.9 for most of this, but playing around with the sample character cloth scene was in Unity 2019.3.0
Reply
#4
(17-12-2019, 06:56 PM)jp715 Wrote: So I've tested this with:
  • Two solvers/fixed updaters, one with a source child object with the low poly mesh, the other with a target child object with the high poly mesh
  • One solver/fixed updater, with one child object with a low poly skinned mesh renderer source with skinned cloth and skinned cloth renderer components, and another child object with the high poly skinned mesh renderer target with a cloth proxy component
  • One solver/fixed updater with one high poly skinned mesh renderer, that has all three components on it, the skinned cloth component (using the low poly mesh's cloth blueprint), skinned cloth renderer, and cloth proxy component (pointing to the skinned cloth component on the same object)
  • One solver/fixed updater with one high poly skinned mesh renderer, that has all three components on it, the skinned cloth component (using the high poly mesh's cloth blueprint), skinned cloth renderer, and cloth proxy component (pointing to the skinned cloth component on the same object)
Unfortunately none of these configurations work. In the first two cases, the low poly mesh renders and simulates but the high poly mesh does not move at all. In the third case, the high poly mesh becomes massively distorted, and I get a bunch of errors about an index outside of bounds. In the fourth case, the high poly mesh does appear simulated, but this seems to be driven only by the skinned cloth and skinned cloth renderer components. Just to test this, I made a triangle skin map with only the left sides of the source and target meshes selected, assuming this would result in those particles remaining fixed, but when I ran the simulation, all of the particles were simulated, as though I were only using the skinned cloth blueprint and renderer. Enabling and disabling the cloth proxy didn't seem to have any effect on the simulation.

I've also each mesh separately with their own blueprints and skinned cloth/skinned cloth renderer components and they work fine.

I took a look at the sample scene that you mentioned and noticed that it only uses one mesh as both the target and the source, so I tried replicating this, as mentioned in the last two cases above. Just out of curiosity, I went into the sample scene, and duplicated the skinned mesh renderer object and deleted some components so that one "source" object had just a skinned cloth and skinned cloth renderer component, and one "target" object had just a cloth proxy component (in addition to each regular skinned mesh renderer). This didn't seem to work either, and the mesh of the source object was simulated and the mesh of the target object was not.

I really can't think of anything else to try, if you can think of anything else that might work or if I'm doing something wrong, please let me know.


Should also mention, I'm using Unity 2018.4.9 for most of this, but playing around with the sample character cloth scene was in Unity 2019.3.0

I think I have the same problem than you. Did you find any solution?
Reply
#5
(22-01-2020, 04:20 AM)ArsMagica Wrote: I think I have the same problem than you. Did you find any solution?

Unfortunately no, have not received any response, and haven't found a solution on my own.

I did make some progress finding out that cloth proxies work as expected with Obi Cloth Renderer (ie. not skinned meshes) but that's just a temporary solution as we will need to use skinned meshes in the final product.

Can I ask what version of unity you're using? I'm worried that the way skinned mesh renderers are handled in Unity 2018 isn't working with Obi Cloth 5 which is based around Unity 2019's implementation of skinned mesh renderers
Reply
#6
(23-01-2020, 06:33 PM)jp715 Wrote: Unfortunately no, have not received any response, and haven't found a solution on my own.

I did make some progress finding out that cloth proxies work as expected with Obi Cloth Renderer (ie. not skinned meshes) but that's just a temporary solution as we will need to use skinned meshes in the final product.

Can I ask what version of unity you're using? I'm worried that the way skinned mesh renderers are handled in Unity 2018 isn't working with Obi Cloth 5 which is based around Unity 2019's implementation of skinned mesh renderers

Anyone have any suggestions or other solutions we can try? If a sample project is needed, I'm happy to put one together.
Reply
#7
Bug 
Same in my case.

1. If I follow this tutorial: put Skinned Cloth and Skinned Cloth Renderer on the low poly mesh, and then Proxy to high poly mesh - the low poly has animated cloth, but high poly doesn't (and it should).

2. If I do it like in the example scene in the pack: put Skinned Cloth, Skinned Cloth Renderer and Cloth Proxy on the high poly model (and nothing on low poly) - the high poly changes itself to low poly mesh (!) and I get spammed with Errors (IndexOutOfRangeException: Index was outside the bounds of the array.)

So yes, the example in the pack works, but I can't replicate it, just like previous posters.

REPRO:

1. Get a hi poly model.
2. Make a low poly model by hand in a 3d modelling program (just like in the tutorial), but do not use just a part of hi poly model as your low poly model.
3. Follow the tutorial steps, except use Skinned Cloth instead of Cloth scripts.
4. Observe that hi poly mesh is not animated by the cloth on low poly mesh.
Reply
#8
(06-02-2020, 05:43 PM)kubold Wrote: Same in my case.

1. If I follow this tutorial: put Skinned Cloth and Skinned Cloth Renderer on the low poly mesh, and then Proxy to high poly mesh - the low poly has animated cloth, but high poly doesn't (and it should).

2. If I do it like in the example scene in the pack: put Skinned Cloth, Skinned Cloth Renderer and Cloth Proxy on the high poly model (and nothing on low poly) - the high poly changes itself to low poly mesh (!) and I get spammed with Errors (IndexOutOfRangeException: Index was outside the bounds of the array.)

So yes, the example in the pack works, but I can't replicate it, just like previous posters.

REPRO:

1. Get a hi poly model.
2. Make a low poly model by hand in a 3d modelling program (just like in the tutorial), but do not use just a part of hi poly model as your low poly model.
3. Follow the tutorial steps, except use Skinned Cloth instead of Cloth scripts.
4. Observe that hi poly mesh is not animated by the cloth on low poly mesh.

Hi,

Proxies won't work if the master blueprint is a skinned cloth and the slave mesh is a skinned mesh, different from the one used in the blueprint.

The reason for this is that Unity does not allow (in 2019.1 and up) to deactivate the skinning of a SkinnedMeshRenderer, not even partially. Previously you were able to supply a mesh with a weights array with zero-ed entries, or even an empty weights array, and the SkinnedMeshRenderer would still render you mesh, applying no skinning. Attempting to do this now raises an error.

This forces the slave skinned mesh renderer to be a simulated cloth itself, which defeats the purpose of using a proxy (what good is it to drive a cloth simulation using another cloth simulation?). Supported cases are:
- Master ObiCloth and slave mesh renderer.
- Master ObiSkinnedCloth and slave mesh renderer.
- Master ObiSkinnedCloth, and slave skinned mesh renderer as long as it's the same one used by the cloth. Useful in cases where part of the mesh is simulated, and other parts of the mesh driven by it. It's what we do in the CharacterCloth sample scene.
Reply
#9
(07-02-2020, 09:24 AM)josemendez Wrote: Hi,

Proxies won't work if the master blueprint is a skinned cloth and the slave mesh is a skinned mesh, different from the one used in the blueprint.

The reason for this is that Unity does not allow (in 2019.1 and up) to deactivate the skinning of a SkinnedMeshRenderer, not even partially. Previously you were able to supply a mesh with a weights array with zero-ed entries, or even an empty weights array, and the SkinnedMeshRenderer would still render you mesh, applying no skinning. Attempting to do this now raises an error.

This forces the slave skinned mesh renderer to be a simulated cloth itself, which defeats the purpose of using a proxy (what good is it to drive a cloth simulation using another cloth simulation?). Supported cases are:
- Master ObiCloth and slave mesh renderer.
- Master ObiSkinnedCloth and slave mesh renderer.
- Master ObiSkinnedCloth, and slave skinned mesh renderer as long as it's the same one used by the cloth. Useful in cases where part of the mesh is simulated, and other parts of the mesh driven by it. It's what we do in the CharacterCloth sample scene.


Hi,

I am seeing the same issue being reported here, Unity 2019.4.24f1,  low poly cloth works, but proxy is not simulating high poly version. Mesh renderer is used on high poly one, cloth renderer on low poly one.
I believe the issue is that when I try to "bind" in the triangle skinmap I see the error:

IndexOutOfRangeException: Index was outside the bounds of the array.
Obi.ObiTriangleSkinMap+<Bind>d__31.MoveNext () (at Assets/Obi/Scripts/Cloth/DataStructures/ObiTriangleSkinMap.cs:515)
Obi.CoroutineJob+<Start>d__15.MoveNext () (at Assets/Obi/Scripts/Common/Utils/Coroutines/CoroutineJob.cs:99)
UnityEngine.Debug:LogException(Exception)
Obi.<Start>d__15:MoveNext() (at Assets/Obi/Scripts/Common/Utils/Coroutines/CoroutineJob.cs:108)
Obi.EditorCoroutine:ShowCoroutineProgressBar(String, IEnumerator&) (at Assets/Obi/Scripts/Common/Utils/Coroutines/EditorCoroutine.cs:21)
Obi.ObiTriangleSkinMapEditor:UpdateEditMode() (at Assets/Obi/Editor/Cloth/ObiTriangleSkinMapEditor.cs:332)
Obi.ObiTriangleSkinMapEditor:OnInspectorGUI() (at Assets/Obi/Editor/Cloth/ObiTriangleSkinMapEditor.cs:137)
UnityEngine.GUIUtilityLenguarocessEvent(Int32, IntPtr)

Please fix this error, what is going on here?

Thanks.
Reply
#10
Hi,

Make sure you're not using skinned cloth for both slave and master, as this it's currently unsupported as explained in this thread. Let me know otherwise so that I can take a look at your use case.

kind regards,
Reply