Notifications
Clear all

[Closed] makePreview

Hai Friends

I have accessed the Make Preview window in max using the command “max preview”

now i need to access the “preview Range ” and “Display in Preview”

but im unable to access this options through script

If any one knows kindly reply

Thankyou

9 Replies

posted in the wrong thread, sorry

There is no access to the settings in the Make Preview dialog, I am afraid
You can script your own preview system though – see the “How To …Create Quick Preview ” in the MAXScript Reference for a simple example and expand on top of it.

I am having the same problem. Thank you for your excellent how-to, Bobo. It helps alot but is there a way to setup the viewport size before rendering the preview so that the file has full or half of the original render size, for example ?

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

Yes, although it is a bit tricky.
Will see if I can write a short example right after I finish watching BS Galactica in an hour…

oh awesome ! That would be great ! I started on a small script that should make it easier to create previews and renders of animations with multiple cameras. I am fed up with all the repeated tasks of changing the camera, setting up the render / preview over and over. It would be nice if that can be automated in some way. But I have no idea how to change the viewport concerning the resolution. Maybe you can help me out… Thanks and have fun with the movie !

Here is what you need to know to extend your script:


 oldLayout = viewport.getLayout() --get the current layout
 viewport.setLayout #layout_1 --enlarge the current view
 cui.expertModeOn() --enable expert mode
 
 --define the graphic window's size from upper left corner using render size:
 gw.setPos 0 0 RenderWidth RenderHeight 
 max views redraw --redraw the view
 theBitmap = gw.getViewportDib() --grab the view bitmap
 sleep 1 --wait a sec (just so you can see what it looks like)
 
 cui.expertModeOff() --disable the expert mode
 viewport.setLayout oldLayout --restore the view layout
 display theBitmap --display the captured image
 format "Bitmap Size: % %
" theBitmap.width theBitmap.height --print the size as proof
 

Other than the built-in preview mode, the actual redraw will not happen in a centered window but in a portion of the current view defined by the region. Make sure the region is smaller than the actual viewport size…

Bobo, thank you very much for your answer. I tried it but when having formats like widescreen or formats where heights are much larger than widths then the grabs show some distortion. It seems the viewport is just scaled to fit into the given rectangle and not actually rendered that way.

Do you also experience this or is it just me ? If you do, do you know a workaround for that ?

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

Remember the viewport can only show pixel aspect ratio of 1.0. If your output size uses a non-1.0 pixel aspect, the preview might appear stretched.

Thanks for the reply

Through your discussions i’ll find a solution for my preview window

Thanks Bobo and Markus