Last active
March 27, 2020 20:10
-
-
Save mikebourbeauart/5bad6f89481849728717e24f4dfbedc6 to your computer and use it in GitHub Desktop.
Selects geometry transforms under current selection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Selects geometry transforms under a current selection""" | |
import maya.cmds as mc | |
# Get all mesh shapes under parent group | |
sel_shapes = mc.ls(selection=True, dagObjects=1, type='mesh') | |
# Get parent transforms from shapes (supports duplicate names, remove "path" if you want to raise an error on dup names) | |
geo_transforms = mc.listRelatives(sel_shapes, parent=True, path=True) | |
# Select geometry transforms | |
mc.select(geo_transforms, r=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment