Skip to content

Commit

Permalink
feat: raise readable error when Rigify addon is not present
Browse files Browse the repository at this point in the history
  • Loading branch information
nanoskript committed Oct 14, 2023
1 parent c2eb56d commit cd00b1f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ only supports the VRM 0.x format.

<img src="docs/enable.png" width="256px">

6. In the same `Blender Preferences` window, go to `Interface`.
7. Check the box labelled `Developer Extras`. This is necessary to show the addon's commands in Blender's operator
6. Ensure the addons `Import-Export: VRM format` and `Rigging: Rigify` are also enabled.
7. In the same `Blender Preferences` window, go to `Interface`.
8. Check the box labelled `Developer Extras`. This is necessary to show the addon's commands in Blender's operator
search menu:

<img src="docs/developer.png" width="384px">
Expand Down
11 changes: 7 additions & 4 deletions vrm_rigify/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ def generate_meta_rig(vroid_rig):
bpy.ops.vrm.bones_rename(armature_name=vroid_rig.name)

# Spawn meta-rig.
LOGGER.info("creating and positioning meta-rig")
bpy.ops.object.armature_human_metarig_add()
meta_rig = bpy.context.view_layer.objects.active
meta_rig.name = f"{vroid_rig.name}.metarig"
try:
LOGGER.info("creating and positioning meta-rig")
bpy.ops.object.armature_human_metarig_add()
meta_rig = bpy.context.view_layer.objects.active
meta_rig.name = f"{vroid_rig.name}.metarig"
except AttributeError as e:
raise Exception("Failed to spawn meta-rig. Is the Rigify addon enabled?") from e

# Remove unneeded bones.
with editing(meta_rig):
Expand Down

0 comments on commit cd00b1f

Please sign in to comment.