Skip to content

Commit

Permalink
Still can't figure out why leg_ik isn't setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndresMWeber committed Feb 9, 2018
1 parent 9751758 commit c7d77e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions anvil/sub_rig_templates/biped_foot.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ def get_control_shape(self, label):
pass
return shape

def build(self, duplicate=True, **kwargs):
def build(self, duplicate=True, leg_ik=None, **kwargs):
print(leg_ik, kwargs)
super(BipedFoot, self).build(**kwargs)
self.leg_ik = leg_ik or self.leg_ik

if duplicate:
self.ankle, self.ball, self.toe = nt.HierarchyChain(self.layout_joints[0].duplicate(all_children=True))

Expand Down Expand Up @@ -94,7 +97,9 @@ def build_ik_toe(self):
name_tokens={cfg.NAME: self.BALL_TOKEN, cfg.TYPE: cfg.IK_EFFECTOR})

if self.leg_ik:
self.leg_ik.parent(self.ball)
self.leg_ik.parent(self.control_ball.connection_group)
else:
rt.dcc.connections.parent(self.control_ball.connection_group, self.ankle)

def build_fk_toe(self):
md = self.register_node('ball_rotation_cancel_out',
Expand Down
8 changes: 4 additions & 4 deletions tests/acceptance/test_biped_foot.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def test_build_with_leg_ik(self):
with cleanup_nodes():
parent = nt.Transform.build(name='test')
self.import_template_files(self.FOOT_WITH_LEG)
foot_ball_result = self.TEMPLATE_CLASS.build_ik(
nt.HierarchyChain('hip', 'foot', node_filter=cfg.JOINT_TYPE),
solver=cfg.IK_RP_SOLVER)
foot_ball_result = self.TEMPLATE_CLASS.build_ik(nt.HierarchyChain('hip', 'foot',
node_filter=cfg.JOINT_TYPE),
solver=cfg.IK_RP_SOLVER)
handle, effector = foot_ball_result[cfg.NODE_TYPE]
rig_instance = self.from_template_file(None, leg_ik=handle, skip_import=True, parent=parent)
rig_instance = self.from_template_file('None', skip_import=True, parent=parent, leg_ik=handle)
self.assertEqual(str(rig_instance.root.get_parent()), str(parent))


Expand Down

0 comments on commit c7d77e8

Please sign in to comment.