Batch Camera Render 1.9.4.1

2010-03-26

Текущая версия:
1.9.4.1

Дата выхода:
28 Апреля 2010

Скачать скрипт

Это новое описание, которое будет обновлятся по мере выхода новых версий.

batchcamera_image1

Идея

Впервые идея создания этого скрипта пришла мне когда я стал изучать Houdini. В этой программе вся работа построенна на нодах и для рендеринга тоже используется определенные ноды, Output Node. Кроме того, что в ноде содержатся обычные параметры такие как разрешение кадра, тут же можно указать какие источники света и объекты будут просчитаны (или включены во время просчета). Мне показалось это очень удобным. Похожую функциональность можно реализовать в максе с помощь Batch Render-а, указав для каждой задачи свои Scene State-ы и Render Preset-ы.

Но у Batch Render есть недостатки - в нем невозможно изменить свойства для нескольких заданий и невозможно указать непоследовательные кадры для просчета. Тут я и решил написать свой скрипт, заменитель Batch Render.

Принцип работы

При запуске скрипт юююю список все камеры сцены. Каждой камере можно назначить разрешение кадра, номера и последовательности кадров, путь файла для просчета и некоторые другие свойства. Все свойства можно менять для нескольких камер одновременно. Информация записывается в с помощью метода AppData в объект камеры.

Основные возможности

Список параметров которые назначаются камерам.

Разрешение кадра. Разрешение можно выбрать из списка или задать другое с помощье полей Width и Height. Тут же расположены кнопки для быстрого удвоения/уполовинивания разрешения и кнопка для получения/установки разрешения из/в максовское окно Render Setup.

Путь и имя файла. Этот параметр задается двумя полями - путем к файлу и имени файла. Таким образом можно для нескольких камер одновременно поменять только имя файла или путь. В этом же разделе задается путь к Render Element-ам. Путь к элементам может быть абсолютный или относительный. Все параметры для указания путей поддерживают ключевые слова, о которых будет сказано ниже.

Номера кадров. Кроме обычных режимов задания номеров кадров в этом разделе можно указать режим Anim.Range. В этом режиме будет использован весь диапазон анимации камеры.

Параметры Vray. В этом разделе собраны параметры для Vray. Глобальные параметры устанавляваются для всех камер, параметры Ir Map и Lightcache устанавляваются для каждой камеры. Все параметры аналогичны параметрам в стандартном окне Render Setup.

Light Assigmenent. С помощью это раздела можно назначать камере включеные/выключеные источники света. Раздел содержит три списка: светильники из раздела 'Solo Light' будут единственными включеными источниками света, светильники из раздела 'Forced On' будут включены в любом случае, а из 'Forced Off' соответственно выключены.

Все разделы содержат кнопку Clear, с помощью которой можно удалять назначеные свойства.

Дополнительные возможности и юзабельность

Поддержка ключевых слов это самая сильная сторона скрипта. Ключевые слова позволяют вставлять в поля для ввода путей и имен файлов различную информацию о текущей камере. В текущей версии поддерживаются следующие ключевые слова:

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

Пример использования:
из строки D:\Work\%projectname%\%date%\%cameraname%.jpg
получится D:\Work\SomeProject\2010-03-10\interior.jpg

При включенном флажке "Create new paths silently" несуществующие пути будут созданы автоматически.

Назначение на сетевой рендеринг тоже автоматизированно - можно выделить несколько камер на просчет и поставить их на сетевой просчет одним нажатием, без указания имени задания в окне "Submit Network Job Assignement".

Кнопки, расположенные под списком, предназначены для упрощения работы с большим количеством камер.

Все параметры скрипта расположены по соответствующим свиткам. Состояние свитков запоминается в текущей сессии макса. Также сохраняется положение и размер окна скрипта. Глобальные параметры хранятся в INI файле, в папке %LOCALAPPDATA%/3dsmax/.../plugcfg/BatchCameraRender

Ограничения и предостережения

Не все параметры скрипта проходят строгую проверку. Например если в Vray задать файл для сохранения Ir карты, но при этом GI в Vray не включен, карта, естественно, не сохранится. Но возможность установить ее всегда есть. Так же не проверяется доступность карт для загрузки. В общем, будьте внимательны к параметрам.

Я и еще несколько человек в нашей компании использует этот скрипт каждый день. Я все время стараюсь сделать его более стабильным, надежным, но баги все равно время от времени появляются, так что, будьте внимательны при использовании скрипта в производстве и используйте его на свой риск.

Благодарность

Хочу выразить благодарность всем пользователям этого скрипта, всем кто помогает советами и выловлеными багами. Спасибо!

batchcamera_image2

комментарии

71 шт.:

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...

Этот адрес не будет нигде показан.
(поддерживается markdown)