Skip to content

Commit 04353c7

Browse files
committed
fix: invalid feature_sets_path
1 parent 3a476f7 commit 04353c7

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,7 @@ def update_external_rigs(self):
128128

129129
feature_sets_path = os.path.join(bpy.utils.script_path_user(), 'rigify')
130130

131-
invalid_path = not os.path.exists(feature_sets_path)
132-
if not invalid_path:
131+
if os.path.exists(feature_sets_path):
133132
if feature_sets_path not in sys.path:
134133
sys.path.append(feature_sets_path)
135134
# Reload rigs

feature_sets.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ def feature_set_items(scene, context):
2727
feature_sets_path = os.path.join(
2828
bpy.utils.script_path_user(), 'rigify')
2929
items = [('all',)*3, ('rigify',)*3, ]
30-
for fs in os.listdir(feature_sets_path):
31-
items.append((fs,)*3)
30+
if os.path.exists(feature_sets_path):
31+
for fs in os.listdir(feature_sets_path):
32+
items.append((fs,)*3)
3233

3334
return items
3435

@@ -82,7 +83,8 @@ def execute(self, context):
8283
addon_prefs = context.user_preferences.addons[__package__].preferences
8384

8485
rigify_config_path = os.path.join(bpy.utils.script_path_user(), 'rigify')
85-
rmtree(os.path.join(rigify_config_path, self.featureset))
86+
if os.path.exists(os.path.join(rigify_config_path, self.featureset)):
87+
rmtree(os.path.join(rigify_config_path, self.featureset))
8688

8789
addon_prefs.update_external_rigs()
8890
return {'FINISHED'}

ui.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@
2222
from bpy.props import StringProperty
2323
from mathutils import Color
2424

25-
from .utils import get_resource, MetarigError
25+
from .utils import MetarigError
2626
from .utils import write_metarig, write_widget
2727
from .utils import unique_name
2828
from .utils import upgradeMetarigTypes, outdated_types
2929
from .utils import get_keyed_frames, bones_in_frame
3030
from .utils import overwrite_prop_animation
31-
from .utils import RIG_DIR
3231
from .rigs.utils import get_limb_generated_names
3332
from . import rig_lists
3433
from . import template_list
@@ -129,7 +128,7 @@ def draw(self, context):
129128

130129
col.separator()
131130
row = col.row()
132-
row.active = len(context.object.data.rigify_templates) != 0 or len(template_list.template_list) == 1
131+
row.active = len(context.object.data.rigify_templates) != 0 or len(template_list.templates) == 1
133132
row.operator("pose.rigify_generate", text="Generate Rig", icon='POSE_HLT')
134133

135134
row.enabled = enable_generate_and_advanced

0 commit comments

Comments
 (0)