diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2019-02-16 13:57:57 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2019-03-14 14:39:16 +0300 |
commit | 36e8d00aec705b06008a0bc334fe266448b4f2c2 (patch) | |
tree | 02bf0290ec6423c611e3cd4ad49c69cb77acb67e /rigify/rigs/limbs/simple_tentacle.py | |
parent | eabb5cddf79e5fae3ca429242cf2c6f5a272920e (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/limbs/simple_tentacle.py')
-rw-r--r-- | rigify/rigs/limbs/simple_tentacle.py | 62 |
1 files changed, 4 insertions, 58 deletions
diff --git a/rigify/rigs/limbs/simple_tentacle.py b/rigify/rigs/limbs/simple_tentacle.py index 71a9eaa9..82fcafe8 100644 --- a/rigify/rigs/limbs/simple_tentacle.py +++ b/rigify/rigs/limbs/simple_tentacle.py @@ -4,6 +4,7 @@ from ...utils import strip_org, make_deformer_name, connected_children_names from ...utils import put_bone, create_sphere_widget from ...utils import create_circle_widget, align_bone_x_axis from ...utils import MetarigError +from ...utils import ControlLayersOption class Rig: @@ -15,11 +16,6 @@ class Rig: self.copy_rotation_axes = params.copy_rotation_axes - if params.tweak_extra_layers: - self.tweak_layers = list(params.tweak_layers) - else: - self.tweak_layers = None - if len(self.org_bones) <= 1: raise MetarigError( "RIGIFY ERROR: invalid rig structure on bone: %s" % (strip_org(bone_name)) @@ -118,9 +114,7 @@ class Rig: tweak_pb.lock_rotation = (True, True, True) tweak_pb.lock_scale = (True, True, True) - # Set up tweak bone layers - if self.tweak_layers: - tweak_pb.bone.layers = self.tweak_layers + ControlLayersOption.TWEAK.assign(self.params, self.obj.pose.bones, tweak_chain) return tweak_chain @@ -250,17 +244,7 @@ def add_parameters(params): ) # Setting up extra tweak layers - 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) items = [('automatic', 'Automatic', ''), ('manual', 'Manual', '')] params.roll_alignment = bpy.props.EnumProperty(items=items, name="Bone roll alignment", default='automatic') @@ -277,45 +261,7 @@ def parameters_ui(layout, params): for i, axis in enumerate(['x', 'y', 'z']): row.prop(params, "copy_rotation_axes", index=i, toggle=True, text=axis) - 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): # Layers 0-7 - 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): # Layers 16-23 - 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): # Layers 8-15 - 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): # Layers 24-31 - 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): |