Notifications
Clear all

[Closed] Render Help

Hi,

cams = #($Camera01,$Camera02,Camera03,Camera04)
for i=1 to 5 do
(
r = render camera:cams[i] fromframe:1 toframe:20 outputwidth:170 outputheight:120
r.filename = cams[i]
save r
)

I am new to Max.I want to render my scene with .swft format with 5 cameras.i wrote one script for this i dono whts wrong here. Anybody can help pleaseeeee…

Thanks.

6 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

First, you have an array of four cameras, but the last two are missing the $ to denote a scene node.
Then you have a loop from 1 to FIVE, but you have FOUR cameras.
Then you render into a MAXScript bitmap r, but it cannot contain a SWF file. I am not even sure how well the render() method in MAXScript deals with SWFs. What you did would work with bitmap files like .TGA, .RPF, .EXR etc. You might want to try supplying the file name to the render() method instead using the outputfile: keyword.

Your file name wouldn’t work because a camera node cannot be a file name. You can use the NAME of the camera to build some file name though…

Also, you don’t need the i index, so you could say

for aCamera in cams do
(
r = render camera:aCamera fromframe:1 toframe:20 outputwidth:170 outputheight:120 \ outputfile:(GetDir #image + “\” + aCamera.name + “_.swf”)
)

Yah, Thanks for this help.

i modified my script like this but it showing one Error.i want all cameras output with camera name as a file name and with .swft format(I have this plug-in)

cams = #($Camera01,$Camera02,$Camera03,$Camera04)
for aCamera in cams do
(
r = render camera:aCamera fromframe:1 toframe:20 outputwidth:170 outputheight:120
outputfile:(GetDir #image + “\” + aCamera.name + “_.swft”)
)

1 Reply
(@rustyknight)
Joined: 11 months ago

Posts: 0
     outputfile:([b](GetDir #image)[/b] + "\\" + aCamera.name + "_.swft")

There may be other problems, but that one jumps out at me…

Shane

Thanks.

This is the final script:

cams = #($Camera01,$Camera02,$Camera03,$Camera04)
for aCamera in cams do
(
r = render camera:aCamera fromframe:1 toframe:20 outputwidth:170 outputheight:120
outputfile:((GetDir #image) + “\” + aCamera.name + “_.swft”)
)

But when i run this scrip.It showing this Error.Whts wrong here.

– Syntax error: at keyword parameter, expected <factor>
– In line: outputfile:(

1 Reply
(@rustyknight)
Joined: 11 months ago

Posts: 0

This is probably a bit silly and it is a little hard to tell…until you paste into a proper text editor/the maxscript editor, but

r = render camera:aCamera fromframe:1 toframe:20 outputwidth:170 outputheight:120

This line ends with a newline…which seperates the next line from the current command…

Now if that doesn’t make sense, that’s okay, basically, the output: parameter MUST be on the same line…so, go back to you editor, jump to the start of “output” and press back space to move the parameter back onto the same line as the render command…should be okay then…at least it worked for me…

r = render camera:aCamera fromframe:1 toframe:20 outputwidth:170 outputheight:120 outputfile:((GetDir #image) + "\\" + aCamera.name + "_.swft")

Shane

oohhhhhh…

Yah,Its working but, it going to default “scenes” folder with file name “untitled.swft” and every time it replacing the existing one(not creating with cameras name).How to solve this ?

Thanks.