Forum
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Remove empty Stitchings and Narrow Filters 8 months 1 week ago #536

  • admin
  • admin's Avatar Topic Author
  • Offline
  • Administrator
  • Administrator
  • Posts: 160
  • Thank you received: 20
The Carbon Garment Processor is a brute force process and creates many empty Stitchings and Narrow Filters nodes.
To remove these.... Select the Stitchings group and run this python script:
import maya.cmds as cmds
import carbonPublicAPI
stitchingsGroup = cmds.ls(sl=True)
stitchings = cmds.listRelatives(stitchingsGroup, children=True)
simulation = cmds.listConnections(stitchings[0] + '.carbonSimulationData', d=False, s=True, sh=True)[0]
carbonPublicAPI.setSimulationStatus(simulation, 0)
print simulation
for stitching in stitchings:     
    constraintCount = cmds.getAttr(stitching + '.constraintCount')     
    if constraintCount == 0:         
        narrowFilters = cmds.listConnections(stitching + '.carbonNodeData', d=True, s=False, sh=True, t='CarbonNarrowFilter')         
        if narrowFilters is not None:             
            cmds.delete(cmds.listRelatives(narrowFilters, parent=True)[0])         
        cmds.delete(stitching)
carbonPublicAPI.setSimulationStatus(simulation, 1)

If you have any questions about this script please start a topic below.
 
Last edit: by admin.
The topic has been locked.
  • Page:
  • 1
Time to create page: 0.186 seconds