Пример #1
0
 def test_multiple_mats_assigned_to_skinned_mesh(self):
     test_skinned_cube = self.create_cube()
     test_joints = [self.create_joint() for _ in range(5)]
     skincl = skinutils.bind_mesh_to_joints(test_skinned_cube,
                                            test_joints,
                                            maximumInfluences=5)
     mat1, _ = matutils.create_material('foo')
     mat2, _ = matutils.create_material('bar')
     matutils.assign_material(test_skinned_cube, mat1)
     matutils.assign_material(test_skinned_cube.f[0], mat2)
     skinned_meshes_from_scene = skinutils.get_skinned_meshes_from_scene()
     self.assertListEqual([test_skinned_cube], skinned_meshes_from_scene)
Пример #2
0
 def test_creates_shadinggroup(self):
     mat, shading_group = materialutils.create_material('test_mat')
     self.scene_nodes.extend([mat, shading_group])
     shading_groups = self.pm.ls(type=self.pm.nt.ShadingEngine)
     result = mat.shadingGroups()[0]
     self.assertEqual(shading_group, result)
     self.assertTrue(result in shading_groups)
Пример #3
0
 def create_material(self, mat_type=None):
     mat_type = mat_type or 'lambert'
     mat, shading_group = materialutils.create_material(
         'test_mat', mat_type)
     self.scene_nodes.append(mat)
     self.scene_nodes.append(shading_group)
     return mat, shading_group
Пример #4
0
 def test_creates_material(self):
     mat, _ = materialutils.create_material('test_mat')
     self.scene_nodes.extend([mat, _])
     mats_in_scene = self.pm.ls(type=self.pm.nt.ShadingDependNode)
     self.assertTrue(mat in mats_in_scene)