BroTools Snippets #02 – Select joints influencing mesh

Saving another couple of clicks in routine work, simple script to select joints influencing skinned mesh. Could not find a 1-click solution for this in Maya. Maybe I just missed something? Anyway, maybe this will be useful for someone. Will just leave it here. Simple, but useful.

It will select joints influencing all shapes of all selected objects.

In a form that can be used in a shelf:

import maya.cmds as cmds
def selectInfluenceJoints (meshes=None):
    if meshes == None:
        meshes = cmds.ls(sl=1)
    if not isinstance(meshes, list):
        meshes = [meshes]
    cmds.select (cl=True)

    for mesh in meshes:
        shapes = cmds.listRelatives(mesh, c=True, s=True)
        for shape in shapes:
            sk = cmds.listConnections(shape, et=True, t='skinCluster')
            if sk != None:
                for s in sk:
                    influences = cmds.skinCluster (s, q=True, inf=True)
                    cmds.select (influences, add=True)
selectInfluenceJoints()

*”BroTools Snippets” section of the blog is about different small parts of my collection of Maya tools and scripts. It is a relatively big Python project, all tools integrate into Maya’s top menu into a new section for ease of use. Tools range from small handy scripts to large auto-rigging and simulation systems, like BroDynamics and BroRig.

BroTools Snippets #01

Time to start sharing what little tools and scripts I use in everyday life.

Here’s a multi-exporter I wrote for current project to speed up and stream-line animation exporting process, nothing fancy. It is used to export multiple animated game characters and objects. Responsive object selection list is probably the most fun thing, which inspired me to write another tool, which I will show in the next post.

brotools_multiexporter

*”BroTools Snippets” section of the blog is about different small parts of my collection of Maya tools and scripts. It is a relatively big Python project, all tools integrate into Maya’s top menu into a new section for ease of use. Tools range from small handy scripts to large auto-rigging and simulation systems, like BroDynamics and BroRig.

Random animation #01

 

 

Starting some new ‘sections’ of my blog. Under Random animation I will just post some little practice or personal or non-NDA animations I’m working on.

*”Random animation” section of the blog is about different small animations I’m working on, either in my free time or my current work, if I’m allowed to share it.