Batch Camera Render 1.9.4.1

2010-03-26

Current Version:
1.9.4.1

Release Date:
28 April 2010

Download Script

This is a new description of the script. It will be updated everytime the new version comes out.

batchcamera_image1

The Idea

Very first idea to write such script came to me when I started to learn Houdini. Houdini has node architecture, and for the rendering it uses output nodes. These nodes have properties to specify included/excluded lights and objects, so you can create several output nodes and specify camera/lighting/objects relationship for each node. It's a great feature and you can implement same relationship in 3dsmax using batch render command with "scene states" where you can specify lighting options and "render preset" where you can specify rendering properties.

So what the problem with batch render? It lacks two features - you can not specify nonsequential frames and you can not specify new output file location for several cameras at once. So I've started to write this tool to replace standard batch render

How it works.

When you start this script it collects all cameras in scene and list them in the dialog box. To each of these cameras you can assign frame resolution, number of frames to render including nonsequential frames, output file location and many other options. This infomation is saved with the AppData method to the each camera object. Assigned properties can be changed for one or several selected cameras.

Main Features

Here is the list of options that could be assigned to each camera.

Image resolution. Resolution could be selected from the listbox or entered in the width and height spinners. Next to these spinners are placed two buttons to quickly double or halve the resolution. There are also two buttons to get and set resolution from/to Render Setup window.

Output file location. This property is split to folder path and file name so file and folder could be changed separetaly for selected cameras. In this section there is the Render Element subfolder option. Relative or absolute path could be used for the Render Elements. All the file/path properties support keyword syntax that will be described later.

Frame Range. Among the standard frame number options here is the Anim.Range option. With this option script calculates animated range of the selected camera and uses that range in rendering.

Scene State and Render Preset. This section contains only two dropdown list with scene states and render presets to assign to camera.

Vray options. For the Vray renderer script contains some global options and some options that could be assigned to camera. Global options duplicates the standard Vray Global and FrameBuffer options. Per-camera options are the Irradiance and Lightcache map files.

Light Assigmenent. In this section lighting state of the scene could be assigned to the camera. Lighting state could be set up by the scene states, but this section gives slightly different control. Section contains three lists: 'Solo Light' list contains lights that will be the only lights turned on during the rendering, 'Forced On' and 'Forced Off' lights are turned on or off respectively during the rendering.

All sections contains Clear button to delete section properties.

Some Other Features and Usabitility

Keyword syntax is one of the strongest part of the script. Special keywords can be used in all file and folder paths to include camera name, scene state name, date, resolution, scene file name and project folder name in that paths.

Here is the list of currently supported keywords:

  • %cameraname%
  • %scenestate%
  • %renderpreset%
  • %resolution%
  • %date%
  • %scenename%
  • %projectfolder%

Example usage:
path like that D:\Work\%projectname%\%date%\%cameraname%.jpg
produces D:\Work\SomeProject\2010-03-10\interior.jpg

All specified paths that don't exist at moment the rendering starts will be created autamatically. The "Create new paths silently" checkbox could be used to turn this feature on or off.

Network rendering is also automated - several netrender jobs can be sent with one click, bypassing Submit Network Job Assignement window.

Several buttons below the main camera list are given to make work with large list more comfortable.

All the properies are placed in several rollouts. Rollout state and window size and position is saving during the session. Upon the render starts checking is performed if render type is set to view - if render type set to region, blowup or something except view mode warning dialog box appears.

To save global properties across the 3dsmax sessions they are saved to BatchCameraRender.ini located in the %LOCALAPPDATA%/3dsmax/.../plugcfg/BatchCameraRender folder.

Macroscript is designed as standard dialog windows - toolbar button works as a switch, first click runs the script, the second closes the script.

Limitations and Warning

Some of the properties (if not all) doesn't pass very strict checking. For example if the Vray GI is turned off and in the script Irradiance Map map save file name is specified then the file wouldn't be saved.

I'm using this script every day and trying to make it stable but, anyway, it may contain some bugs. Use this script at your own risk.

Thanks

