首页 > 解决方案 > Select objects with certain prefix in maya with Python

问题描述

I would like to select al objects with a certain prefix.

screenshot of outliner:

enter image description here

the only way I found is to select all lights , but I want only the lights with this prefix to append in my array.

What I have now : selectionLights = cmds.ls(type=['aiAreaLight']) lights.extend(selectionLights)

If someone can help me , would be amazing !

标签: maya

解决方案


Since the python commands work mostly like the mel commands it should work like this:

cmds.ls("PainterLight*")

推荐阅读