Skip to main content

pymel

pymel

General

TO DO

  • script to determine in maya if there is a difference between the skinculster one and off
# Get object based on name
obj = pm.PyNode('pCube1')
obj = pm.nt.Joint('joint1')
objects = pm.ls(['Object_A', 'Object_B'])

# Get objects selected
obj = pm.selected()

# Select all based on node type
obj_sel = pm.ls(type="displayLayer")

# Select all based on wildcard search
obj_sel = pm.ls("*_con") # wild card search
obj_sel = pm.ls("*Sphere*", type = "transform") # wild card search

# Get node based on nodetype
# connections method only work on the shape node
for node in obj.getShape().connections():
if node.nodeType() == 'skinCluster':
print (node.nodeType())
sc_node = node

# Alternative on getting the shape and actually any other connection depending on the index
pm.selected()[0].listHistory()[0]

# Alternative on getting the skinCluster node
pm.PyNode('pCube1').listHistory(type="skinCluster")

# Determine if the verts are on boundary
for vert in shapeNode.verts:
if vert.isOnBoundary():
doSomething()

Links