[Bf-blender-cvs] [8af8b1862f7] master: Cleanup: use __doc__ instead of bl_description

Campbell Barton noreply at git.blender.org
Thu May 9 05:13:18 CEST 2019


Commit: 8af8b1862f7403a2db8c8bab5c2137c7218f2340
Author: Campbell Barton
Date:   Thu May 9 08:50:14 2019 +1000
Branches: master
https://developer.blender.org/rB8af8b1862f7403a2db8c8bab5c2137c7218f2340

Cleanup: use __doc__ instead of bl_description

In keeping with other Python operators,
also assign object a variable.

===================================================================

M	release/scripts/startup/bl_operators/constraint.py

===================================================================

diff --git a/release/scripts/startup/bl_operators/constraint.py b/release/scripts/startup/bl_operators/constraint.py
index f0318b1d85b..811218f5e09 100644
--- a/release/scripts/startup/bl_operators/constraint.py
+++ b/release/scripts/startup/bl_operators/constraint.py
@@ -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'}



More information about the Bf-blender-cvs mailing list