Community
Maya Shading, Lighting and Rendering
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya materials topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Batch Sequencer using Arnold

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
Anonymous
2053 Views, 13 Replies

Batch Sequencer using Arnold

Hi guys, i'm trying to build a code to render a camera sequence. I need to use the flags to chance the cameras and frames.

In this example, I have two shorts: 410 to 415 (cam2) and 606 to 610 (cam4). I need to automate this process, we have some scenes and a lot of cameras to render.

Here's one I'm trying with no sucess:

 

Render -r arnold -s 410 -e 415 -cam cam2 -s 606 -e 610 -cam cam4 C:\Users\render\Desktop\project\scenes\TestScene.mb

 

How can I change cameras and shorts from Camera Sequencer with flags in Arnold? I`m using Maya 2018.

13 REPLIES 13
Message 2 of 14
ashley.handscomb.retallack
in reply to: Anonymous

Hi 

 

You can make a script that will loop over the cameras and frame sequences running render on each.

 

I've attached an example scene with python script and windows batch file for you to look at.

 

the key part is the python script

 

import maya.cmds as cmds

camera_list = {'cameraShape1':[1,50], 'cameraShape2':[51,100], 'cameraShape3':[101,150]}

for cam, frames in camera_list.items():
    print cam, "{}..{}".format(*frames)
    cmds.arnoldRender(b=True, cam=cam, seq="{}..{}".format(*frames))

This python has a dictionary for the list of cameras and their frame ranges

 

If you unzip the attached files and then cd to the folder in a command prompt you should be able to run the enclosed batch file multiple_cameras.bat

 

You may need to edit it to point to your installation of mayabatch (e.g. "C:\Program Files\Autodesk\Maya2018\bin\mayabatch.exe")

 

 

----

Ash



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 3 of 14
Anonymous

Hi Ashley! Thanks for your tips.

 

We`re not very familiar with this type of stuff, but we tried to follow your instructions and it didn`t work. Could you explain once again following a step-by-step process? Maybe this could help us even more.

 

Thanks for your time!

Message 4 of 14
ashley.handscomb.retallack
in reply to: Anonymous

Sure,

 

What errors if any are you seeing?

 

Here's a step by step guide:

 

1. unzip the zip archive somewhere.

 

2. open a command prompt and change to the directory that is unzipped: 

 

   cd C:\Users\render\Documents\multiple_cameras.zip

 

3. edit the multiple_cameras.bat file in notepad so mayabatch is the location of your mayabatch.exe e.g. C:\Program Files\Autodesk\Maya2018\bin\mayabatch.exe, so the full line in the batch file will look like:

    

"C:\Program Files\Autodesk\Maya2018\bin\mayabatch.exe" -file .\multiple_cameras.ma -command python(\"execfile('multiple_cameras.py')\")

 

4. run the batch file by running:

 

    multiple_cameras.bat

 

You should see a batch version of maya load the enclosed scene and then run the python file on it, rendering each camera, one after the other.

 

---

Ash

 

 

 



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 5 of 14
Anonymous

Actually, we didn't knew how, which and where to use the files that you posted. But this step-by-step helped a lot.

Just one more question: Where we insert the file location (scene.mb)? We have to paste this code into the scripts window?

Message 6 of 14
ashley.handscomb.retallack
in reply to: Anonymous

Hi,

 

Have you manged to run the example I have sent?

 

In order to use the same set up for your files, you can edit first the python script so it has the correct camera names, and the frame ranges that you want to set.

 

for example, if you have a camera called shot_01Shape with a frame range of 1-10, and another camera called shot_02Shape with a frame range of 11-20, you can edit the python script line for the camera_list like so:

 

camera_list = {'shot_01Shape':[1,10], 'shot_02Shape':[11,20]}

After you have edited this you will need to edit the batch file to point to your maya scene by replacing .\multiple_cameras.ma  with the path to your scene file e.g.: you can set the batch file to look like this, setting the maya project as well:

 

"C:\Program Files\Autodesk\Maya2018\bin\mayabatch.exe" -file C:\Users\render\Desktop\project\scenes\TestScene.mb -command python(\"execfile('multiple_cameras.py')\") -proj  C:\Users\render\Desktop\project

 

Then you can double-click on the multiple_cameras.bat file and it should run the render for you.

 

---

Ash



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 7 of 14
Anonymous

We did all the parts and it`s running, but this error shows up in prompt and the render stopped in the first frame forever:2017-11-24.png

Do you have any idea? I searched google but didn`t find useful tips

Message 8 of 14
ashley.handscomb.retallack
in reply to: Anonymous

Hi,

 

Are you able to copy the whole of the command prompt text to a text file and attach it to this thread?

 

Many thanks

 

Ash

 



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 9 of 14
Anonymous

Hello! I'm Olaveiras's co-worker, I'm sending you the command prompt.

Message 10 of 14
ashley.handscomb.retallack
in reply to: Anonymous

Hi, are you able to copy the output of the command to a text file?

If you add

> Output.txt 2>&1

To the end of the command it should print the output to a text file called Output.txt



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 11 of 14
Anonymous

Here`s the result:

 

