20-01-2026, 11:35 AM
(19-01-2026, 11:10 AM)josemendez Wrote: The main issue with skinned cloth is that it needs to be, well, skinned. In cases where you have lots of different clothing that must be worn by a single character/mannequin (or even worse, multiple characters of varying body shapes/sizes) the amount of artist work required skyrockets, as they must now skin every clothing piece to every possible body that may wear it. This typically makes it an impractical approach unless you can procedurally skin the cloth mesh to the character's skeleton upon deciding which cloth/body combination you want, which presents its own set of hurdles. If you've already figured out a solution to this or if it's not a problem in your case, forget what I just said.
Gotcha. I presume that the ObiSkinnedCloth is not generating the necessary batches, because there’s no skin data present on the mesh for it to work with?
In this case we’ll have to make code to procedurally skin the cloth meshes, as they’re entirely procedurally generated (edited by the user) at runtime. I imagine the simplest solution is to, for each vertex, calculate bones within a certain distance (or the points inbetween the bones for things like limbs), and reference those bones’ index in the added bone weights. Weightings could be calculated on either proximity, or perhaps vertical position, as the higher fabric would potentially stretch to support the weight of the lower one.
Can this be done after simulation starts? The way our system works currently, the garments are made of several flat meshes, that are wrapped around the body and stitched together through the simulation. If not, I’ll have to make code that modifies the meshes themselves to fit around the body. Fortunately I already spent some time working on this to try and solve a different problem, but I’ll still need to allocate time to finish it. I don't think it'll be practical to show our existing code, as the necessary functionality is stretched out amongst a lot of different classes and it'll be hard to do so without violating NDA.
Cheers!
