cwisbg

# delete based on normal

Jan 25th, 2016
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. # delete based on normal
  2. from pymel.core import*
  3. sl = selected()
  4. for s in sl:
  5.     grpNode = createNode("group",n = s+"_group")
  6.     s.worldMesh >> grpNode.inGeometry
  7.     deleteNode = createNode("deleteComponent",n = s+"deleteComponent")
  8.     grpNode.outComponents >> deleteNode.deleteComponents
  9.     grpNode.outGeometry >> deleteNode.inputGeometry
  10.     meshNode = createNode("mesh",n = s+"mesh")
  11.     deleteNode.outputGeometry >> meshNode.inMesh
  12.     setAttr(s.visibility,0)
  13.     boundingNode = createNode("boundingObject",n = s+"boundingObject")
  14.     boundingNodeShape = listRelatives(boundingNode,p=1,s=1)
  15.     boundingNodeShape[0].matrix >> boundingNode.inParentMatrix
  16.     boundingNode.outParentMatrix >> grpNode.boundingObjects[0].boundParentMatrix
  17.     boundingNode.outData >> grpNode.boundingObjects[0]
  18.     setAttr(grpNode.componentType,2)
Add Comment
Please, Sign In to add comment