Nuke to Standalone

hey guys.
it this question has poped up a few time so I’m going to make this short handy Guide on how to do this for A to Z.

1) How to genorate VRscene:

You can find the Translator in the V-ray Render node under the Translator tab. here you can export the 3D scene from nuke to a VRscene file be render in standalone.

  • first thing to mention is that VRscene would not export Readnode and nuke 2D nodes in to a vrscene file. you will need to precomp this and feed to a VrayTexBitmap
  • If you chosen to use nuke Readgeo over Vrayproxy bear in mind the vrscene Export will be slow becuse it need to compile this to a vrscene
  • Nuke partical are suported But vray nuke dosent support Point! you need to give them Faces (just plug in a nuke card)
  • V-ray nuke Dose not Export a animation to a single VRscene (yet) you will need to put FileName.####.vrscene

The best method of exporting a sequential VRscene is to Cread a Write node and in the file path put /Dir/export.####.null. this allows you to export the vrscene idear local render or on the farm. this also over comes any caching issues that you may face with the play button..

2) useful thing:
If want your exr to be multi channel you’ll need to add a post trans script to you vray render node.

from vray.utils import *

r = findByType("SettingsOutput")[0]
r.set("img_rawFile", 1)

exr= create("SettingsEXR", "vraySettingsEXR")
exr.set("compression", 3)
exr.set("bits_per_channel", 16)

just incase you want buckets you can adde this additional lines

region = findByType('SettingsRegionsGenerator')[0]
region.set('xc', 64)
region.set('yc', 64)
region.set('dynbuckets', 1)

SO what iff you want to change your GI setting well here is a nowhere example to do this.


lc=findByType("SettingsGI")[0]
lc.set("secondary_engine", 3)

settings=create("SettingsLightCache","settingsLightCache")
settings.set("subdivs", 500)

3) Rendering in Sequential VRscene

Well Vray standalone dosent support Sequential Vrscene rendering! you will need to build idear a loop script.

For Windows: here is some simpile .bat file code to get you started.

@echo off

setlocal EnableDelayedExpansion

for %%i in (“Z:\DIR\Shot\CG\Vrscene\*.vrscene") do (
    "C:\Program Files\ChaosGeoup\####2016\vray\bin\vray" -sceneFile="%%i" -display=0 -autoClose=1 -noFrameNumbers=1 -imgFile="Z:\DIR\Shot\CG\Vrscene\std_run.exr"

)

endlocal

Similar technic can be applied in linux as well.

i hope this helps

P.S. think you Georgi Zhekov for all the help :slight_smile:

Re-posting here for posterity:

I’m tinkering with kicking off the standalone renderer via Nuke’s “after frame render” callback. Attached is an example scene using above the tips to set up a dummy Write node that outputs to bnull, but as a post render callback launches Vray standalone with the info from the preceding VrayRenderer node and the Write node.
Here is the bit of code used in the prototype test:

import subprocess

def renderVRay(vrayExe = '/usr/local/ChaosGroup/V-Ray/Standalone_for_linux_x64/bin/linux_x64/gcc-4.4/vray'):
    sceneFile = nuke.thisNode().input(0)['trans_file_name'].getEvaluatedValue()
    output = os.path.splitext(nuke.filename(nuke.thisNode(), nuke.REPLACE))[0] + '.exr'
    args = [vrayExe]
    args.append('--sceneFile={0}'.format(sceneFile))
    args.append('--imgFile="{0}"'.format(output))
    args.append('--autoClose=1')
    stdOutDat, stdErrDat = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
    print stdOutDat
    print stdErrDat

Maybe we can build this into something more comprehensive (think custom UI for standalone options and post translate code)?!

Cheers,
frank
vrayStandaloneTest.zip (2.96 KB)

thanks dude you are a star. and I’m glad to see you can post here now

/me rubs eyes :shock:

Hey Frank. Good to read you! :slight_smile:

Haha, blast from the past, eh?
I feel at home now :slight_smile:

WOW not kidding, dude where you been

Update:

sequential rendering For Linux:

Render.sh

./VrayStandalone_script_linux.sh /DIR/export /DIR/output.exr

VrayStandalone_script_linux.sh

#!/bin/bash

for i in `ls ${1}/*.vrscene`; do
echo ${i}

	/usr/autodesk/maya2015-x64/vray/bin/vray -sceneFile="${i}" -display=0 -autoClose=1 -noFrameNumbers=1 -imgFile="${2}"
done