Announcement

Collapse
No announcement yet.

Launching VRay RT from an Scripted Button (Python)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Launching VRay RT from an Scripted Button (Python)

    [Maya 2012 64Bits, V-Ray for Maya 2.0 Beta 2, Windows7 64Bits]
    How can I launch VRay RT from a button? Its always return an error:

    Code:
    # Error: TypeError: file C:\Program Files\Autodesk\Maya2012\Python\lib\site-packages\maya\app\commands.py line 17: Object  is invalid #
    Here is the code with several tries:

    Code:
    import maya.cmds as cmds
    
    def launchRTRender(*args):
        print "launchRTRender"
        
        cmds.eval ("renderIntoNewWindow iprRender;") #Try 1
        
        #cmds.eval ("RedoPreviousIPR;") #Try 2
        
        #comrt = 'vrayStartIprRender "%s" %d %d "%s"' % ('renderView', 640, 480, "persp" ) #Try 3
        #cmds.eval (comrt) #Try 3
        
        #cmds.showWindow('MayaWindow') #Try 4
        #cmds.setParent('MayaWindow') #Try 4
        #cmds.eval ("IPRRenderIntoNewWindow;") #Try 4
        
    cmds.window()
    cmds.columnLayout()
    cmds.button(label='RT Render', c=launchRTRender)
    cmds.showWindow()
    Thanks!!!!

  • #2
    Hi,

    IPRRenderIntoNewWindow is a mel function, so you need to use maya.mel.eval("IPRRenderIntoNewWindow;") instead of maya.cmds.eval("...").
    I've tried it an it works like a charm.

    /Teodor
    V-Ray developer

    Comment


    • #3
      Thanks!! Works perfectly!!

      Comment

      Working...
      X