Merge branch 'blender-v2.81-release'
This commit is contained in:
commit
11871509f9
|
@ -27,7 +27,7 @@ from .utils.errors import MetarigError, RaiseErrorMixin
|
|||
from .utils.naming import random_id
|
||||
from .utils.metaclass import SingletonPluginMetaclass
|
||||
from .utils.rig import list_bone_names_depth_first_sorted, get_rigify_type
|
||||
from .utils.misc import assign_parameters
|
||||
from .utils.misc import clone_parameters, assign_parameters
|
||||
|
||||
from . import base_rig
|
||||
|
||||
|
@ -78,6 +78,7 @@ class SubstitutionRig(RaiseErrorMixin):
|
|||
self.obj = generator.obj
|
||||
self.base_bone = pose_bone.name
|
||||
self.params = pose_bone.rigify_parameters
|
||||
self.params_copy = clone_parameters(self.params)
|
||||
|
||||
def substitute(self):
|
||||
# return [rig1, rig2...]
|
||||
|
|
|
@ -165,8 +165,13 @@ class Generator(base_generate.BaseGenerator):
|
|||
# Select the target rig and join
|
||||
select_object(context, obj)
|
||||
|
||||
saved_matrix = obj.matrix_world.copy()
|
||||
obj.matrix_world = metarig.matrix_world
|
||||
|
||||
bpy.ops.object.join()
|
||||
|
||||
obj.matrix_world = saved_matrix
|
||||
|
||||
# Select the generated rig
|
||||
select_object(context, obj, deselect_all=True)
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class Rig(SubstitutionRig, BoneUtilityMixin):
|
|||
"""Compatibility proxy for the monolithic super_spine rig that splits it into parts."""
|
||||
|
||||
def substitute(self):
|
||||
params_copy = dict(self.params)
|
||||
params_copy = self.params_copy
|
||||
orgs = [self.base_bone] + connected_children_names(self.obj, self.base_bone)
|
||||
|
||||
# Split the bone list according to the settings
|
||||
|
|
|
@ -24,6 +24,7 @@ import collections
|
|||
|
||||
from itertools import tee, chain, islice, repeat
|
||||
from mathutils import Vector, Matrix, Color
|
||||
from rna_prop_ui import rna_idprop_value_to_python
|
||||
|
||||
|
||||
#=============================================
|
||||
|
@ -170,8 +171,30 @@ def copy_attributes(a, b):
|
|||
pass
|
||||
|
||||
|
||||
def property_to_python(value):
|
||||
value = rna_idprop_value_to_python(value)
|
||||
|
||||
if isinstance(value, dict):
|
||||
return { k: property_to_python(v) for k, v in value.items() }
|
||||
elif isinstance(value, list):
|
||||
return map_list(property_to_python, value)
|
||||
else:
|
||||
return value
|
||||
|
||||
|
||||
def clone_parameters(target):
|
||||
return property_to_python(dict(target))
|
||||
|
||||
|
||||
def assign_parameters(target, val_dict=None, **params):
|
||||
data = { **val_dict, **params } if val_dict else params
|
||||
if val_dict is not None:
|
||||
for key in list(target.keys()):
|
||||
del target[key]
|
||||
|
||||
data = { **val_dict, **params }
|
||||
else:
|
||||
data = params
|
||||
|
||||
for key, value in data.items():
|
||||
try:
|
||||
target[key] = value
|
||||
|
|
Loading…
Reference in New Issue