def execute(self, context): xpsSettings = xps_types.XpsImportSettings( self.filepath, self.uvDisplX, self.uvDisplY, self.impDefPose, self.joinMeshRips, self.joinMeshParts, self.markSeams and self.joinMeshRips, self.colorizeMesh, self.vColors, self.connectBones, self.autoIk, self.importNormals) status = import_xnalara_model.getInputFilename(xpsSettings) if status == '{PROTECTED}': # self.report({'DEBUG'}, "DEBUG Model is Mod-Protected") # self.report({'INFO'}, "INFO Model is Mod-Protected") # self.report({'OPERATOR'}, "OPERATOR Model is Mod-Protected") self.report({'WARNING'}, "WARNING Model is Mod-Protected") # self.report({'ERROR'}, "ERROR Model is Mod-Protected") if status == '{NONE}': self.report({'ERROR'}, "ERROR File Format unrecognized") return {'FINISHED'}
armature_ob.pose.bones[boneName].bone_group = boneGroup bpy.ops.object.mode_set(mode=previous_mode) def getBoneGroup(name): bpy.ops.pose.group_add() bvhrig = bpy.context.scene.objects.active bvhgroup = bvhrig.pose.bone_groups.active bvhgroup.name = name bvhgroup.color_set = 'CUSTOM' return bvhgroup if __name__ == "__main__": impDefPose = True joinMeshRips = True joinMesheParts = True uvDisplX = 0 uvDisplY = 0 connectBones = True autoIk = True readfilename = r'C:\XPS Tutorial\Yaiba MOMIJIII\momi3.mesh.mesh' xpsSettings = xps_types.XpsImportSettings(readfilename, uvDisplX, uvDisplY, impDefPose, joinMeshRips, joinMesheParts, connectBones, autoIk) getInputFilename(xpsSettings)
def getXpsFace(faceVerts): xpsFaces = [] if len(faceVerts) == 3: xpsFaces.append(faceTransform(faceVerts)) else: v1, v2, v3, v4 = faceVerts xpsFaces.append(faceTransform((v1, v2, v3))) xpsFaces.append(faceTransform((v1, v3, v4))) return xpsFaces if __name__ == "__main__": uvDisplX = 0 uvDisplY = 0 exportOnlySelected = True exportPose = False modProtected = False filename1 = (r'G:\3DModeling\XNALara\XNALara_XPS\data\TESTING5\Drake\RECB ' 'DRAKE Pack_By DamianHandy\DRAKE Sneaking Suit - Open_by ' 'DamianHandy\Generic_Item - BLENDER pose.mesh') filename = r'C:\XPS Tutorial\Yaiba MOMIJIII\momi.mesh.ascii' xpsSettings = xps_types.XpsImportSettings(filename, uvDisplX, uvDisplY, exportOnlySelected, exportPose, modProtected) getOutputFilename(xpsSettings)
boneGroup.colors.select = bone_pose_color boneGroup.colors.active = bone_pose_active_color vertexGroups = mesh_ob.vertex_groups.keys() poseBones = armature_ob.pose.bones for boneName in vertexGroups: poseBones[boneName].bone_group = boneGroup if __name__ == "__main__": readfilename = r'C:\XPS Tutorial\Yaiba MOMIJIII\momi3.mesh.mesh' uvDisplX = 0 uvDisplY = 0 impDefPose = True joinMeshRips = True joinMeshParts = True markSeams = True colorizeMesh = True vColors = True connectBones = True autoIk = True importNormals = True xpsSettings = xps_types.XpsImportSettings(readfilename, uvDisplX, uvDisplY, impDefPose, joinMeshRips, markSeams, colorizeMesh, vColors, joinMeshParts, connectBones, autoIk, importNormals) getInputFilename(xpsSettings)