0
$\begingroup$

Oftentimes I encounter a situation where I need to disable the Child of Constraint, adjust position of the 'parent' without moving its 'child' and then enable the constraint back in such way that the child stays in the place it was before its parent was moved. I cannot 'set origin' in the middle of the animation because if I do so everything that was animated prior to that will be spoiled. I just need to temporary disable the constraint so I could adjust position of the parent.

Example:
I'm animating a weapon reload. Left hand is constrained with the Child Of constraint to the magazine of the weapon from the beginning of the animation. That way the left arm follows the magazine which in turn is a child of the weapon. Now, in the middle of the action(animation) I need to drop the magazine, move it to the left hand outside from the view of the camera and insert it with the left hand back to the weapon so it would look like player reloads the weapon. The problem is that I cannot grab the magazine with the left hand. With the constraint enabled the hand moves along with the magazine (as expected). If I disable the constraint to move the magazine to the left hand and enable it back the hand moves away from it. enter image description here I think there should be a way to calculate the offset with Python and adjust position of the hand from script?

$\endgroup$
  • 2
    $\begingroup$ @Moonboots has posted a clever way of preventing objects from moving when the influence slider is moved to zero. blender.stackexchange.com/questions/145161/… - It works but because I often have to switch parents and/or various constraints on and off mutiple times on the same character/object, it acted up and I had to return to my old tricks. Might solve your problem though. $\endgroup$ – Edgel3D Jul 17 at 4:51
  • $\begingroup$ Thank you for the answer. Actually what I asked here was quite the opposite: How could I enable the constraint after having it disabled? It helped me with another project though. $\endgroup$ – blablaalb Jul 18 at 13:37
  • $\begingroup$ As mentioned above I often find myself needing to shed a constraint or physics, animate the object etc and then return to the same constraints or physics again, I did this with a simiar project to yours, a character reloading a magazine into a weapon. Each has it's own method but basically I swap the object with a duplicate of itself that's constraint free. Use that and if necessary, return to the original. You can have multiple constraints on multiple duplicates in an extreme case, each switched to and left again at will. Those not required are invisible. $\endgroup$ – Edgel3D Jul 19 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.