PyMEL

General

TO DO

  • script to determine in maya if there is a difference between the skinculster one and off

General syntax
 1# Get object based on name
 2obj = pm.PyNode('pCube1')
 3obj = pm.nt.Joint('joint1')
 4objects = pm.ls(['Object_A', 'Object_B'])
 5
 6# Get objects selected
 7obj = pm.selected()
 8
 9# Select all based on node type
10obj_sel = pm.ls(type="displayLayer")
11
12# Select all based on wildcard search
13obj_sel = pm.ls("*_con") # wild card search
14obj_sel = pm.ls("*Sphere*", type = "transform") # wild card search
15
16# Get node based on nodetype
17# connections method only work on the shape node
18for node in obj.getShape().connections():
19    if node.nodeType() == 'skinCluster':
20    print (node.nodeType())
21    sc_node = node
22
23# Alternative on getting the shape and actually any other connection depending on the index
24pm.selected()[0].listHistory()[0]
25
26# Alternative on getting the skinCluster node
27pm.PyNode('pCube1').listHistory(type="skinCluster")
28
29# Determine if the verts are on boundary
30for vert in shapeNode.verts:
31    if vert.isOnBoundary():
32    doSomething()