Notifications
Clear all

[Closed] PLEASE help! Script to render JPG/PNG frames

Hello.

I have a city and for whatever reason I need to render it from the top view. The mesh of the city object is in square and I need to render each square from the top view and save the rendered image in whatever format but sequential numbering. I already did that manually but since I have to render about 500 squares, it would take so much time.

So I need a 3D Max script to do that automatically. But I don’t know how to write it. Then I decided to ask you professionals to help me.

Here in the image you may see what I want the script to do. It is nothing so special, I want to start rendering from one XYZ and then jump to another XYZ and do this repeatedly till it finishes rendering the last one.

3DS Max Automated Rendering Script Concept- Image

I thank you a lot if you help. Best.

4 Replies

first, you will have to create one camera, and work just with regions, because if you create n cameras for every sqare that you show, then you will not have one accurate render image.

Yeah, I meant one camera that moves like the orange pattern shown in the image.

I didn’t test it yet, but you could play with this code a bit


(
	local fnam = getFilenameFile rendOutputFilename
	local	outputPath = getFilenamePath rendOutputFilename
	local outputType = getFilenameType rendOutputFilename	
	rendSaveFile = true
	fn autren i j = 
	(
		rendOutputFilename = (outputPath + fnam + i as string + j as string  + outputType )
		max quick render
	)	
	
	for i = 1 to 4 do
	(
		for j= 1 to 4 do
		(
			autren i j
			$.pos.x+=650
		)
		$.pos.y+=650
	)
)	

create a free camera and place it on the left top corner, it should move right.
Select the camera first

1 Reply
(@d4n005h)
Joined: 10 months ago

Posts: 0

Thanks it worked but there is a bug there. Here is a debugged version. (the code below)


(
	local fnam = getFilenameFile rendOutputFilename
	local	outputPath = getFilenamePath rendOutputFilename
	local outputType = getFilenameType rendOutputFilename
    local num = 0;	
	rendSaveFile = true
	fn autren i j = 
	(
		rendOutputFilename = (outputPath + fnam + num as string + outputType )
		max quick render
		num += 1
	)	
	local posy = $.pos.y
	for i = 1 to 24 do
	(
		$.pos.y = posy
		for j= 1 to 21 do
		(
			autren i j
			$.pos.y+=50000.063
		)
		$.pos.x+=50000.001
	)
)	

To the all game developers, you can use the script above to make mini map of your city (GTA SanAndreas style).
You need to center a free cam and then make it Orthographic and then use the script. You need to modify it tho,