Hi Enrico,

I've never used Vray but just found this web site
https://github.com/BigRoy/mayaVrayCommandDocs/wiki/vrend

>From the looks of it you may need to associate the default render layer.
Hope this helps.

import maya.cmds as mc
currentLayer = mc.editRenderLayerGlobals(q=1, currentRenderLayer=True)
mc.vrend("-camera", "persp", "-layer", currentLayer)



On Wed, Dec 14, 2016 at 3:08 PM, Enrico Losavio <[email protected]>
wrote:

> Hi David,
>
> thanks for your suggestion. I've just added your code, but yet nothing
> changed...
>
> I've also added this bit of code to set only one camera renderable (I had
> it in another test script, but forgot to add it to the snippet in the
> previous post).
>
> import maya.standalone
> maya.standalone.initialize()
>
> import maya.cmds as cmds
> import maya.mel as mel
>
> filepath = r"C:\test_prj\rnd_test.mb"
> cmds.file(filepath, open=True, force=True)
>
> cmds.workspace(r"C:\test_prj", openWorkspace=True)
>
> # set only one camera renderable
>
> render_cam_name = "render_cam"
> cam_ls = cmds.ls(type="camera")
> for cam in cam_ls:
>     cmds.setAttr('{0}.renderable'.format(cam), False)
> cmds.setAttr('{0}Shape.renderable'.format(render_cam_name), True)
>
> cmds.loadPlugin('vrayformaya')
> mel.eval("""setCurrentRenderer "vray" """)
>
> # the following functions were called one by one in different test files,
> here's just a recap
>
> cmds.batchRender() # Result: There is currently no render to cancel
> cmds.BatchRender() # no result
> cmds.render()      # renders just fine, but in MayaSoftware :(
> cmds.vrend()       # V-Ray error: Cannot get the object for the current
> render layer:
>
> But still cannot get it to work.
>
> Please let me know if you've any idea!
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/python_inside_maya/5cabf2d6-fc8f-403d-9805-
> 159839cebe1b%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/5cabf2d6-fc8f-403d-9805-159839cebe1b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*David Moulder*
Technical Animator / Artist
[email protected]
*Professional Profile <http://uk.linkedin.com/pub/david-moulder/1/b12/b5a>*

Mobile: +44 (0)7814033242
See who we know in common
<http://www.linkedin.com/e/wwk/5748982/?hs=false&tok=3tztwkse1silw1> Want a
signature like this?
<http://www.linkedin.com/e/sig/5748982/?hs=false&tok=3pwLU9-mBsilw1>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CABD4PkSWxnfDKqcFW5EGkTpc6QB%3DGx0NeK2w6OupbLJBDbHvrw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to