Maniphest T96405

Curve guide hook to mesh is ignored when mesh has cloth simulation
Closed, Archived

Assigned To
None
Authored By
David Hughes (dwhughes1970)
Mar 13 2022, 5:16 PM
Tags
  • BF Blender
Subscribers
Bastien Montagne (mont29)
David Hughes (dwhughes1970)
Omar Emara (OmarSquircleArt)
Philipp Oeser (lichtwerk)

Description

System Information
Operating system: Linux-5.13.0-30-generic-x86_64-with-glibc2.34 64 Bits
Graphics card: Quadro RTX 5000/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 470.103.01

Blender Version
Broken: version: 3.0.1, branch: master, commit date: 2022-01-25 17:19, hash: rBdc2d18018171

Short description of error
Applying cloth simulation to a mesh with a bezier curve hooked to hit causes the hooked point to return to the origin. Removing the cloth simulation restores the curve point to correct location.

Exact steps for others to reproduce the error
In attached blend file, repeat my step 19 and try to move the cube.

  1. New file with cube
  2. Add plane for cloth sim, scale 0.25
  3. Edit plane, extrued -x vertices down in four steps of -0.5
  4. Create vertex group tip from lowest 2 vertices and group pin from initial 4 vertices
  5. With tip vertices selected, shift-s, cursor to selected
  6. In object mode, add empty, add "child of" relationship constraint, using tip vertex group. This will eventually hook one end of the curve guide.
  1. Add bezier curve. Edit and move start to x=0, y=0.5, z=2 (the world origin) rotate handle so curve starts out heading in -y direction
  2. Move end to x=0, y=0, z=0; rotate handle to align direction with y axis
  3. Add hook modifier, select empty object, select the endpoint of the bezier and assign to the hook modifier, also hit recenter (cursor still at tip)
  4. In object mode, make plane the parent (keep transform) of the bezier curve.
  1. Select plane, move -1.25 y direction
  2. Make cube the parent of the plane (keep offset)
  3. Edit cube, select -Y vertices, extrude scale 0.5 to make smaller face
  4. With those vertices make group hair.
  5. Add particle system to cube, reduce to emission to 100 generated, length 1, viewport display 5 strand steps, set hair group for density under vetex groups

16 Object mode, insert rotation & location keyframes for cube. Advance to frame 10, rotate cube +90 around z, insert rotation & location keyframes. Set animation end to 10

  1. Frame 1, select bezier curve, physics, make force field curve guide

18 Spacebar to show hair follows motion.

  1. Return to frame 0, select plane, add cloth physics (hair goes crazy - actually first display of bug); set shape-pin group to pin vertex group (hair looks good again - not sure why)

HERE IS THE BUG
Do anything, and the bezier endpoint snaps to world origin. Even select the cube, go to edit mode but do nothing, return to object mode, and you will see it. You can ctrl-z back to the good hair display and try other things to make the endpoint jump.

If I remove the cloth physics, the bezier and hair go back to normal. File was saved after removing the physics.

Also, I just checked and removing the particle system does not prevent this bug. HOWEVER, removing the bezier curve guide physics does seem to prevent the bug.
I tried reparenting the bezier to the cube instead of the plane (had to rotate the empty to realign the handles of the end point), Then added cloth physics and saw the same bug, but this time it first showed when I set the tip group as the pin, not as soon as the cloth button was clicked. Maybe some kind of loop in resolving the order of operations?

Related Objects

Mentioned Here
rBe9fc25835f20: Remove internal proxy code, and deprecate related DNA data.

Event Timeline

David Hughes (dwhughes1970) created this task.Mar 13 2022, 5:16 PM
David Hughes (dwhughes1970) updated the task description.Mar 13 2022, 5:20 PM
David Hughes (dwhughes1970) updated the task description.Mar 13 2022, 5:22 PM
David Hughes (dwhughes1970) updated the task description.Mar 13 2022, 5:41 PM
Omar Emara (OmarSquircleArt) closed this task as Archived.Mar 21 2022, 9:39 AM
Omar Emara (OmarSquircleArt) added a subscriber: Omar Emara (OmarSquircleArt).

You have two dependency cycles when adding a cloth modifier:

Dependency cycle detected:
  OBPlane/Geometry Component/GEOMETRY_EVAL() depends on
  OBBezierCurve/Geometry Component/GEOMETRY_EVAL() via 'Cloth Field'
  OBEmpty/Transform Component/TRANSFORM_FINAL() via 'Hook Modifier'
  OBEmpty/Transform Component/TRANSFORM_CONSTRAINTS() via 'ObConstraints -> Done'
  OBPlane/Geometry Component/GEOMETRY_EVAL() via 'Child Of'
