0
$\begingroup$

Summary of Intentions

enter image description here enter image description here

I need to make a rigged cloth simulation with rings that follow the surface of the cloth. The rig allows me to separate the cloth into strips, and stitch them together at the time of simulation.

(I will eventually need to "fasten" the rings to the surface of the cloth with rope loops. For now, I just want a working method for the rings, as it will likely translate forward to the rope loops. Bonus points for solving both problems.)

The Issue

enter image description here enter image description here

The issue arises when I try to use the Rig.

First, to meet my purposes, I used a Surface Deform modifier. (to deform my rings to the surface of the cloth.) The rings are directly above a topologically flat portion of mesh. This ensures that the rings will remain rigid after the Surface Deform modifier.

However, When I move any bone within the Cloth Rig, it moves the vertices of the cloth mesh along with it.

The Surface Deform modifier does not like this, as it leads to losing track of its vertex associations.

As soon as a bone moves any vertex, the Surface Deform Modifier causes the ring-mesh to explode into an unseemly mess.

Attempts Made:

I have already attempted a Rigid-Body-Cloth simulation. This is extremely difficult in Blender's current physics system, and proves to be next to useless - However, if anyone has a working method, I would be very excited to see it.

I have already attempted to falsify a Rigid-Body-Cloth simulation using only cloth. This also proved to be next to useless, as simulating metal with cloth simulation is extremely painful, and doing so in tandem with cloth, as of my discovery, is not currently an option. (Let me know if you find otherwise! But please use it to resolve my issue :)

I have already attempted object instancing on vertices via Geometry Nodes. This was promising, but the rings flipped wildly around bent cloth normals, and intersected with the cloth mesh. I have not tried instancing on faces, via Geometry Nodes. I attempted to mask faces via subdivide, but was not successful. (Callout to all you Geo-Node-Lers.)

What should I do? Are there any methods to achieve what I am hoping to accomplish? I will provide the .blend file below. (The rig is simple to use. The red bone at the end is the only bone you should move. It will only allow movement on the X axis. Let me know if you have any questions.) enter image description here

I will be in touch! Thank you.

$\endgroup$
2
  • 1
    $\begingroup$ Interesting. I have the same problem, but thought it's due to mesh irregularities (which I cannot avoid). In my case the deformed object already "exploded" if I only switched the SurfaceDeform modifier off and back on after binding. I now created a (quite big) geometry node group which uses a static and a dynamic target mesh (same topo) and moves the deform object's vertices accordingly. So far this works quite nice. If you are still interested I can write an real answer explaining my approach in more detail. $\endgroup$
    – Patter
    Apr 19, 2023 at 18:26
  • $\begingroup$ @Patter , If it isn't too much trouble, I would be very interested! Blender's simulation system is still very clunky, and so fixes for "simple" issues like this one can be game changers. I would NOT be the only one thanking you :) Just make sure to name it something catchy, so your crazy work receives its due notice! $\endgroup$ May 16, 2023 at 2:42

1 Answer 1

1
$\begingroup$

Ok here we go...

Little disclaimer: I did not try to apply this to your exact problem, but it solved my problem. My problem was that the Surface Deform modifier was not usable. The deformed object just "exploded", sometimes even if I just switched the modifier off and back on directly after binding. Even if not, it completely destroyed the object just later while my cloth simulation was running.

Instead of binding to a target object at t=1, I use two versions of my target object: one which is static (not affected by the simulation) and a dynamic one which has a cloth simulation (usually not even a second "real" object with its own geometry is needed, because it can be created by storing the orig. positions of the target object with the simulation in a field and using Geometry Nodes to create the static version then "on the fly").

The goal is to move each point (vertex) of the object (which should be deformed) from its position relative to the static target to the "same" place relative to the dynamic target.

I guess the Surface Deform modifier is using more reference points from the target but I'm just using the one nearest Face Corner (deform object <-> static target) and it's two edges (previous edge index and next edge index from the Edges of Corner node 1)) and additionally the normal at the nearest point. These three vectors are forming a coordinate system (although they are not necessarily orthogonal to each other).

We can imagine three planes going through the nearest ref. point (corner) on the static target. Each plane is formed by the point itself and one of these three vectors. Now we are measuring the distances to each of these three planes. For each plane along the one vector not used to define that plane.

The last step then is simply to move each point the same distance along these three vectors (this time taken from the dynamic target of course). Well, what the "same" distance means has to be defined... What works quite well (for me) is to normalize these distances according to the change of the face area in the static target vs. dynamic target.

Now to the implementation as a Geometry Nodes group:

First some helper nodes (output domain for all outputs is Point):

  • Find the other end of an edge:
    enter image description here
  • Plane normal and dist. from a point and two vectors:
    enter image description here
  • Find intersection plane / line:
    enter image description here

And now the big Surface Deformation geometry node:
enter image description here

This node does not move any points but is only providing the new "deformed" positions. So something like this is needed on top (which can be directly used in a Geometry Nodes Modifier): enter image description here

A little demo (the static target can be seen only partly, the dynamic target is in edit mode and I move some points, for the deformed object every vertex is replaced by a Point): enter image description here

Final notes:

  • The Surface Deform modifier is doing some checks, e.g. for non-convex faces. I don't do any checks - nevertheless e.g. non-convex faces might be problematic, especially with >2 points in a straight line. Triangulation should help here
    • Side note: Triangulation (in mode Fixed or Fixed Alternate) seems to be deterministic in the sense that after triangulating two meshes with the same topo (just deformed), they still have the same topo.
  • The closer the deform object and the static target are to each other the better (that's the same for the Surface Deform Modifier)
  • As you can see I ignored the valid outputs of my own nodes. So there is some work to do to make it more robust. But since I did not need it so far I was too lazy...
  • This for sure can be improved (e.g. performance-wise). But again, for me it's good enough, so I stopped at this point. But e.g. I calculate the distance to a plane three times. AFAICS this could be reduced to
    • 1x intersection plane <-> line
    • 1x intersection line <-> line (don't know if if that is really less expensive)
    • 1x just an euclidean distance (which for sure is less expensive :-))
  • If someone greatly improves this, I'm interested ;-)

Ah and nearly forgot... here is a blend file containing everything needed :-)


Updates:

  • Above I used only the distance to the three planes as described without a sign. This works as long as the mesh which should be deformed is inside the (static) target mesh. By using a signed distance, which is negative "outside" the nearest face this problem can be solved.
  • For some reason the normalization looks better using x ^ 0.75 instead of x ^ 0.5 (sqrt(x)).
  • I also tried to use three corners of the nearest face and use the mean point of the three results. That would be nice if the target mesh is triangulated. For some reason this doesn't always work.

  1. A nice feature of Find Nearest for Face Corners is that it does not just find any corner belonging to the nearest vertex but really the corner belonging to the nearest face.
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .