Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Obi cloth does not properly work for models stitched to an existing skeleton.
#1
I "stitch" newly created skinned models for my main character to an existing skeleton in my Unity project using a script. That is the only way I know how to attach a new model to my skeletaly animated character. Unfortunately adding Obi cloth to such models makes the plugin work with bugs: editing points gets bugged because the plugin thinks that the points are still located where the initial cloth GameObject was, assigning parameters to points is impossible and I am pretty sure self-collision with other skinned meshes on the recipient skeleton is not working either. I have created a Unity 2017.2 project with a scene that has everything set up for stitching a model to an existing skeleton, to stitch the model - just right click on a "Stitcher editor" script located on a "Shirt" GameObject in the "Bug scene" ("Scenes/Bug scene") and choose "Stitch skinned mesh".

Link to a screenshot:
http://piccy.info/view3/12327021/da782b2...7d9e60eb3/



Link to the project:

https://drive.google.com/open?id=178A31T...j7r--g8qNf


Please try it out and tell me if there is a workaround for such case.

P.S. Jesus guys this forum tech is a mess. I had to attach my file from the google drive and screenshots are impossible to embed. Such a shame to have such poor forum for a HQ product like Obi.
Reply
#2
(13-05-2018, 06:03 PM)cubrman Wrote: P.S. Jesus guys this forum tech is a mess. I had to attach my file from the google drive and screenshots are impossible to embed. Such a shame to have such poor forum for a HQ product like Obi.

We don't understand what you mean by this. Anybody is able to attach just some kind of formats except .exes and similar dangerous items. Images are all allowed, but we set up a reasonable space limit because people should take care of the size of their uploads like in any other forum, otherwise it would be overloaded by contents. What is it that you couldn't attach?. Do you see the attach button underneath the post text box?

The forum is managed by only two people, we have to set a lot of checks and controls to avoid the huge amount of spam we receive.

Maybe what you want to do is embed your image inside the post? I'll show you in the next post.


Thanks
Co-Founder of Virtual Method Studio
Obi product support team
Reply
#3
To embed an image attach it at the end. Then click the button to "add it" on the right side. Then in the list of attachments, you can click "insert in the message".

You'll see it like this:

[attachment=129]
Co-Founder of Virtual Method Studio
Obi product support team
Reply
#4
(13-05-2018, 06:03 PM)cubrman Wrote: I "stitch" newly created skinned models for my main character to an existing skeleton in my Unity project using a script. That is the only way I know how to attach a new model to my skeletaly animated character. Unfortunately adding Obi cloth to such models makes the plugin work with bugs: editing points gets bugged because the plugin thinks that the points are still located where the initial cloth GameObject was, assigning parameters to points is impossible and I am pretty sure self-collision with other skinned meshes on the recipient skeleton is not working either. I have created a Unity 2017.2 project with a scene that has everything set up for stitching a model to an existing skeleton, to stitch the model - just right click on a "Stitcher editor" script located on a "Shirt" GameObject in the "Bug scene" ("Scenes/Bug scene") and choose "Stitch skinned mesh".

Link to a screenshot:
http://piccy.info/view3/12327021/da782b2...7d9e60eb3/



Link to the project:

https://drive.google.com/open?id=178A31T...j7r--g8qNf


Please try it out and tell me if there is a workaround for such case.

P.S. Jesus guys this forum tech is a mess. I had to attach my file from the google drive and screenshots are impossible to embed. Such a shame to have such poor forum for a HQ product like Obi.

Hi Cubrman,

Your stitcher script is not setting the root bone correctly (not setting it all, the original root bone is kept), which is critical for Unity to calculate the renderer's bounding box and skin space basis. As it is now, the shirt will get culled incorrectly (it will disappear when the old bounding box gets out of the camera frustum, regardless of using Obi Cloth or not) and any functionality dependent on transforming to/from skin space (like Obi) will not work properly, as the old skin basis is still used after stitching. Correct your script and things will work as intended.
Reply
#5
(14-05-2018, 09:04 AM)lidiamartinez Wrote: To embed an image attach it at the end. Then click the button to "add it" on the right side. Then in the list of attachments, you can click "insert in the message".

You'll see it like this:

Well I tried embeding the image I attached to my post (the link) and it did not work - the preview did not show the image properly and I did not want to chance posting it - I just left a link. I even tried specifying the size. Try it yourself - I use Chrome.

I saw the attach button and I used it, but after I submitted the form I got an error saying that such format (.rar) is not allowed. I never ran a forum, maybe I am just ignorant, but I feel like being able to attach a .rar file in a support forum is quite a necessity. I find it hard to believe that there are so many people willing to attach malevolent content. At the same time I found a way to sidestep this limitation which renders it useless.

