Notifications
Clear all

[Closed] How to render RenderElements with Script !?

My name is Pablo Bioni, I´m from Brazil, I´m a intermetiate level MaxScript programmer,
as I don´t find answer to my question, I wondered if you could help me.

Image a scene with 3 objects : 2 cameras named Cam_Left and Cam_Right, and a BOX
Those cameras shoots this box at different positions…
I´m trying to create a script that render each camera and then join side by side the image
from Cam_Left and Cam_Right to a Resultant image with the 2 * image width… In fact I have
already scripted a routine that do EXACTLY this… but I want to to the same to the render
elements (such as Alpha, Specular,etc…) of each camera… I just can´t access this !
Do you have a clue how to render renderelements through maxscript and save them ?

thank you a lot.
Pablo Bioni

7 Replies

Try having a look at the RenderElementMgr interface. There’s even a scripted example on how to set up a list of elements.

Hi !

Thank you for answering, but the problem isn´t setup… In fact, the setup code I have already done, so through my interface I´m able to Add and remove any renderelements… but using maxscript I´m still having problems to Render those renderelements… If I render through the max render interface button… everything is all right… But through the render() method those render elements aren´t processed or saved. This tutorial You said I have already read, but it doens´t help me… the problem isn´t setup… but access the render element like Specular for example.

Thank you a lot,
Pablo Bioni

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

Which Max version?

From MAXScript Reference 8.0:

[left][ renderElements:<bool> ]
[/left]
[left]NEW in 3ds Max 8: If true or not specified, if render elements are present in the scene, those render elements will be rendered. If the outputfile: argument is specified, the render element output will be written to disk in the same manner as if rendered from the Render Scene dialog with the Render Output filename specified. If false, render elements will not be rendered.

[/left]
[left][ renderElementBitmaps:<&var> ]
[/left]
[left]NEW in 3ds Max 8: If render elements are rendered, the render element output bitmaps are placed in an array (one array element per rendered render element), and this array is returned through the specified variable by-reference. If multiple frames are rendered, the final frame’s output is used.

[/left]
[left]For Example:

[/left]
[left]render renderMultiPassEffects:true renderElements:true renderElementBitmaps:&reb
[/left]
[left]if reb != undefined do for b in reb do display b
[/left]

Ditto. Mismo. What he said. Same problem, exactly.

max7.x
I found renderElements: on the web after posting, but wondered why it wasn’t working. Didn’t realize it was an 8-only feature. OK, OK, guess it’s time to make the donuts, er, migrate the plugins over to 8.

Many thanks Bobo!

how do you join the two images together after rendering?

I would like to join 720 single frames with a width of 1 pixel each to one single image with a width of 720 pixel. How did you do it bioni?

Thank you very much
cj1

EDIT: max 7.0

hi all
iam working on the same thing .
i had written a script which has 2 camera and it renders using render command the frames …and saving the images into a file per frame
and per render element wise like Z-depth ,alpha, diffusein separate folders …
problem
1.while embedding the script into max file , when file opens it start rendering …but the problem is it won’t save the render element images per frame…in
folder its only over writting single image…not per frame as we had given the path from max render UI
2.how can we do the same from script.ie. can we make render global images to be per frame.
thanks …
akesh