Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What can I adjust to stop a cloth from doing through a collision mesh?
#26
(04-02-2022, 01:33 AM)MoonBoop Wrote: okay, it has helped in showing that im getting a completely different stitching result to what Ive been expecting, though it does leave me now confused as to why.

Double check that the amount of particles and vertices in your garment are exactly the same:

Code:
int vertices1 = (actor1 as ObiCloth).clothBlueprint.inputMesh.vertexCount;
int particles1 = actor1.activeParticleCount;

Debug.Log("There's " + vertices1 + " vertices and " + particles1 + " particles in the first cloth.");

int vertices2 = (actor2 as ObiCloth).clothBlueprint.inputMesh.vertexCount;
int particles2 = actor2.activeParticleCount;

Debug.Log("There's " + vertices2 + " vertices and " + particles2 + " particles in the second cloth.");

Placed in the stitcher's OnDrawGizmos method (together with the previous stitch drawing code), this code will spam your console with messages about the number or vertices and particles in each cloth.

If these don't match, it means the mesh has discontinuities - though it shouldn't. If this is the case, either fix it - is there any chance you're generating 3 unique vertices per triangle when building your mesh, instead of sharing the same vertex position for all incident faces? -  or use the blueprint to map from vertex index to particle index (using cloth.clothBlueprint.Topology.rawToWelded).
Reply


Messages In This Thread
RE: What can I adjust to stop a cloth from doing through a collision mesh? - by josemendez - 04-02-2022, 08:00 AM