Creating maya v-ray attributes with mel.eval() unnecessary?

106 views
Skip to first unread message

Roy Nieterau

unread,
Nov 16, 2013, 4:44:24 PM11/16/13
to python_in...@googlegroups.com
Hey everyone,

So I've seen it happening everywhere, the good old:

import maya.mel as mel

mel
.eval("vray addAttributesFromGroup \"" + shape + "\" vray_subdivision 1")

Even though it is possible to do:
import maya.cmds as mc

mc
.vray("addAttributesFromGroup", shape, "vray_subdivision", 1)

Is there a particular reason why everyone is using mel.eval() or isn't anybody in the industry aware that this was possible? ;)

I've seen it happen so many times that I wanted to spread the word, actually I'm starting here!
Of course I'm hoping that someone corrects me if there's a particular reason that everyone kept with mel.eval().

In the meantime I've been building a repository and wiki to accompany the v-ray for maya commands.
It's still a quick draft containing only a brief overview and short code snippets, so you should consider it a work-in-progress!

Here is the repository:
https://github.com/BigRoy/mayaVrayCommandDocs

This is the wiki:
https://github.com/BigRoy/mayaVrayCommandDocs/wiki

And here's my addAttributesFromGroup documentation for now:
https://github.com/BigRoy/mayaVrayCommandDocs/wiki/vray-addAttributesFromGroup

Tips are welcome and I hope it could even become a community effort to work on some clear instructions/documentation for working with V-ray for Maya through code.
Because Chaosgroup is really leaving the documentation out for the functions. :(

There's also a v-ray framebuffer fix script in the repository. Maybe useful for those people that still have it happening from time to time.

Hope you learned something here.

-Roy Nieterau


Justin Israel

unread,
Nov 16, 2013, 6:53:25 PM11/16/13
to python_in...@googlegroups.com
I just figured it was either people knew you could access them from the cmds module, or they didn't. Probably not any intentional reason to avoid it. 
I've added your Wiki link to the Sticky
Reply all
Reply to author
Forward
0 new messages