Cleanup: use __doc__ instead of bl_description
authorCampbell Barton <ideasman42@gmail.com>
Wed, 8 May 2019 22:50:14 +0000 (08:50 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 9 May 2019 02:42:05 +0000 (12:42 +1000)
In keeping with other Python operators,
also assign object a variable.

release/scripts/startup/bl_operators/constraint.py

index f0318b1..811218f 100644 (file)
@@ -69,13 +69,13 @@ class CONSTRAINT_OT_normalize_target_weights(Operator):
         return {'FINISHED'}
 
 
-
 class CONSTRAINT_OT_disable_keep_transform(Operator):
+    """Set the influence of this constraint to zero while """ \
+    """trying to maintain the object's transformation. Other active """ \
+    """constraints can still influence the final transformation"""
+
     bl_idname = "constraint.disable_keep_transform"
     bl_label = "Disable and Keep Transform"
-    bl_description = ("Set the influence of this constraint to zero while "
-        "trying to maintain the object's transformation. Other active "
-        "constraints can still influence the final transformation")
     bl_options = {'UNDO', 'INTERNAL'}
 
     @classmethod
@@ -95,20 +95,20 @@ class CONSTRAINT_OT_disable_keep_transform(Operator):
 
         # Get the matrix in world space.
         is_bone_constraint = context.space_data.context == 'BONE_CONSTRAINT'
+        ob = context.object
         if is_bone_constraint:
-            armature = context.object
             bone = context.pose_bone
-            mat = armature.matrix_world @ bone.matrix
+            mat = ob.matrix_world @ bone.matrix
         else:
-            mat = context.object.matrix_world
+            mat = ob.matrix_world
 
         context.constraint.influence = 0.0
 
         # Set the matrix.
         if is_bone_constraint:
-            bone.matrix = armature.matrix_world.inverted() @ mat
+            bone.matrix = ob.matrix_world.inverted() @ mat
         else:
-            context.object.matrix_world = mat
+            ob.matrix_world = mat
 
         return {'FINISHED'}