Page MenuHome

Fix T94600: Apply single shrinkwrap constraint fails
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Jan 7 2022, 1:48 PM.

Details

Summary

rBd6891d9bee2b introduced a way to apply a single constraint from the
constraint stack. For this we want to work in the evaluated domain, in
particular the constraint target should be evaluated (the shrinkwrap
constraint needs to have access to the target's evaluated mesh).

Thx a lot to @Sergey Sharybin (sergey) for handholding here!

Diff Detail

Repository
rB Blender

Event Timeline

I'd suggest making a minor adjustment to the patch to make it so we explicitly stay in the evaluated "domain". Probably not visible change on user level, but semantically it makes sense, is easy, and shows a good example of not mixing evaluated and original IDs.

source/blender/blenkernel/intern/constraint.c
5688–5689

For the consistency is better to pass secene_eval and ob_eval.

5745–5746

Same as above.

I'd suggest making a minor adjustment to the patch to make it so we explicitly stay in the evaluated "domain". Probably not visible change on user level, but semantically it makes sense, is easy, and shows a good example of not mixing evaluated and original IDs.

Hm, afraid this is not going to work [ I either still dont get it -- or failed in trying to explain why in the patch description πŸ™‚ ]
If we use the evaluated object, we cannot isolate a single constraint [the result will always be the result of all constraints]
quote:

For this we want to work on the original object/pchan
(since we need access to its unconstrained original matrix). However the
constraint target should be evaluated (the shrinkwrap constraint needs
to have access to the target's evaluated mesh).

Does this make sense? If mixing domains is somehow a no-no, then I am a bit out of ideas, I am afraid.

Example file (has 3 constraints):

  • with my patch: applying shrinkwrap will put the new origin directly on the sphere (where it belongs)
  • changing it to use the evaluated object will put the new origin where the result of all 3 constraints were (where it does not belong if I understand correctly)

Fair enough, need to modify some more lines to use matricies from ob_eval. Does P2709 applied on top of this patch work as expected for you?

Philipp Oeser (lichtwerk) edited the summary of this revision. (Show Details)
  • do it all in the evaluated domain (no need to stay "original" on the object/pchan, thx @Sergey Sharybin (sergey) pointing that out)
This revision is now accepted and ready to land.Jan 10 2022, 11:55 AM