Esempio n. 1
0
 def test_layout(self):
     layout = 'test'
     rig = nt.AbstractGrouping(meta_data=None,
                               top_node=None,
                               layout_joints=layout,
                               parent=None)
     self.assertEquals(rig.layout_joints, layout)
Esempio n. 2
0
 def test_parent_without_top_node(self):
     test_parent_node = nt.Transform.build()
     rig = nt.AbstractGrouping(meta_data=None,
                               top_node=None,
                               layout_joints=None,
                               parent=test_parent_node)
     self.assertEquals(rig.root, None)
Esempio n. 3
0
 def test_kwargs(self):
     test_flags = {'blah': 'fart'}
     rig = nt.AbstractGrouping(meta_data=None,
                               top_node=None,
                               layout_joints=None,
                               parent=None,
                               **test_flags)
     self.assertEqual(rig.build_kwargs, test_flags)
Esempio n. 4
0
 def test_meta_data(self):
     test_meta_data = {'blah': 'fart'}
     rig = nt.AbstractGrouping(meta_data=test_meta_data,
                               top_node=None,
                               layout_joints=None,
                               parent=None)
     test_meta_data.update(nt.AbstractGrouping.BUILT_IN_META_DATA)
     self.assertEqual(rig.meta_data, test_meta_data)
Esempio n. 5
0
 def test_all(self):
     test_parent_node = nt.Transform.build()
     layout = 'test'
     test_top_node = nt.Transform.build()
     test_meta_data = {'blah': 'fart'}
     nt.AbstractGrouping(meta_data=test_meta_data,
                         top_node=test_top_node,
                         layout_joints=layout,
                         parent=test_parent_node)
Esempio n. 6
0
 def test_meta_data_nomenclate(self):
     test_meta_data = {'blah': 'fart'}
     rig = nt.AbstractGrouping(meta_data={'blah': 'fart'},
                               top_node=None,
                               layout_joints=None,
                               parent=None)
     tokens = rig._nomenclate.token_dict.to_json()
     self.assertEquals(
         {k: tokens[k]['label']
          for k in tokens if k == 'blah'}, test_meta_data)
Esempio n. 7
0
 def test_empty_string(self):
     test_xform = nt.Transform.build()
     rig = nt.AbstractGrouping(top_node=test_xform)
     was_parented = rig.parent('')
     self.assertFalse(was_parented)
Esempio n. 8
0
 def test_built_node_registered_joint(self):
     grouping = nt.AbstractGrouping()
     report = grouping.build_node(nt.Joint)
     self.assertEqual(report[cfg.JOINT_TYPE][cfg.DEFAULT],
                      grouping.hierarchy.joint.default)
Esempio n. 9
0
 def test_built_node_registered_control(self):
     grouping = nt.AbstractGrouping()
     report = grouping.build_node(nt.Control)
     self.assertEqual(report[cfg.CONTROL_TYPE][cfg.DEFAULT],
                      grouping.hierarchy.control.default)
Esempio n. 10
0
 def test_built_node_registered_autosorted(self):
     grouping = nt.AbstractGrouping()
     report = grouping.build_node(nt.Transform)
     self.assertEqual(report[cfg.NODE_TYPE][cfg.DEFAULT],
                      grouping.hierarchy.node.default)
Esempio n. 11
0
 def test_both_exist(self):
     test_xform = nt.Transform.build()
     test_top_node = nt.Transform.build()
     rig = nt.AbstractGrouping(top_node=test_top_node)
     was_parented = rig.parent(test_xform)
     self.assertTrue(was_parented)
Esempio n. 12
0
 def test_exists_but_no_top_node(self):
     test_xform = nt.Transform.build()
     rig = nt.AbstractGrouping()
     was_parented = rig.parent(test_xform)
     self.assertFalse(was_parented)