(14-05-2018, 09:13 AM)josemendez Wrote: Hi Cubrman,

Your stitcher script is not setting the root bone correctly (not setting it all, the original root bone is kept), which is critical for Unity to calculate the renderer's bounding box and skin space basis. As it is now, the shirt will get culled incorrectly (it will disappear when the old bounding box gets out of the camera frustum, regardless of using Obi Cloth or not) and any functionality dependent on transforming to/from skin space (like Obi) will not work properly, as the old skin basis is still used after stitching. Correct your script and things will work as intended.


Huge thanks for a prompt reply. I've changed the root bone this way:

var skinnedMeshRenderers = sourceClothing.GetComponentsInChildren<SkinnedMeshRenderer> ();

foreach (var sourceRenderer in skinnedMeshRenderers)
{
sourceRenderer.bones = TranslateTransforms(sourceRenderer.bones, boneCatalog);
sourceRenderer.rootBone = targetAvatar.transform;   /// <- Changing the root bone.
}

And now I can paint the values and editing works fine, however, when I reload the project the Obi mesh is not aligned with the actual mesh:

http://oi66.tinypic.com/2u7wxma.jpg

[Image: 2u7wxma.jpg]

This can be fixed by pressing the "Play" button and it is no longer a problem for me, but I wonder if I've missed something again?

P.S. Alright this time the image seems to have embeded fine, maybe the problem was with my hosting service (piccy.info) or with the image size, still I would check this issue if I were you.

Btw, I don't know how hard it is to implement a CTRL+Z functionality for your "Edit particles" mode but it is badly needed.
Reply
#6
(14-05-2018, 12:35 PM)cubrman Wrote: Well I tried embeding the image I attached to my post (the link) and it did not work - the preview did not show the image properly and I did not want to chance posting it - I just left a link. I even tried specifying the size. Try it yourself - I use Chrome.

I saw the attach button and I used it, but after I submitted the form I got an error saying that such format (.rar) is not allowed. I never ran a forum, maybe I am just ignorant, but I feel like being able to attach a .rar file in a support forum is quite a necessity. I find it hard to believe that there are so many people willing to attach malevolent content. At the same time I found a way to sidestep this limitation which renders it useless.



Huge thanks for a prompt reply. I've changed the root bone this way:

var skinnedMeshRenderers = sourceClothing.GetComponentsInChildren<SkinnedMeshRenderer> ();

foreach (var sourceRenderer in skinnedMeshRenderers)
{
sourceRenderer.bones = TranslateTransforms(sourceRenderer.bones, boneCatalog);
sourceRenderer.rootBone = targetAvatar.transform;   /// <- Changing the root bone.
}

And now I can paint the values and editing works fine, however, when I reload the project the Obi mesh is not aligned with the actual mesh:

http://oi66.tinypic.com/2u7wxma.jpg

[Image: 2u7wxma.jpg]

This can be fixed by pressing the "Play" button and it is no longer a problem for me, but I wonder if I've missed something again?

P.S. Alright this time the image seems to have embeded fine, maybe the problem was with my hosting service (piccy.info) or with the image size, still I would check this issue if I were you.

Btw, I don't know how hard it is to implement a CTRL+Z functionality for your "Edit particles" mode but it is badly needed.

Hi there,

The avatar transform is not the root bone, in fact it is not even a bone.

The root bone of a skeleton is usually the pelvis bone (I believe yours is named "pelvisZ"), which is always a child of the character transform and which might (usually does) have a different local orientation and of course, position. This is most likely the source of your issue: your pelvis bone is rotated 90º relative to your character transform, and way up higher that the character transform (which is usually at the floor, between both feet).

The solution is easy: simply use the character SkinnedMeshRenderer's root bone as the cloth SkinnedMeshRenderer's root bone.

Most particle editor operations work together with Unity's built-in undo system (regular crtl-z), can you specify what operation is not undone by using ctrl-z?
Reply
#7
(14-05-2018, 12:35 PM)cubrman Wrote: I saw the attach button and I used it, but after I submitted the form I got an error saying that such format (.rar) is not allowed. I never ran a forum, maybe I am just ignorant, but I feel like being able to attach a .rar file in a support forum is quite a necessity. I find it hard to believe that there are so many people willing to attach malevolent content.

We get around 100 rejected spammers trying to join the forum everyday, around 1 user purged every day, and maybe 7 spam posts that make it to the forum every week.
It's getting worse, due to the popularity and coverage of our assets, we guess...

Our website has been hijacked twice in these months, and stuff changed from our internal files, in fact.