I would like to thank everyone who uses this script and helps me with suggestions and bugreports.

batchcamera_image2

comments

71 comments:

This script is just awesome! Any chance to have a dotnet version, for the x64 users? Or.. If you stick to activex... do you mind if we try to recreate your script in dotnet environment? Keep up the good work!

Andras

cecofuli

Hi,

I think this is a greate script, but in max 2009 64bit not work! I think it's a n ActiveX problem.

"Runtime error: Cannot create the ActiveX control "

Hi and thank you for good words. I didn't tested this script under x64, didn't think that there will be some problems... Sorry guys, will try to fix it.

to Andras Onodi: No, I don't mind, just let me know the results, please.

cecofuli

If I select "Frames" as a FrameRange, I've this error:

"Unable to convert : 2 to type: String"

In this line:

rendPickupFrames = temp_string1

cecofuli, I can't reproduce this error. Make sure you're using recent version. Try to delete Sergo Pogosyan-BatchCameraRender.mcr file in directory C:\\Users\\user\\AppData\Local\\Autodesk\\3dsmax\\2009 - 64bit\\enu\\UI\\usermacros and rerun downloaded script again. This should definitely install new version of script. Let me know if something goes wrong. Sergo.

Francesco Legrenzi

Error again. Try this:

  • new scene
  • 1 Plane, 1 Teapot 3 camera
  • Run the script
  • all default value
  • In the 1° camera change FrameRange to Frames
  • Write only 1
  • Render -> Error
  • Write 1,2
  • Render -> OK

This bug is reproducible.

Bye

cecofuli

Yes, there was a bug :) My fault, didn't test it thoroughly. Sorry and thank you for your help.

Now, here's new version. Test it, try it, hope there won't be any problems.

Петр

вопрос! При анимации как подгружать для каждой камеры карты ирмапу и лайткешь к примеру для просчета ГИ, может я чего не понял?

К сожалению этот скрипт не поддерживает подгрузку лайткешей и ирмап для отдельных камер. У меня не часто возникает в этом необходимость т.к. анимацией занимаюсь редко. Анимированые камеры в сцене держу только для статичных картинок, 5-10 кадров максимум.

На scriptspot-е куча скриптов, которые помогают автоматизировать рендеринг с помощью vray рендерера. VRay Batch Render, например.


P.S. Я старался сделать скрипт универсальным в плане рендереров и несложным в использовании, потому настраиваются только стандартные параметры.

taigajim

Hi, Great script! I've been waiting for something like this to replace the original batch render.

One suggestion, could it be possible to also control VRay raw image output, so that we can pack all Render Elements to one neat EXR file. That would make this script unstoppable!

RAW image, hm, didn't thought about it. It's interesting. I'll try to implement it.

Thank you for suggestion!

Hi, this is brilliant. I've been looking for something like this for so long! One thing though, personnally, I think the way the original batch render submits network render works better. I sometimes have 20-25 cameras and having to wait and click connect and edit the name, etc... can be quite tedious.

Perhaps there could be the option to send network renders in "watched" mode where you have to edit names or "automatic" mode where everything is submitted while I go and have a cup of tea! :) Many thanks for this great script though... Fabrice

Here's what I think to implement in new version of this script to solve the naming problem:

Maxscript gives almost full access to Batch Render functions, so I've decided to change the way this script is submitting render jobs.

Presently it submits jobs in simple cycle through all checked camera, one by one. This is why user should name network jobs one by one. I think it should be better if this script will be something like frontend for the max's standard Batch Render command.

Workflow will be something like that - when you hit render button in this script it creates render jobs for the max's Batch Render and submits network rendering through it. So naming network job problem will be gone, since this is what makes max's Batch Render so useful. And light state information could be passed by the dynamically created scene states.

It'll take some time, to implement this algorithm, but I think it makes whole workflow clearer and more familiar to max users.

Ideas and suggestions are welcome.

Hey, that sounds like it could work but, is it not possible to keep the render assignment within your script? I would personnaly find it more convivial not to have to switch to the native batch render... Perhaps it is more difficult to implement that way though... My Maxscript knowledge is VERY limited but I had a quick look at the maxscript help and it looks like there is access to all the network job submit and naming functions available... Also with the batch render route, would you be able to append light info onto an existing scene state dynamically, i guess that's a silly question... ;) Cheers Fabrice

Thank you for your comment, Fabrice.

There are functions to name network jobs in maxscript, but you have to be queue controller in order to submit jobs that way. In other words you can not submit your job if someone in your company network controls the backburner queue at the moment.

As for lighting info it will be harder to implement with standard batch render. I thought it could be accomplished by dynamic scene presets, but it won't be easy to combine dynamic scene presets and other scene presets since maxscript doesn't gives a way to save current preset.

Sergo.

hello, i want to save the cameras and settings of the script but there is no way :( even if i export the bat file, it doesn't work. help pls

Settings are saved in User Properties tab of Object Properties window, so they are saving with the camera objects. What do you mean by "bat files"?

Hello

Will this script work for 3dsmax 2008 32bits?

Cheers and thkx

Hi!

I didn't try on 2008, but with 2009 32bit it definitely works.

Let me know if it doesn't work with 2008.

Thank you. Sergo.

I get the following error when I run the script. ???

Welcome to MAXScript.

-- Error occurred during fileIn in <File:C:DownloadsBatch RenderBatchCameraRender 1.4.ms> >> MAXScript FileIn Exception: -- Syntax error: at dotNetControl, expected -- In line: button select_all "Select All" align:#left width:65 across:4 <<

Could you provide the steps to reproduce this error?

BTW, try to install new version - BatchCameraRender 1.5

We've implemented something quite similar at our studio. I started with batchrendermgr as well but found it too buggy.I recall there was no way to set the render preset via maxscript back in max8, both scene state/render preset properties affected the scenestate only! Have you ran into this problem as well? A collegue of mine then implemented our own batch render via .Net datagridview (excelish sheets) It has lots of other features as well and has really helped in our productions. Keep up the good work!

Thank you, Antti!

I don't use batchrendermgr in my script, and don't use render presets as well, so I didn't have such problems.

It is very interesting to see production ready script. Is it available somewhere?

Hi Sergo! Thanx for wonderful script and your enthusiasm! :)

One thing: is it be possible to implement an "incremental" numbering system on the output files? (similar to "save copy as" to save a max-file)

Thanx, mARTin

Hi Martin!

I don't really understand what kind of output files you are talking about. If you render animation your output files will be incremented automatically.

Do you mean incrementing output file names to not overwrite old rendered images?

And be sure you are using recent version, which 1.8. You're commenting on the old version.

Hi Sergo!

Thanx for your answer!

"Do you mean incrementing output file names to not overwrite old rendered images?" Yes! :)

i had the 1.8 Beta installed and now just tried the 1.8 fullrelease but couldn't manage to name the files automatically counting up (incremental).

Sorry for my bad english!

cu, mARTin

That's strange, Martin. I didn't think about such situation...

For example: You render ONE frame, then change something and render again, and you want to increment that new image file's name to not overwrite old one?

Please, give me more details or something such an example to help me understand your point. That may be interesting, but I didn't get the point yet.

you already hit the point, Sergo! :)

I work in architectural business and most in exteriors. And as you mentioned i render one single frame, change some settings and render it again. Then I compare them to each other! So my first rendering is CamA_01.jpg...the next is CamA_02.jpg...and so on. (It is very lame with naked MAX and VRay to name and rename my renderings, especially when working on several projects and always have to change "projectfile-path". Its much better with your script...but would be perfect when counting up on his own...) Do you understand me?

Its not a big problem...but when doing about 40-50 prerenderings per camera...

Thanx, mARTin

Ok, now I understand you :)

I think that may be accomplished by the additional keyword, "%num%" or something like that. Ok, I'll add this to the todo list.

Thank you, Martin!

Thank you, Sergo! Very looking forward to the next release! :)

Hi Sergo! One more thing i think about...and hope I'm not too annoying..! ;)

..what about the possibility to toggle/change VRay-Presets (RPS-files) in BatchCameraRender - is this possible?

mARTin

To be true I wrote this script to avoid render presets and scene states.

I added scene states eventually, so may be render presets also will be added. But not in near future, I think.

okay - thank you! :)

taigajim

Hi Sergo!

The script is getting better by every update.

One suggestion. It gets a bit complicated when you only want to output a VRay EXR file. File naming system only works if regular Max output is active and there's also nagging dialog if it's is disabled.

Some kind of running number for file versions would be great.

Thanks!

Thank you for the bugreport!

I'll check it. Currently I'm busy with some other job, but I'll update the script as soon as I can.

I already started to add vray irmap and lightcache support.

Hi Sergo! Great work - 1.9 beta!

...pleaze make my dream come true and implement %num% to the keyword Index, to count up the renderings incrementally - maybe in the 1.9 full release... :)

Thanx, mARTin

is this still support for max 9

Awesome script Sergo. Is there anyway to get the email notification to work for single renderings (non netrender)? The script does not seem to honor this if it's selected in the max render dialog.

gfa2, e-mail notification for local rendering works in my case - 3dsmax 2009 x64.

Hi Sergo! WOW - I just realized that you already implemented the Render-Presets! :) SUPER! Thanx! :)

Hi Martin!

I've been thinking about your %num% keyword. Will it be useful if this keyword will be assigned a number of render button pressings?

For example - you assign output file the "test %num%.jpg" filename and hit render button. For the first time you'll get "test 01 0001.jpg" file. When you render it again you'll get "test 02 0001.jpg" file and so on. Keyword simply counts how many times you hit the render button for the current scene. What do you think?

I didn't think about technical implementation yet, nor about how script counts render tries for each camera, but I suppose it is possible to implement somehow.

As for the keyword name %try_num% will make more sense, I think.

Hi Sergo! hm...I'm not sure if i understand right....so i try to show what would be perfect for me... :) I have some VRayCameras set in my scene. In your BCR i decide which Camera i wanna render now. I define a path and Filename for the first time. for example: .../Renderings/CamA_%num%.jpg I hit render. The program renders the picture and saves it as CamA_01.jpg Everytime i press render, the program renders the picture and saves it as the next available number...counting up - here the next would be CamA_02.jpg... This would beperfect for me! Duo you understand my idea and english? ;)

...(not sure if i understood you right..) if he counts up every time i hit render, maybe there are some numbers missing in the end, because i stop the rendering process...and next time i hit render he takes the next number...maybe this could lead to confusion..? Are the last four numbers in your suggested "test 01 0001.jpg" for movie-sequences?

themegaforce

I have one camera in my scene. In my animation, i want to render 3 parts of it. Maybe i'm wrong but batch camera render take my camera but i would want to duplicate it to prepare 3 render. Is-it possible?

Currently "one camera - one preset" configuration is the only option.

Nice script! Great time saver! I'd like to know if something like this would be possible. I usually use only One camera and use scene states to remmember it's position and properties. Would it be possible for script to read all my Scene states and create different outputs for the same camera but different scene states. I hope I make myself easy to understand on this. Thanks!

No, in current implementation you can not create different set up for one camera.

Just had a quick flipthrough, nice script.

One question/suggestion: Is there a possibility to save predefined settings?

Really nice script1 But i can not get the output size to work. I am running max 2010 64 bit. Is this is bug?

I used to use v1.8 and it works well on my max9. I tried to update to V1.92. But here comes a error message. Please check the url I provided above. Great script, I love it.

I delete the Sergo Pogosyan-BatchCameraRender.mcr and reinstall 1.8 then comes with another error message. Just for your reference. Regards, Maggie

Joost,
it works for me, under max2010 x64. Send me error messages by e-mail if they appear.

Maggie,
v1.9.2 is compatible with max2009 and higher. Currently I'm working on version that will work under max2008. I really can't test it with max9 but you can contact me by e-mail and I'll send you some tests to make it work under max9.

