Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import maya.cmds as mc
- sel = mc.ls( sl=1 )
- def dupMeshOnly( obj ):
- objShape = mc. listRelatives( obj, s=1 )
- par = mc.duplicate( objShape[0], po=1 )
- shape = mc.createNode( 'mesh', p=par[0] )
- mc.connectAttr( objShape[0] + '.outMesh', shape + '.inMesh', f=1 )
- mc.evalDeferred( 'import maya.cmds; maya.cmds.disconnectAttr( \'' + objShape[0] + '.outMesh\', \'' + shape + '.inMesh\' )' )
- return par[0]
- for s in sel:
- res = dupMeshOnly( s )
- mc.polyTransfer( res, uv=1, ao=s )
- print res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement