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:
authorNathan Vegdahl <cessen@cessen.com>2011-06-19 00:41:43 +0400
committerNathan Vegdahl <cessen@cessen.com>2011-06-19 00:41:43 +0400
commit1a3f4c4c6af16a3214c9dd3847590b87c580c11a (patch)
tree546eadd221be849884ac0adb00829f70fa71272c /rigify/generate.py
parent83840e5713eaeaf3b8ec0c779d0dffe8666cd85c (diff)
Rigify: users can now specify layer names in the metarig armature properties.
The layer names are then used in creating the custom rig layer UI. This is useful for users that do not want to--or do not have the knowledge to--edit the generated python script by hand. It is also handy even for more advanced users when regerating the rig over and over (which over-writes the script and any hand-made edits). Also misc bug fixes in some of the rig types.
Diffstat (limited to 'rigify/generate.py')
-rw-r--r--rigify/generate.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/rigify/generate.py b/rigify/generate.py
index 4809e290..3de8fe23 100644
--- a/rigify/generate.py
+++ b/rigify/generate.py
@@ -282,6 +282,13 @@ def generate_rig(context, metarig):
vis_layers[i] = vis_layers[i] and not (ORG_LAYER[i] or MCH_LAYER[i] or DEF_LAYER[i])
obj.data.layers = vis_layers
+ # Create list of layer names
+ if len(metarig.data.rigify_props) < 1:
+ metarig.data.rigify_props.add()
+ layer_names = []
+ for i in range(28):
+ layer_names += [getattr(metarig.data.rigify_props[0], "layer_name_%s" % str(i+1).rjust(2, "0"))]
+
# Generate the UI script
if "rig_ui.py" in bpy.data.texts:
script = bpy.data.texts["rig_ui.py"]
@@ -291,7 +298,7 @@ def generate_rig(context, metarig):
script.write(UI_SLIDERS % rig_id)
for s in ui_scripts:
script.write("\n " + s.replace("\n", "\n ") + "\n")
- script.write(layers_ui(vis_layers))
+ script.write(layers_ui(vis_layers, layer_names))
script.write(UI_REGISTER)
script.use_module = True