Skip to main content
added 66 characters in body
Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244

Disable and Keep Transform

Hit the X to the right of influence slider. It "applies" the constraint and sets influence to 0Hit 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

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

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
Source Link
batFINGER
  • 85.2k
  • 10
  • 114
  • 244

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