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:
authorThomas Larsson <thomas_larsson_01@hotmail.com>2013-05-21 11:20:13 +0400
committerThomas Larsson <thomas_larsson_01@hotmail.com>2013-05-21 11:20:13 +0400
commitb9b534687ab8c0cefca3a44d3457b035eab51467 (patch)
treebf96618fc794e2a08af91e5b75745d7586242fb4 /io_import_scene_mhx.py
parentd136553978accfbbd60de276c1d271a3f1d8b114 (diff)
MHX importer rigify mode now fails gracefully when rigify is not enabled.
Diffstat (limited to 'io_import_scene_mhx.py')
-rw-r--r--io_import_scene_mhx.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/io_import_scene_mhx.py b/io_import_scene_mhx.py
index 94a19150..d0eb5a58 100644
--- a/io_import_scene_mhx.py
+++ b/io_import_scene_mhx.py
@@ -2580,7 +2580,10 @@ def rigifyMhx(context):
bpy.ops.object.mode_set(mode='OBJECT')
# Create metarig
- bpy.ops.object.armature_human_metarig_add()
+ try:
+ bpy.ops.object.armature_human_metarig_add()
+ except AttributeError:
+ raise MyError("The Rigify add-on is not enabled. It is found under rigging.")
bpy.ops.object.location_clear()
bpy.ops.object.rotation_clear()
bpy.ops.object.scale_clear()
@@ -2718,10 +2721,12 @@ def rigifyMhx(context):
#Clean up
gen.show_x_ray = True
gen.data.draw_type = 'STICK'
+ gen.MhxRigify = False
name = rig.name
scn.objects.unlink(rig)
del rig
gen.name = name
+ bpy.ops.object.mode_set(mode='POSE')
print("MHX rig %s successfully rigified" % name)