def test_import_skin_on_selected_subset(self): file_path = self.get_temp_filename("temp.skin") skinio.export_skin(file_path, self.shape) cmds.skinPercent( self.skin, "{0}.vtx[0]".format(self.shape), transformValue=[(self.joint1, 0.1), (self.joint2, 0.2), (self.joint3, 0.7)], ) cmds.skinPercent( self.skin, "{0}.vtx[1]".format(self.shape), transformValue=[(self.joint1, 0.1), (self.joint2, 0.2), (self.joint3, 0.7)], ) cmds.select("{}.vtx[1]".format(self.shape)) skinio.import_skin(file_path, to_selected_shapes=True) skin = skinio.SkinCluster(self.skin) data = skin.gather_data() w1 = [0.1, 0.5, 0.5, 0.0, 0.5, 0.0, 0.9, 0.5] w2 = [0.2, 0.5, 0.5, 0.5, 0.5, 0.5, 0.1, 0.5] w3 = [0.7, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0] self.assertListAlmostEqual(w1, data["weights"]["joint1"]) self.assertListAlmostEqual(w2, data["weights"]["joint2"]) self.assertListAlmostEqual(w3, data["weights"]["joint3"])
def test_import_skin_sets_correct_data(self): file_path = self.get_temp_filename('temp.skin') skinio.export_skin(file_path, self.shape) cmds.skinPercent(self.skin, '{0}.vtx[0]'.format(self.shape), transformValue=[(self.joint1, 0.1), (self.joint2, 0.2), (self.joint3, 0.7)]) skinio.import_skin(file_path) self.test_skincluster_data_is_correct()
def test_import_skin(self): file_path = self.get_temp_filename('temp.skin') skinio.export_skin(file_path, self.shape) cmds.delete(self.skin) skinio.import_skin(file_path) self.assertTrue(cmds.objExists(self.skin))
def execute(self): for file_field in self.array_field: file_path = file_field.value() skinio.import_skin(file_path)
def execute(self): for file_field in self.files: file_path = file_field.get_path() skinio.import_skin(file_path)