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>2022-10-25 16:12:18 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2022-11-07 17:16:57 +0300
commitdddf346f1adf49f51351ead084fbb7d5e1a8f9a0 (patch)
tree2595a655dcd9d169ee22f8323c4588fb2ac68b51 /rigify/generate.py
parentd477a245c03c2c5227c97825b20e62d1469e24b2 (diff)
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
Diffstat (limited to 'rigify/generate.py')
-rw-r--r--rigify/generate.py3
1 files changed, 3 insertions, 0 deletions
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')