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:
-rw-r--r--rigify/utils/mechanism.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/rigify/utils/mechanism.py b/rigify/utils/mechanism.py
index 937e07e9..8cd34624 100644
--- a/rigify/utils/mechanism.py
+++ b/rigify/utils/mechanism.py
@@ -37,7 +37,7 @@ def _set_default_attr(obj, options, attr, value):
options.setdefault(attr, value)
def make_constraint(
- owner, type, target=None, subtarget=None, *,
+ owner, type, target=None, subtarget=None, *, insert_index=None,
space=None, track_axis=None, use_xyz=None, use_limit_xyz=None,
**options):
"""
@@ -46,6 +46,7 @@ def make_constraint(
Specially handled keyword arguments:
target, subtarget: if both not None, passed through to the constraint
+ insert_index : insert at the specified index in the stack, instead of at the end
space : assigned to both owner_space and target_space
track_axis : allows shorter X, Y, Z, -X, -Y, -Z notation
use_xyz : list of 3 items is assigned to use_x, use_y and use_z options
@@ -57,6 +58,9 @@ def make_constraint(
"""
con = owner.constraints.new(type)
+ if insert_index is not None:
+ owner.constraints.move(len(owner.constraints)-1, insert_index)
+
if target is not None and hasattr(con, 'target'):
con.target = target
@@ -264,7 +268,7 @@ def make_driver(owner, prop, *, index=-1, type='SUM', expression=None, variables
return fcu
-def driver_var_transform(target, bone=None, *, type='LOC_X', space='WORLD'):
+def driver_var_transform(target, bone=None, *, type='LOC_X', space='WORLD', rotation_mode='AUTO'):
"""
Create a Transform Channel driver variable specification.
@@ -278,6 +282,7 @@ def driver_var_transform(target, bone=None, *, type='LOC_X', space='WORLD'):
'id': target,
'transform_type': type,
'transform_space': space + '_SPACE',
+ 'rotation_mode': rotation_mode,
}
if bone is not None: