Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-07-10 21:28:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-10 21:28:53 +0400
commit8012053e1e178c8cabb133e05dc1e36d52908fa7 (patch)
treefd3f79b7e8cd9ee165ff2ece9a1ef9d2cf7ca058 /animation_add_corrective_shape_key.py
parent0507e7a5b8dd558e12c906dd398a6e0bd7f76911 (diff)
cleanup
- remove unused imports - remove/comment unused vars - fix for some bugs with unused vars being used
Diffstat (limited to 'animation_add_corrective_shape_key.py')
-rw-r--r--animation_add_corrective_shape_key.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/animation_add_corrective_shape_key.py b/animation_add_corrective_shape_key.py
index 482c458d..92a685ea 100644
--- a/animation_add_corrective_shape_key.py
+++ b/animation_add_corrective_shape_key.py
@@ -137,20 +137,16 @@ def func_add_corrective_pose_shape( source, target):
reset_transform(target)
# If target object doesn't have Basis shape key, create it.
- try:
- num_keys = len( mesh_1.shape_keys.key_blocks )
- except:
+ if not mesh_1.shape_keys:
basis = ob_1.shape_key_add()
basis.name = "Basis"
ob_1.data.update()
-
-
+
key_index = ob_1.active_shape_key_index
# Insert new shape key
if key_index == 0:
new_shapekey = ob_1.shape_key_add()
new_shapekey.name = "Shape_" + ob_2.name
- new_shapekey_name = new_shapekey.name
key_index = len(mesh_1.shape_keys.key_blocks)-1
ob_1.active_shape_key_index = key_index
@@ -383,9 +379,7 @@ def func_add_corrective_pose_shape_fast(source, target):
reset_transform(target)
# If target object doesn't have Basis shape key, create it.
- try:
- num_keys = len( target.data.shape_keys.key_blocks )
- except:
+ if not target.data.shape_keys:
basis = target.shape_key_add()
basis.name = "Basis"
target.data.update()
@@ -397,7 +391,6 @@ def func_add_corrective_pose_shape_fast(source, target):
# Insert new shape key
new_shapekey = target.shape_key_add()
new_shapekey.name = "Shape_" + source.name
- new_shapekey_name = new_shapekey.name
key_index = len(target.data.shape_keys.key_blocks)-1
target.active_shape_key_index = key_index
@@ -486,8 +479,7 @@ def vgroups_draw(self, context):
layout.row().operator("object.add_corrective_pose_shape", text='Add as corrective pose-shape (slow, all modifiers)', icon='COPY_ID') # icon is not ideal
def modifiers_draw(self, context):
- layout = self.layout
-
+ pass
def register():