Isotropix Forums

cnode Args

Clarisse Scripting related topics

cnode Args

Unread postby ruchit » Fri Aug 17, 2018 1:24 pm

Hi folks,
I have made a project file with images & layers as below. I want to render using cnode command.
The problem is that although I can parse XML data from *.project file but i have no idea how to write cnode command to render all images & layers.

Example Scene:
>>>scene/image_002_L
|---Beauty
|---AO
|---Matte
>>>scene/image_002_R
|---Beauty
|---AO
|---Matte

Test Code:
Code: Select all
from subprocess import Popen, PIPE
import xml.etree.ElementTree as xml

cnode_executable = "C:/Program Files/Isotropix/Clarisse iFX 3.5 SP3/Clarisse/cnode"
projectFile = "../3D/amazon/maya/scenes/Lighting/SC_26_0105/SC_26_0105_v003_fwx.project"
cnode_xml_cmd = cnode_executable + ' ' + projectFile + '  -info'

subPipe = Popen(cnode_xml_cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
xmlString, error = subPipe.communicate()
print xmlString


Thank you
ruchit
 
Posts: 4
Joined: Sat Aug 11, 2018 9:13 am

Re: cnode Args

Unread postby bvaldes » Fri Aug 17, 2018 3:47 pm

Hi,

You should launch CNODE in a terminal or cmd with the -help argument to have the documentation of the command available.

In you case you have to use the -image and -outups arguments. By default CNODE will render all the images and layers that have the save_to_disk attribute checked and have an output path. To force CNode to render a specific image or layer, take a look to this example:
Code: Select all
cnode.exe my_project.project -image project://scene/image -output C:/the/path/to/render/filename_

With the code above, the project will render the image with the path project://scene/image to the location C:/the/path/to/render/. The name will be filename_###.ext depending on the project settings (#### will be replaced by the frame number).

If you want to render several images with this technique you can do like this:
Code: Select all
cnode.exe my_project.project -image project://scene/image project://scene/image2 project://scene/image.layer1 -output C:/the/path/to/render/filename_ C:/the/path/to/render/filename2_ C:/the/path/to/render/layer_result_

You have to specify the same number of output path than your images. The first image path correspond to the first output path and so on.

If you need more informations you can take a look to CNode documentation: https://www.clarissewiki.com/3.6/using_cnode.html

Best regards,
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 275
Joined: Mon Sep 26, 2016 10:44 am

Re: cnode Args

Unread postby ruchit » Fri Aug 17, 2018 7:39 pm

bvaldes wrote:By default CNODE will render all the images and layers that have the save_to_disk attribute checked and have an output path.

Really life saver, Actually i thought -image & -output flag must be included with cnode command.

And one more thing, cnode does not create folder if its not exists.
It return error like this
Code: Select all
ERROR: Objects with invalid output filepaths:
Object: 'project://SCENE/image_RENDER.sky': Target folder
'E:/testSky/Renders' does not exist.

Please check that:
- output paths exist and have write permission;
- "save_as" attributes of Images / 3D Layers are correct,
or override them with the command line parameter "-output".
ruchit
 
Posts: 4
Joined: Sat Aug 11, 2018 9:13 am

Re: cnode Args

Unread postby bvaldes » Mon Aug 20, 2018 7:57 am

Hi,

This is the normal behavior. This is the same in Clarisse, you have to create the output folder first. There is argument to do that, but if you use python to run CNode, you can create the folder with python (take a look to os.makedirs()).

Regards
Benoit VALDES
Isotropix
Clarisse QA
User avatar
bvaldes
 
Posts: 275
Joined: Mon Sep 26, 2016 10:44 am


Return to Scripting