* rna: memory leak fix for RNA_property_enum_value()

* rigify: generate root-most bones before children, this makes parenting to dynamically created bones work.
This commit is contained in:
Campbell Barton
2009-12-13 12:26:19 +00:00
parent 646575f8d9
commit c1bfd014bd
4 changed files with 9 additions and 9 deletions

View File

@@ -211,7 +211,7 @@ def generate_rig(context, obj_orig, prefix="ORG-", META_DEF=True):
# sort bones, not needed but gives more pradictable execution which may be useful in rare cases
bones_sorted = obj.pose.bones.values()
bones_sorted.sort(key=lambda pbone: pbone.name) # first sort by names
bones_sorted.sort(key=lambda pbone: - len(pbone.parent_recursive)) # children before parents
bones_sorted.sort(key=lambda pbone: len(pbone.parent_recursive)) # parents before children
# now we have all the info about bones we can start operating on them
# for pbone in obj.pose.bones:

View File

@@ -94,7 +94,7 @@ def metarig_definition(obj, orig_bone_name):
def ik(obj, definitions, base_names, options):
print(options)
arm = obj.data
mt = bone_class_instance(obj, METARIG_NAMES)

View File

@@ -225,7 +225,7 @@ def main(obj, bone_definition, base_names, options):
rel_vec = child_pbone_01.head - child_pbone_02.head
x_vec = child_pbone_01.matrix.rotationPart() * Vector(1.0, 0.0, 0.0)
print(rel_vec, x_vec)
return degrees(AngleBetweenVecs(rel_vec, x_vec)) > 90.0
if x_direction(): # flip