Notifications
Clear all

[Closed] Error rendering in a loop

I am trying to create a maxscript that reads camera positions from a csv file and with a loop render each position to a jpg file.

I am getting this error when I’m executing my script:

Runtime error: Unable to open renderer, possible recursion

Here is my script:

rows = (dotnetClass "System.IO.File").ReadAllLines "C:\\Users\\redse\\Desktop\\test.csv"
cam1 = freecamera()

for i = 2 to rows.count do 
(	
	row = (filterString rows[i] ",")
	print row
	move cam1 [row[1] as integer,row[2] as integer,row[3] as integer]
	rotate cam1 (angleaxis 90 [0,row[5] as integer,0])
	rotate cam1 (angleaxis 90 [row[4] as integer,0,0])
	rotate cam1 (angleaxis 0 [0,0,row[6] as integer])
	print cam1.pos

	pnRenderImage = "C:\\Users\\redse\\Desktop\\shelves\\" + i as string + ".jpg"
	print pnRenderImage
	rm = render camera:cam1 outputfile:pnRenderImage outputwidth:500 outputheight:500 quiet:true
	print rm
)

I tried executing with 3dsmaxbatch and 3dsmaxcmd but both are failing.

What am I doing wrong? All I wanna do is move camera to set positions and render from my scene.

3 Replies

pnRenderImage = “C:\Users\redse\Desktop\shelves\” + i as string + “.jpg” this line is rigth control of i as string
ı think

you remove rm = line and ı think rendered your file you did not need rm = render
you make only write this

render camera:cam1 outputfile:pnRenderImage outputwidth:500 outputheight:500 quiet:true

camera:cam1 this is problem ı found

render camera:$cam1 outputwidth:500 outputheight:500 quiet:true

sorry thats not the problem, changing from camera:cam1 to camera:$cam1 did not work