getting all objects affected by a given object

20 views
Skip to first unread message

fruit...@gmail.com

unread,
Apr 12, 2019, 3:11:10 PM4/12/19
to Python Programming for Autodesk Maya
Hi,
I was wondering if there is a way to get maya objects affected by a given object ?

When you select something in the viewport, everything affected by your selection will be displayed in wireframe purple. Is there a command to get this result ? (something like obj1.isAffectedBy(obj2) returning a bool)
The only way I see to do it would be to do some recursive function but I'm not sure how reliable it'd be (e.g. a constraint would be- connected on both source/destination to the same network)

Thank you !

Marcus Ottosson

unread,
Apr 13, 2019, 3:17:55 AM4/13/19
to python_in...@googlegroups.com

Hey Vincent, have a look at the cmds.listHistory command.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/97b68173-6c69-42da-81df-2a5345afd0b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

fruit...@gmail.com

unread,
Apr 13, 2019, 2:59:55 PM4/13/19
to Python Programming for Autodesk Maya
hi Marcus,

I initially started with listHistory, which works fine in 99.99% of the situations, but in some complex situations I don't get accurate results (just like sometimes maya fail in setting correctly the purple wireframe), no matter which flags I use.
I just wanted to make sure I wasn't missing something obvious, but I'll keep searching. Out of curiosity, any idea how maya is doing it internally ? A regular graph parsing ?
Reply all
Reply to author
Forward
0 new messages