Adverti horiz upsell

Combine Separate Skinned Meshes Tool 1.0.0 for Maya (maya script)

Tool to make faster the process of rig/skinning to combine skinned meshes together

License
Button download
1,371 Downloads

Compatibility

  • 2017

Operating Systems

  • Windows

History

Created:03/02/2016
Last Modified:01/19/2018
File Size: 1.49 KB

Q/A

'CombineSkinnedMeshProc' is not defined

Date:07/25/2016
Submitted by: malae malae
Hi,

I've tried to use your tool today, but unfortunately it gives me the error message:
# Error: NameError: file <maya console> line 1: name 'CombineSkinnedMeshProc' is not defined

I'm using Maya 2015x64

Could you tell me what I might do wrong? :)

Thanks!

Replies to this question:

  • Replyindent
    Radek Rada

    Radek Rada said over 8 years ago:

    CombineSkinnedMeshProc is defined outside the CombineSkinnedMesh Class scope, so you need to edit the cmds.button inside the class like this: cmds.button( label='Combine Skin Mesh', c="CombineSkinnedMesh.CombineSkinnedMeshProc()")
  • Stefano Susco

    Stefano Susco said over 8 years ago:

    Hello, is my fault....... try this: import maya.cmds as cmds import maya.mel as mel def CombineSkinnedMeshProc( *args): selection = cmds.ls(sl=True) if(len(selection) == 0): raise TypeError ('Please Select at least two skinned Meshes') elif(len(selection) == 1): raise TypeError ('Please Select at least two skinned Meshes') textField_obj = cmds.textField( textFieldName, query=True, text=True ) if(len(textField_obj) == 0): raise TypeError ('Please Assign a Name') if cmds.objExists(textField_obj): raise TypeError("Warning: this name is already in use") for item in selection: findSkinStart = mel.eval('findRelatedSkinCluster ' + item) if cmds.objExists (findSkinStart): print findSkinStart else: raise TypeError("Please Select at least two skinned Meshes ") if len (selection) > 0: print selection for i in range(1): duplicateObj = cmds.duplicate (selection) createGrp = cmds.group (duplicateObj) combine = cmds.polyUnite (createGrp, name = textField_obj) deleteHistory = cmds.delete (combine, ch=True) deleteGrp = cmds.select (cmds.delete (createGrp)) joints = cmds.skinCluster (item , q=True , inf=True) jnt = cmds.select (joints, textField_obj, add= True) cmds.textField( textFieldName, e=True, text='') selectionforBind = cmds.ls(sl=True) newskin = cmds.skinCluster(selectionforBind) newSelect = cmds.select (joints, selection,textField_obj, add= True ) transfer = cmds.copySkinWeights (nm=True, sa ="closestPoint", ia ="closestJoint") delete = cmds.delete (selection) deselect = cmds.select (cl=True) class CombineSkinnedMesh(): def __init__(self): global textFieldName if cmds.window('CombineMeshWin', exists=True): cmds.deleteUI('CombineMeshWin') CombineMeshWin = cmds.window ("CombineMeshWin", title="Combine Skinned Mesh", widthHeight=(300, 80), s=0) cmds.columnLayout(adjustableColumn=True ) cmds.text( label='Assign Name to New Mesh' ) textFieldName = cmds.textField() spacenoedit = cmds.textField( ed = False) cmds.button( label='Combine Skin Mesh', c="CombineSkinnedMeshProc()") cmds.setParent( '..' ) cmds.showWindow(CombineMeshWin) CombineSkinnedMesh() Anyway, I'm updating the tool also cause some error of transcription......and I will update it with also the possibility to reverse the process.

Post a reply: