MAXScript Tools and Interaction with 3ds Max > Interacting with the 3ds Max User Interface > Render Scene Dialog >

# Rendered Frame Window and MAXScript

| Lighting And Rendering - Quick Navigation

The Rendered Frame Window (a.k.a. Virtual Frame Buffer or VFB) provides Iterative and Production rendering workflows in 3ds Max 2009 and higher.

The renderer-specific extensions have been implemented using MAXScript.This means that the controls exposed to the top and bottom panel of the Rendered Frame Window can be enhanced or replaced by technical artists and technical directors to facilitate various workflows and 3 rd party renderers using only MAXScript.

The following MAXScript additions provide ways to access the Rendered Frame Window and its properties and register new rollouts in its panels:

Image Viewer DisplayNotifications

Two new notifications have been added to the General Event Callbacks mechanism: #preImageViewerDisplay and #postImageViewerDisplay

They are broadcast before and after the Rendered Frame Windows has been opened.

Interface:IVFB

The callbacks.notificationParam() method, if executed within the callback script, will return an IVFB Interface which provides the properties and methods exposed by the Rendered Frame Window.

EXAMPLE
The following example REMOVES the original callbacks defined in the file ..\StdPlugs\StdScripts\VFB_Methods.ms and defines new rollouts for the rollout panels. In order to restore the original functionality, evaluate the callbacks.removeScripts #preImageViewerDisplay then run the above-mentioned script to register the original callbacks. Alternatively, simply restart 3ds Max.
    (
    global MyFirstVFBLayout --the function needs to be global
    fn MyFirstVFBLayout VFB_Interface = ( --will be called by the callback --if the window is a Rendered Frame Window,
    if VFB_Interface.IsFramebuffer do (
    --set all borders to 0 to save screen estate
    VFB_Interface.SetMetric #horzMarginLeft 0
    VFB_Interface.SetMetric #horzMarginCenter 0
    VFB_Interface.SetMetric #horzMarginRight 0
    VFB_Interface.SetMetric #vertMarginTop 0
    VFB_Interface.SetMetric #vertMarginCenter 0
    VFB_Interface.SetMetric #vertMarginBottom 0
    VFB_Interface.SetMetric #minClientWidth 320
    VFB_Interface.SetMetric #minClientHeight 240
    --Definesome stand-in rollouts to display in the three panels:
    rollout theTopLeftRollout "Top Left Rollout" width:200 height:45 (
    dropdownlist ddl_topLeft items:#("View","Region","Crop") width:160
    button btn_topLeft "Top Left Button" width:160 )
    rollout theTopRightRollout "Top Right Rollout" width:200 height:50(
    button btn_topLeft"Top Right Button...")
    rollout theBottomRollout "Bottom Rollout" width:200 height:22(
    button btn_bottomButton "Bottom Button (Try to say 3 times fast!)"
    )
    --Initialize the top left panel to a size and --get its RolloutFloater value back:
    theTopLeftFloater = VFB_Interface.InitRolloutWindow #TopLeft 200 60
    --Add the rollout to the RolloutFloater without borders and tile bar:
    addRollout theTopLeftRollout theTopLeftFloater border:false
    --and enable the visibility of the top left panel:
    VFB_Interface.SetRolloutWindowVisible #TopLeft true
    --Initialize the top right panel to a size and --get its RolloutFloater value back:
    theTopRightFloater = VFB_Interface.InitRolloutWindow #TopRight 200 60
    --add the rollout to the RolloutFloater WITH borders and tile bar:
    addRollout theTopRightRollout theTopRightFloater border:true
    --and enable the visibility of the top left panel:
    VFB_Interface.SetRolloutWindowVisible #TopRight true
    --Initialize the bottom panel to a size and --get its RolloutFloater value back:
    theBottomFloater = VFB_Interface.InitRolloutWindow #Bottom 400 35
    --add the rollout to the RolloutFloater without borders and tile bar:
    addRollout theBottomRollout theBottomFloater border:false
    --and enable the visibility of the top left panel:
    VFB_Interface.SetRolloutWindowVisible #Bottom true
    VFB_Interface.InitLayout() --finally, initialize the new layout
    )--end if
    )--end fn --unregister any related callbacks:
    callbacks.removeScripts #preImageViewerDisplay
    --register a pre-image viewer display callback
    callbacks.addScript #preImageViewerDisplay "MyFirstVFBLayout (callbacks.notificationParam())" id:#ResizeVFBPanels
    )--end script