简体   繁体   中英

Maya python (or MEL) select objects

I need select all objects in Maya with name "shd" and after that I need assigned to them specific material.

I don't know how to do that because when I wrote: select -r "shd"; it send me the message: More than one object matches name: shd //

So maybe I should select them one by one in some for loop or something. I am 3D artist so sorry for the lame question.

you have multiple meshes named shd, you will end with an error. You might want to use the command :

shd = cmds.ls('shd', long=True)
cmds.select(shd)

您可以使用select -r "shd*"来选择名称以 "shd" 表示的所有对象。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM