From dddf346f1adf49f51351ead084fbb7d5e1a8f9a0 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Tue, 25 Oct 2022 16:12:18 +0300 Subject: Rigify: port the ability to generate Action constraints from CloudRig. CloudRig has a feature that allows the user to automatically generate Action constraints that move bones of the rig based on the position of other bones. This is done by adding and configuring the actions in a UI panel of the metarig. The feature also supports corrective actions that activate based on the state of two other actions. This ports the feature to base Rigify with the necessary changes in code organization and style, and replacing CloudRig-specific code. There are also some functional changes: - The order of action constraints is reversed. - The way symmetry of LOCATION_X is handed is changed to match how Paste Pose Flipped works. - The action slot UI is shown even without a generated rig. - More alerts in the UI, e.g. for duplicate rows. Differential Revision: https://developer.blender.org/D16336 --- rigify/generate.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rigify/generate.py') diff --git a/rigify/generate.py b/rigify/generate.py index 4f30adff..7060c448 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -16,6 +16,7 @@ from .utils.misc import gamma_correct, select_object, ArmatureObject, verify_arm from .utils.collections import (ensure_collection, list_layer_collections, filter_layer_collections_by_object) from .utils.rig import get_rigify_type, get_rigify_layers +from .utils.action_layers import ActionLayerBuilder from . import base_generate from . import rig_ui_template @@ -37,6 +38,7 @@ class Timer: class Generator(base_generate.BaseGenerator): usable_collections: list[bpy.types.LayerCollection] + action_layers: ActionLayerBuilder def __init__(self, context, metarig): super().__init__(context, metarig) @@ -456,6 +458,7 @@ class Generator(base_generate.BaseGenerator): obj.data["rig_id"] = self.rig_id self.script = rig_ui_template.ScriptGenerator(self) + self.action_layers = ActionLayerBuilder(self) ########################################### bpy.ops.object.mode_set(mode='OBJECT') -- cgit v1.2.3