Skip to content
Snippets Groups Projects
Commit 3428aad9 authored by Nathan Vegdahl's avatar Nathan Vegdahl
Browse files

Rigify works again! Yay!

Just required some misc updates due to python API changes.
parent aae36412
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ INTRODUCTION
------------
Rigify is an auto-rigging system based on a "building blocks" paradigm. The
user can create a rig by putting together any combination of rig types, in any
confguration that they want.
configuration that they want.
A rig type is something like "biped arm" or "spine" or "finger".
......
......@@ -116,13 +116,6 @@ class RigifyParameters(bpy.types.PropertyGroup):
name = bpy.props.StringProperty()
for rig in rig_list:
r = utils.get_rig_type(rig).Rig
try:
r.add_parameters(RigifyParameters)
except AttributeError:
pass
##### REGISTER #####
......@@ -141,6 +134,13 @@ def register():
IDStore.rigify_types = bpy.props.CollectionProperty(type=RigifyName)
IDStore.rigify_active_type = bpy.props.IntProperty(name="Rigify Active Type", description="The selected rig type.")
# Add rig parameters
for rig in rig_list:
r = utils.get_rig_type(rig).Rig
try:
r.add_parameters(RigifyParameters)
except AttributeError:
pass
def unregister():
del bpy.types.PoseBone.rigify_type
......
......@@ -158,9 +158,9 @@ class Rig:
vispole_e.tail = vispole_e.head + Vector((0, 0, v1.length / 32))
# Determine the pole offset value
plane = (farm_e.tail - uarm_e.head).normalize()
vec1 = uarm_e.x_axis.normalize()
vec2 = (pole_e.head - uarm_e.head).normalize()
plane = (farm_e.tail - uarm_e.head).normalized()
vec1 = uarm_e.x_axis.normalized()
vec2 = (pole_e.head - uarm_e.head).normalized()
pole_offset = angle_on_plane(plane, vec1, vec2)
# Object mode, get pose bones
......
......@@ -78,6 +78,7 @@ class Rig:
group.separate_ik_layers = bpy.props.BoolProperty(name="Separate IK Control Layers:", default=False, description="Enable putting the ik controls on a separate layer from the fk controls.")
group.ik_layers = bpy.props.BoolVectorProperty(size=32, description="Layers for the ik controls to be on.")
print("Adding thigh twist.")
group.use_thigh_twist = bpy.props.BoolProperty(name="Thigh Twist", default=True, description="Generate the dual-bone twist setup for the thigh.")
group.use_shin_twist = bpy.props.BoolProperty(name="Shin Twist", default=True, description="Generate the dual-bone twist setup for the shin.")
......
......@@ -141,7 +141,7 @@ class Rig:
# Positioning
vec = Vector(eb[self.org_bones[3]].vector)
vec = vec.normalize()
vec.normalize()
foot_e.tail = foot_e.head + (vec * foot_e.length)
foot_e.roll = eb[self.org_bones[3]].roll
......
......@@ -221,7 +221,7 @@ class Rig:
# Positioning
vec = Vector(toe_e.vector)
vec = vec.normalize()
vec.normalize()
foot_e.tail = foot_e.head + (vec * foot_e.length)
foot_e.roll = toe_e.roll
......@@ -281,9 +281,9 @@ class Rig:
foot_ik_target_e.tail = Vector(org_foot_e.tail)
# Determine the pole offset value
plane = (shin_e.tail - thigh_e.head).normalize()
vec1 = thigh_e.x_axis.normalize()
vec2 = (pole_e.head - thigh_e.head).normalize()
plane = (shin_e.tail - thigh_e.head).normalized()
vec1 = thigh_e.x_axis.normalized()
vec2 = (pole_e.head - thigh_e.head).normalized()
pole_offset = angle_on_plane(plane, vec1, vec2)
# Object mode, get pose bones
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment