quick and dirty python script to change/add vray Object id's

Hi guys,

I’ve written a small python script to manage vray object ID attrs..
I’m not a good programmer so it’s probably full of things that can be improved, so feel free to edit as you wish.. I will improve it when I have time or feel the need but I cannot give (alot) support.. but don’t hesitate to post suggestions or wishes, can’t promise anything though, hope you’ll understand..
I only have maya 2011 so don’t know if it works in other versions..

NOTE:

- don’t change your selection and edit a number, because it will loop through the current selection, so if you change selection rerun the script.

planned todo’s:

- button or field to assign same id to selected objects at once.
- ability to give attr to procedure so you can use this for other Attr’s too.
- automatically make needed multi matte render elements..
hope it’s useful for someone!
vrayChangeAttr.py.zip (1.47 KB)

Cool, thanks for sharing :slight_smile:

Best regards,
Vlado

I keep getting a global name ‘cmds’ is not defined. I tried importing maya as cmds, and maya.cmds as cmds. I haven’t fiddled much with python, so I may be doing something wrong. I’m also on 2010, so perhaps it is a pymel version thing.

Looking at the script tho, it looks like they are all mel commands wrapped in a cmds.XXX Why not just release it as mel?

btw, this sounds great. Would love to get it working. thanks for the effort!

so sorry.. I have these procedures in a larger python file so I forgot to include these lines for you, just put them above the first def at the beginning of the line:

import maya.cmds as cmds
import maya.mel

def changeVrayAttr():

well I’m trying to stay off the mel, I like python much better, and as you can see I can us mel in python too :stuck_out_tongue_winking_eye:

thanks for the update. I’ll give it a try today.

Andrew