Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Cannot bind skin on large objects
#1
Hello,

I have tried several times to bind a skin to this model without succeding. Video of the issue here.

I have enlarged it from this model, which seems to work fine. I have scaled it up and rotated in blender before exporting again.

The issue is that I need to scale it up about 5 times but using the solver transform causes visual issues.

I also get this error when pressing play
Mesh.SetBoneWeights() failed: Vertex 0 has zero weights.
UnityEngine.Mesh:SetBoneWeights (Unity.Collections.NativeArray`1<byte>,Unity.Collections.NativeArray`1<UnityEngine.BoneWeight1>)
Obi.ObiSoftbodySkinner:SetBoneWeights () (at Assets/Obi/Scripts/Softbody/Rendering/ObiSoftbodySkinner.cs:386)
Obi.ObiSoftbodySkinner:Setup () (at Assets/Obi/Scripts/Softbody/Rendering/ObiSoftbodySkinner.cs:135)
Obi.ObiSoftbodySkinner:UpdateSoftBones (Obi.ObiActor) (at Assets/Obi/Scripts/Softbody/Rendering/ObiSoftbodySkinner.cs:218)
Obi.ObiActor:Interpolate () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:1223)
Obi.ObiSoftbody:Interpolate () (at Assets/Obi/Scripts/Softbody/Actors/ObiSoftbody.cs:288)
Obi.ObiSolver:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Solver/ObiSolver.cs:1641)
Obi.ObiUpdater:Interpolate (single,single) (at Assets/Obi/Scripts/Common/Updaters/ObiUpdater.cs:132)
Obi.ObiFixedUpdater:Update () (at Assets/Obi/Scripts/Common/Updaters/ObiFixedUpdater.cs:64)


I get no errors when generating the blueprints or binding the skin. The blueprint looks ok in edit mode.

   


What am I doing wrong?

Many thanks

Michele
Reply
#2
It would appear that increasing the Skinning max distance finally allows the skin binding but the simulation is then way to heavy. However, when I used the original model (the one I did not scale up) the simulation is not as heavy, although the number of vertices is the same?

M
Reply
#3
(29-10-2022, 12:38 PM)michele_lf Wrote: It would appear that increasing the Skinning max distance finally allows the skin binding but the simulation is then way to heavy.


Skinning max distance has no effect on the simulation whatsoever. It only affects the duration of the skinning step, which is performed in-editor only once when you hit the "Bind Skin" button. It has zero impact on performance at runtime. Its only purpose is to look for nearby bones (particles) in a radius around each vertex, so if your mesh is large, you will need to increase the Skinning max distance for vertices to be able to pick up nearby vertices.

Keep in mind how linear blend skinning works in general, in all 3D engines:

At bind time:
- Find the Nth closest bones to each vertex. (here is where Skinning max distance is used to restrict the search to a radius around each vertex).
- Store the largest N influences for each vertex.
- Calculate the bind matrix for each bone.

At runtime:
- Average the N influences for each vertex to calculate its new position.

(29-10-2022, 12:38 PM)michele_lf Wrote: However, when I used the original model (the one I did not scale up) the simulation is not as heavy, although the number of vertices is the same?


Amount of vertices has no influence whatsoever on simulation cost. The amount of particles/constraints as well as the solver settings do. Keep in mind that simulation and skinning are two completely different things, orthogonal to each other. This is not just in Obi but in any 3D physics/graphics engine.

If you have performance issues, use the profiler, as it will tell you exactly where the problem is. If you need help interpreting the profiler, you can share a screenshot of it in timeline mode and I'll help making sense of it.

kind regards,
Reply