def get_stack_count(node):
"""Get the number of transforms in the stack.
:param node: Node to query.
:return: The number of transforms in the stack.
"""
connections = cmds.listConnections('{0}.message'.format(node), plugs=True) or []
count = 0
for connection in connections:
connected_node, attribute = connection.split('.')
if attribute == STACK_ATTRIBUTE:
count += 1
return count
评论列表
文章目录