Duplicate skin cluster node will generate multiple bindPose nodes?

Duplicate skin cluster node will generate multiple bindPose nodes?

jiajun.coding
Advocate Advocate
306 Views
3 Replies
Message 1 of 4

Duplicate skin cluster node will generate multiple bindPose nodes?

jiajun.coding
Advocate
Advocate

The according command is

 

 

 

cmds.duplicate("XXX_SCL", inputConnections=True)

 

 

Works well in most case but it make maya file size grows very large sometimes.

The worst case is from 100MB to 3GB.

In my finding, it will generate multiple bindPose nodes and only one bindPose node will connect to skinCluster? Why there are unused bindPose nodes generated?

Any ideas?

 

0 Likes
307 Views
3 Replies
Replies (3)
Message 2 of 4

1925250542
Participant
Participant
Message 3 of 4

brentmc
Autodesk
Autodesk

Thanks. I'll pass this on to the team.

Brent McPherson
Principle Engineer
Message 4 of 4

jiajun.coding
Advocate
Advocate

 

 

# Too many useless bindPose nodes will cause a large file size and very slow to save in disk.
def removeUselessBindPoses():
    removedAnyBindPose = False

    allDagPoseNodes = cmds.ls(type="dagPose") or []
    for poseNode in allDagPoseNodes:
        if "bindPose" in poseNode:
            connectionNodes = cmds.listConnections(poseNode) or []
            connectionNodes = list(set(connectionNodes))

    isUseful = False
    for connectionNode in connectionNodes:
        if cmds.objectType(connectionNode) == "skinCluster":
            isUseful = True
            break

    if not isUseful:
        cmds.delete(poseNode)
        removedAnyBindPose = True

    return removedAnyBindPose

 

 

This is my current solution to remove these generated but seems useless dagPose nodes named "bindPoseXXX".

0 Likes