Initialized VP2.0 renderer {
Version : 2016.11.35.12. Feature Level 5.
Adapter : NVIDIA Quadro K5000
Vendor ID: 4318. Device ID : 4538
Driver : nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um:9.18.13.3182.
API : DirectX V.11.
Max texture size : 16384 * 16384.
Max tex coords : 32
Shader versions supported (Vertex: 5, Geometry: 5, Pixel 5).
Active stereo support available : 0
GPU Memory Limit : 4096 MB.
CPU Memory Limit: 31059 MB.
MultiDraw consolidation attempted to enable, but the graphics device does not support it. MultiDraw will be disabled.
}
OpenCL evaluator is attempting to initialize OpenCL.
Detected 2 OpenCL Platforms:
0: NVIDIA Corporation. NVIDIA CUDA. OpenCL 1.1 CUDA 6.0.1.
Supported extensions: cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_d3d9_sharing cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll
1: NVIDIA Corporation. NVIDIA CUDA. OpenCL 1.1 CUDA 6.0.1.
Supported extensions: cl_khr_byte_addressable_store cl_khr_icd cl_khr_gl_sharing cl_nv_d3d9_sharing cl_nv_d3d10_sharing cl_khr_d3d10_sharing cl_nv_d3d11_sharing cl_nv_compiler_options cl_nv_device_attribute_query cl_nv_pragma_unroll
OpenCL evaluator choosing OpenCL platform NVIDIA Corporation.
Choosing OpenCL Device Quadro K5000. Device Type: GPU Device is available.

pymel.core : INFO : Updating pymel with pre-loaded plugins: invertShape, mayaHIK, GamePipeline, curveWarp, CloudImportExport, tiffFloatReader, MASH, poseInterpolator, bifrostvisplugin, ATFPlugin, hairPhysicalShader, ikSpringSolver, ik2Bsolver, xgenToolkit, AbcExport, retargeterNodes, gameFbxExporter, VectorRender, renderSetup, OpenEXRLoader, lookdevKit, Unfold3D, Type, fbxmaya
00:00:00 554MB WARNING | node "MayaMultiplyDivide" is already installed
00:00:00 554MB WARNING | node "MayaClamp" is already installed
00:00:00 554MB WARNING | node "MayaGammaCorrect" is already installed
00:00:00 554MB WARNING | node "MayaCondition" is already installed
00:00:00 554MB WARNING | node "MayaReverse" is already installed
Maya 2018 importing module pymel 1.0.10 (C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\pymel\__init__.py)
Warning: line 1: Unrecognized node type for node 'mentalrayItemsList'; preserving node information during this session.
Warning: line 1: Unrecognized node type for node 'mentalrayGlobals'; preserving node information during this session.
Warning: line 1: Unrecognized node type for node 'miDefaultOptions'; preserving node information during this session.
Warning: line 1: Unrecognized node type for node 'miDefaultFramebuffer'; preserving node information during this session.
Warning: line 1: Errors have occurred while reading this scene that may result in data loss.
File read in 3 seconds.
File read in 3 seconds.
Result: C:/Users/Labtime/Desktop/ANEELproject/scenes/GAcn2.mb
Manduca_Front 240..241
00:00:00 1005MB ERROR | [mtoa.translator] quadros_GEOShape | Mesh not exported, it has 0 shading groups.
00:00:00 1005MB ERROR | [mtoa.translator] cortina_corpo_GEOShape | Mesh not exported, it has 0 shading groups.
00:00:00 1005MB ERROR | [mtoa.translator] D_Veneziada_GEOShape | Mesh not exported, it has 0 shading groups.
00:00:00 1005MB ERROR | [mtoa.translator] D_Veneziada_GEO1Shape | Mesh not exported, it has 0 shading groups.
00:00:00 1005MB ERROR | [mtoa.translator] sofa_GEOShape | Mesh not exported, it has 0 shading groups.
libpng warning: iCCP: known incorrect sRGB profile

Message 12 of 14
ashley.handscomb.retallack
in reply to: Anonymous

Hi,

 

Are you sure it didn't work?

 

Can you retry with the Verbosity Level set to Warnings + Info in the render settings -> diagnostics tab.

 

--

Ash



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 13 of 14
Anonymous

Hi Ashely, we did it. The problem was the place we we`re running the code. This time, my colleague Nichiata used the code .py right into Maya, in python tab.

Thank you very much for all the help and time spent, we`re very grateful to you.

Message 14 of 14
ashley.handscomb.retallack
in reply to: Anonymous

Glad you got it working.

 

 

---

Ash



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums