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:
authorAlexander Gavrilov <angavrilov@gmail.com>2019-02-16 13:57:57 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2019-03-14 14:39:16 +0300
commit36e8d00aec705b06008a0bc334fe266448b4f2c2 (patch)
tree02bf0290ec6423c611e3cd4ad49c69cb77acb67e /rigify/rigs/spines/super_spine.py
parenteabb5cddf79e5fae3ca429242cf2c6f5a272920e (diff)
Rigify: add support for user-defined rig packages and related utilities.
As suggested by @icappielo, and after discussion with @meta-androcto, I start a public request to commit third-party contributions already accepted to https://github.com/eigen-value/rigify/tree/rigify_0.6_beta Specifically, this includes: * User-defined rig package (feature set) support by @pioverfour. This allows users to install pre-packaged rig sets via zip files, which become accessible together with built-in rigs, as discussed in T52758. https://github.com/eigen-value/rigify/pull/1 * Modularization of python script generation, allowing rigs to add their own utility functions and operators to the generated script. This is critical to make custom rig support really useful. https://github.com/eigen-value/rigify/pull/5 * The utils.py file is split into multiple modules with a backward compatibility proxy for old functions. * Automatic verification that different rigs don't try to create different rig settings with the same name to alleviate increased risk of namespace conflicts with custom rigs. https://github.com/eigen-value/rigify/pull/7 * New utility class that implements bone layer selection UI. https://github.com/eigen-value/rigify/pull/6 * New utilities to replace copy & pasted boilerplate code for creating custom properties, constraints and drivers. https://github.com/eigen-value/rigify/pull/11 Some other random changes by MAD have likely slipped through. These changes have already been extensively discussed and accepted into the branch by @luciorossi, so I see no reason not to commit them to the official repository to be tested during 2.8 beta. Reviewers: icappiello Differential Revision: https://developer.blender.org/D4364
Diffstat (limited to 'rigify/rigs/spines/super_spine.py')
-rw-r--r--rigify/rigs/spines/super_spine.py62
1 files changed, 4 insertions, 58 deletions
diff --git a/rigify/rigs/spines/super_spine.py b/rigify/rigs/spines/super_spine.py
index 6e46aa5c..d1b7593f 100644
--- a/rigify/rigs/spines/super_spine.py
+++ b/rigify/rigs/spines/super_spine.py
@@ -5,6 +5,7 @@ from ...utils import strip_org, make_deformer_name, connected_children_names
from ...utils import create_circle_widget, create_sphere_widget, create_neck_bend_widget, create_neck_tweak_widget
from ..widgets import create_ballsocket_widget
from ...utils import MetarigError, make_mechanism_name, create_cube_widget
+from ...utils import ControlLayersOption
from rna_prop_ui import rna_idprop_ui_prop_get
script = """
@@ -58,12 +59,6 @@ class Rig:
if self.use_tail and self.pivot_pos - 2 > 0:
self.tail_pos = params.tail_pos
- # Assign values to tweak layers props if opted by user
- if params.tweak_extra_layers:
- self.tweak_layers = list(params.tweak_layers)
- else:
- self.tweak_layers = None
-
# Report error of user created less than the minimum of bones for rig
min_bone_number = 3
if self.use_head:
@@ -941,8 +936,7 @@ class Rig:
continue
create_sphere_widget(self.obj, bone, bone_transform_name=None)
- if self.tweak_layers:
- pb[bone].bone.layers = self.tweak_layers
+ ControlLayersOption.TWEAK.assign(self.params, pb, tweaks)
def generate(self):
# Torso Rig Anatomy:
@@ -1058,17 +1052,7 @@ def add_parameters(params):
)
# Setting up extra layers for the FK and tweak
- params.tweak_extra_layers = bpy.props.BoolProperty(
- name="tweak_extra_layers",
- default=True,
- description=""
- )
-
- params.tweak_layers = bpy.props.BoolVectorProperty(
- size = 32,
- description = "Layers for the tweak controls to be on",
- default = tuple( [ i == 1 for i in range(0, 32) ] )
- )
+ ControlLayersOption.TWEAK.add_parameters(params)
def parameters_ui(layout, params):
@@ -1096,45 +1080,7 @@ def parameters_ui(layout, params):
row.prop(params, "copy_rotation_axes", index=i, toggle=True, text=axis)
r.enabled = params.use_tail
- r = layout.row()
- r.prop(params, "tweak_extra_layers")
- r.active = params.tweak_extra_layers
-
- col = r.column(align=True)
- row = col.row(align=True)
-
- bone_layers = bpy.context.active_pose_bone.bone.layers[:]
-
- for i in range(8):
- icon = "NONE"
- if bone_layers[i]:
- icon = "LAYER_ACTIVE"
- row.prop(params, "tweak_layers", index=i, toggle=True, text="", icon=icon)
-
- row = col.row(align=True)
-
- for i in range(16, 24):
- icon = "NONE"
- if bone_layers[i]:
- icon = "LAYER_ACTIVE"
- row.prop(params, "tweak_layers", index=i, toggle=True, text="", icon=icon)
-
- col = r.column(align=True)
- row = col.row(align=True)
-
- for i in range(8, 16):
- icon = "NONE"
- if bone_layers[i]:
- icon = "LAYER_ACTIVE"
- row.prop(params, "tweak_layers", index=i, toggle=True, text="", icon=icon)
-
- row = col.row(align=True)
-
- for i in range(24, 32):
- icon = "NONE"
- if bone_layers[i]:
- icon = "LAYER_ACTIVE"
- row.prop(params, "tweak_layers", index=i, toggle=True, text="", icon=icon)
+ ControlLayersOption.TWEAK.parameters_ui(layout, params)
def create_sample(obj):