How to make constraint permanent once disabled? I have got a beautiful bone constraint:



I would like to be able to enable and disable this constraint without the bone reverting to the original position.

By default, the bone appears to return to it's original starting position when influence is set to 0 or visibility is set to off.

So, for example:


Constraint is "on" or "enabled" - bone follows Hand.L as expected
Constraint is "off" - bone stays where it is at this exact moment and does not move.


I would like to be able to 'apply' the constraint without actually deleting the constraint, as I am intending to turn it on and off frequently during animation.
Disable and Keep Transform

Hit the X to the right of influence slider. It "applies" the constraint and sets influence to 0 

Script Equivalent, copy the transform, ie the world matrix, set the constraint influence to zero (disable) and reset the matrix world.

import bpy

ob = bpy.context.object
constraint = ob.constraints.get("Copy Location")
if constraint:
    mw = ob.matrix_world.copy()
    constraint.influence = 0
    ob.matrix_world = mw