Dependency cycle detected:
  OBPlane/Geometry Component/GEOMETRY_EVAL() depends on
  OBPlane/PointCache Component/POINT_CACHE_RESET() via 'Point Cache -> Geometry'
  OBBezierCurve/Geometry Component/GEOMETRY_EVAL() via 'Point Cache'
  OBEmpty/Transform Component/TRANSFORM_FINAL() via 'Hook Modifier'
  OBEmpty/Transform Component/TRANSFORM_CONSTRAINTS() via 'ObConstraints -> Done'
  OBPlane/Geometry Component/GEOMETRY_EVAL() via 'Child Of'

This essentially tells you that the plane depends on the curve because it is a force field, and the curve depends on the empty because of the hook modifier, and the empty depends on the plane because of the child of constraint. So the plane depends on itself through a chain of relations and it can't be evaluated correctly. And the same goes for the point cache. So this is not a bug, but an ambiguity that needs to be resolved in your file.

Philipp Oeser (lichtwerk) reopened this task as Needs Information from User.Mar 21 2022, 10:02 AM
Philipp Oeser (lichtwerk) added a subscriber: Philipp Oeser (lichtwerk).

This is apparently fixed in 3.2 (will check why this is not fixed in 3.1...)
For the time being: @David Hughes (dwhughes1970) : can you confirm this is working correctly for you in a 3.2 build from https://builder.blender.org/download/daily/?

Philipp Oeser (lichtwerk) added a comment.Mar 21 2022, 10:07 AM
In T96405#1326595, @Omar Emara (OmarSquircleArt) wrote:

You have two dependency cycles when adding a cloth modifier:

Dependency cycle detected:
  OBPlane/Geometry Component/GEOMETRY_EVAL() depends on
  OBBezierCurve/Geometry Component/GEOMETRY_EVAL() via 'Cloth Field'
  OBEmpty/Transform Component/TRANSFORM_FINAL() via 'Hook Modifier'
  OBEmpty/Transform Component/TRANSFORM_CONSTRAINTS() via 'ObConstraints -> Done'
  OBPlane/Geometry Component/GEOMETRY_EVAL() via 'Child Of'
Dependency cycle detected:
  OBPlane/Geometry Component/GEOMETRY_EVAL() depends on
  OBPlane/PointCache Component/POINT_CACHE_RESET() via 'Point Cache -> Geometry'
  OBBezierCurve/Geometry Component/GEOMETRY_EVAL() via 'Point Cache'
  OBEmpty/Transform Component/TRANSFORM_FINAL() via 'Hook Modifier'
  OBEmpty/Transform Component/TRANSFORM_CONSTRAINTS() via 'ObConstraints -> Done'
  OBPlane/Geometry Component/GEOMETRY_EVAL() via 'Child Of'

This essentially tells you that the plane depends on the curve because it is a force field, and the curve depends on the empty because of the hook modifier, and the empty depends on the plane because of the child of constraint. So the plane depends on itself through a chain of relations and it can't be evaluated correctly. And the same goes for the point cache. So this is not a bug, but an ambiguity that needs to be resolved in your file.

Oops, missed this, this is true.
Interesting though that it behaves "properly" in 3.2 apparently... (will still check real quick on why this changed...)
That being said though, anything involving dependency cycles is not garanteed to evaluate properly.

Philipp Oeser (lichtwerk) closed this task as Archived.Mar 21 2022, 10:48 AM
Philipp Oeser (lichtwerk) added a subscriber: Bastien Montagne (mont29).

Hm, interesting, seems like the change in behavior came with rBe9fc25835f20: Remove internal proxy code, and deprecate related DNA data..

I will raise awareness to @Bastien Montagne (mont29) because I think this is quite an interesting (and probably unexpected?) consequence of above commit ^^.

In any case though, the case presented here:

  • either works "properly" now (even though there is a dependency cycle)
  • still might have problems evaluating properly somewhere (but this will not be considered a bug - because of said dependency cycle...)

This is why this will return to the Archived status.

Bastien Montagne (mont29) added a comment.Mar 21 2022, 11:40 AM

@Philipp Oeser (lichtwerk) rBe9fc25835f20 does remove some depsgraph code related to relationships and evaluation, including some hacks that were needed to support proxies. So it may be that it fixes/enables proper handling of some dependency cycles cases... But as you say, we can never guaranty a proper support for such dependency cycles. Some times it may work, sometimes not.