.rar files cannot be analyzed by our virus system and in general it cannot be analyzed in google drive, either. That's a typical thing to avoid. It's better if you use wetransfer or something similar or maybe send us a direct email. We are sorry about this, really.
Co-Founder of Virtual Method Studio
Obi product support team
Reply
#8
(14-05-2018, 01:17 PM)josemendez Wrote: Hi there,

The avatar transform is not the root bone, in fact it is not even a bone.

The root bone of a skeleton is usually the pelvis bone (I believe yours is named "pelvisZ"), which is always a child of the character transform and which might (usually does) have a different local orientation and of course, position. This is most likely the source of your issue: your pelvis bone is rotated 90º relative to your character transform, and way up higher that the character transform (which is usually at the floor, between both feet).

The solution is easy: simply use the character SkinnedMeshRenderer's root bone as the cloth SkinnedMeshRenderer's root bone.

Most particle editor operations work together with Unity's built-in undo system (regular crtl-z), can you specify what operation is not undone by using ctrl-z?

Ok with the Pelvis everything works perfectly. There is still some weird issue, but I believe it is due to the fact that I am using Final IK (in some cases the wrong animation is being played on the cloth), I will dig deeper into it and try to solve it myself first.

The CTRL+Z does not work when setting values for points. So say I have selected a bunch of points, chose "Skin radius" and then set it to 1. If I press CTRL+Z the selection is gone (the cloth GameObject is no longer selected), when I re-select it I can see that nothing has been reverted. Same of basically everything els: Ctrl+Z simply cancels the selection of the cloth GameObject.
Reply
#9
A few questions if I may:

1) Is there any way to save the edits done during play mode for the Obi Cloth component (in Edit Particles mode)? I tried the good-old copy component/paste component values but that just breaks the whole thing.

2) Is there a way to export the edits of the particles into a file? And then load it? This thing breaks way to often (meaning I loose my edits).

3) How can I find out which skinned meshes (that are not the cloth) are taken into account as the collision for the cloth? I have a suspicion that some meshes are omitted.

4) This is bloody insane: I set my skin radius for unpinned points to some value and after I play in editor it just reverts back to the previous value! Srsly what is going on? I cannot trust any of my actions!
Edit: Ok I think I was able to track the bug for the last point: apparently you cannot revert back to the prefab state you saved. This ruins the cloth. At least it produces the bugs described above. Guys what am I doing wrong? I have a feeling this is not supposed to happen!
Reply
#10
(14-05-2018, 06:41 PM)cubrman Wrote: A few questions if I may:

1) Is there any way to save the edits done during play mode for the Obi Cloth component (in Edit Particles mode)? I tried the good-old copy component/paste component values but that just breaks the whole thing.

2) Is there a way to export the edits of the particles into a file? And then load it? This thing breaks way to often (meaning I loose my edits).

3) How can I find out which skinned meshes (that are not the cloth) are taken into account as the collision for the cloth? I have a suspicion that some meshes are omitted.

4) This is bloody insane: I set my skin radius for unpinned points to some value and after I play in editor it just reverts back to the previous value! Srsly what is going on? I cannot trust any of my actions!
Edit: Ok I think I was able to track the bug for the last point: apparently you cannot revert back to the prefab state you saved. This ruins the cloth. At least it produces the bugs described above. Guys what am I doing wrong? I have a feeling this is not supposed to happen!

1) Nope, edits during play mode are not saved (not in Obi, but in Unity in general. You need to be in editor mode for changes to be saved).

2) You can import per-particle values from texture channels. See:
http://obi.virtualmethodstudio.com/tutor...iting.html

3) No skinned meshes are taken into account for cloth collision, at all. Collision detection  just does not work that way in any realtime cloth simulator (it would be unbearably slow, imprecise and error-prone to detect collisions agains other deformable meshes). Cloth only considers colliders and the skinned vertices of its own mesh, just like Unity's default cloth, Havok, Apex, NvCloth, and others. This results in cheap "collision" against the cloth's animated mesh:a cape that has been bound/skinned to the skeleton 5 cm away from the character's back will be allowed to separate 10 or 20 cms during simulation (the exact distance being determined by the particle's "skin radius"), but will not be allowed to get closer than 5 cms.

See:
http://obi.virtualmethodstudio.com/tutor...aints.html

4) We are unable to reproduce this behavior, setting per-particle values (skin radius specifically) pressing play in the particle editor then rewinding, causes no values to be lost. Also you can revert back to the prefab values just fine (per-particle properties are simple arrays, serialized by Unity, we don't do any custom serialization stuff). Just don't forget to reassign any external references to the scene (most notably the solver component) when reverting to prefab values, as Unity does not serialize any external references in prefabs. We use prefabs constantly in an internal project and no one has had issues with this. Can you send a video or something of the process you're following?
Reply