maya - Select objects with certain prefix in maya with Python
问题描述
I would like to select al objects with a certain prefix.
screenshot of outliner:
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 !
解决方案
Since the python commands work mostly like the mel commands it should work like this:
cmds.ls("PainterLight*")
推荐阅读
- google-apps-script - 从另一个谷歌工作表范围填充的下拉列表
- sql - 使用 WHERE 子句代替聚合函数的逻辑
- javascript - 尝试导入错误:“showErrorMessage”未从“../helpers/alerts”导出
- python - 如何漂亮地打印字典列表
- amazon-web-services - 如何在没有标准 ssh 的情况下将 AWS 实例连接到 GCP 实例
- node-red - 任何为什么在节点红色导入 api 可用
- c++ - Websocket++ 错误:handle_transport_init 收到错误:TLS 握手失败
- c++ - Shell Wrapper 处理/执行交互式命令管道 C++ UNIX
- ruby-on-rails - 转换为 Mongoid 会导致错误:无法加载数据库配置 - 没有这样的文件 - [config/database.yml]
- flutter - 在 VSCode 中调试 Flutter 应用程序时出错