Hi Sergo, very nice script thanx. It was working flawlessly but now I dont know what happened, but is giving me lots of errors. Some of them are: "--Unknown property: "items" in undefined" or when I try to render "--No "getAppData" function for undefined"... and when I try to clear the settings "--No "setAppData" function for undefined".... It just on one file that this happens (it was working before), I've made a test scene with 3 cameras and its fine.

Please I need some help =)

Hi Shepard,

could you send me broken max file? I need only camera objects, so you can save-selected only cameras.

Hi again! I was all excited about the inclusion of IR/LC saving and loading paths. But it does not seem to work for me at all. Simple test. Create 2 cameras run script, specify Single Frame mode for iradiance and some output path. Close the script, reopen - messages popups : --Unknown property: "items" in undefined And then this line gets highlighted in the Listener temp_string = (irmap_mode.items[temp_string as integer])

Hope this can help to trouble shoot it. I'm on 2010SP1 64x VraySP4

Would be really great to be able to load specific irmaps/lc for each camera. This way I could load one single preset for all cameras, and the script would assign specific IR map to specific camera at render time.

Thanks!

I tried installing into max 2011 today. I run the ms file from Maxscript menu and restart 3dsmax. But I can't see any Sergo Pagosyan category anymore. Where is it?

Андрей

Добрый день. Было бы неплохо добавить в скрипт по умолчанию некий путь для камер с автонумерацией, чтобы не приходилось вводить его для каждой свежедобавленной камеры вручную. Или, если несколько камер уже как то обозначены, просто прибавлять следующую добавленную по тому же пути под следующим номером. Также скрипт не сбрасывается если отменить рендер, а продолжает следующую камеру.

Спасибо!

Параметры по умолчанию будут в ближайших версиях, а вот с отменой нескольких камер немного тяжело. Стандартный quick render не дает сигнала отмены.

Hi Sergo! Any news about the numbering index? %num%....?

Thanx, mARTin

No news, Martin, not yet. Working on some other scripts.

Доброго дня! Не увидел информации о том, как установить скрипт? И как его вывести в 3d max? Подскажите пожалуйста. Кидаю скрипт в папку Program Files\Autodesk\3ds Max 2009\Scripts\ запускаю через Run Script - вылетает на мгновение окошко и все. После этого я его не могу найти. Нужна инструкция. Спасибо.

Надо запустить скрипт из любой папки командой Run Script, затем надо открыть окно Customize User Interface, перейти во вкладку Toolbars. В списке Category найдите Sergo Pogosyan. Пониже есть еще один список, там должна быть строка с текстом "Render scene cameras и т.д. и т.п.". Вот эту строку нужно просто перетащить на тулбар.

is this a bug? i tried to save out render elements from 3 cameras and it only saves out the elements from the last 2 camera? never the first.

Hi is there any way to render out ONLY render elements? like Zdepth and Reflection (vray)

thanx again

I should do some tests to be sure it is not a bug but firstly make sure you've entered relative paths for the render elements.

No, it is not possible to render only render elements.

Hello, i've a problem, when i push button to select a ligh max crash(2009 and 2011) have ypu a solution?

When I open your script in a project, the scrip remember the camera setting(pixel,position etc.) it's possible to reset this setting?

Thank you

Just hit the Clear button in every section.

Hey! Great script. One suggestion. Possibly a feature to duplicate the job. I have just started using the script and it seems to me that I need to make a camera for the IrrMap prepass and then another to send the final frames. Being able to duplicate the job and then send it after the prepass finishes would be awesome. Sorry if someone suggested this already, but there were alot of posts and I didn't read them all.

Thanks so much for your contribution.

Hallo, Great script. In one project i recive an error, unable to convert:"undefinied" to type: bolean class....why?

Massimo, could you send me a camera from the failing scene? Just a camera, nothing else.

hi... great script... just started using 3ds max 2011 and loved the idea to have an script for batch rendering with vray many thanks again... have a question though... how do you assign a particular job to a particular render node... like if had 3 systems A, B & C... how can i submit a job to be rendered only on B would appreciate some help on that thanks cheers...

your e-mail will not be shown
(markdown supported)