PDA

View Full Version : Render Presets


DigitalNeutrinos
04-30-2008, 04:47 PM
First thanks to Dave Stewart www.davestewart.co.uk (http://www.davestewart.co.uk)
for most of the code.
But I work in radiosity and would love alittle help on button clicked and unclicks.
So someone would know what meshing size is clicked and have a choice to click different sizes.
I'm trying to dumb down the rendering process for some and reducing the confusion for others.

thanks
Greg


try(roRenderSizePresets);catch()
rollout roRenderSizePresets "You suck at Rendering ver.4-23-08" width:450 height:30
(



local presets =
#(
#("Letter box Test", 640, 346, 1),
#("Letter box Final", 2500, 1351, 1),
#("Portrait Test", 600, 800, 1),
#("Portrait Final", 1875, 2500, 1)

)

----------------------------------------------------------------------------------------------------
-- variables
----------------------------------------------------------------------------------------------------

local dockPosition = #cui_dock_top

local rWidth = 0
local rHeight = 0
local rFraction = 1
local rPAspect = 1
local rWindow


----------------------------------------------------------------------------------------------------
-- interface
----------------------------------------------------------------------------------------------------



dropdownList ddlPresets "" pos:[4,7] width:95 height:21 tooltip:"your ugly"
checkbutton btn1 "39 meshing" pos:[102,9] width:76 height:16 highlightColor:green
checkbutton btn2 "19 meshing" pos:[180,9] width:76 height:16 highlightColor:yellow
checkbutton btn3 "9 meshing" pos:[258,9] width:76 height:16 highlightColor:orange
checkbutton btn4 "4 meshing" pos:[336,9] width:76 height:16 highlightColor:red
checkbutton chk1 "?" pos:[415,9] width:16 height:16 toolTip:"Changes meshing size when a preset is clicked"




----------------------------------------------------------------------------------------------------
-- functions
----------------------------------------------------------------------------------------------------

function updateDialog =
(
if renderSceneDialog.isOpen() do renderSceneDialog.update()
)

function setRenderFraction fraction =
(
rFraction = fraction

renderWidth = rWidth * fraction
renderHeight = rHeight * fraction
renderPixelAspect = rPAspect

updateDialog()

if chk1.checked do
(
try(undisplay rWindow);catch()
rWindow = render()

)
)

function setRenderSize index =
(
local preset = presets[index]

rWidth = preset[2]
rHeight = preset[3]
rPAspect = preset[4]

setRenderFraction rFraction
updateDialog()
)

function loadPresets =
(
local arr = #()
for preset in presets do
(
append arr preset[1]
)
ddlPresets.items = arr
setRenderSize 1
)

function savePresets =
(
)

----------------------------------------------------------------------------------------------------
-- interface
----------------------------------------------------------------------------------------------------


on ddlPresets selected sel do setRenderSize sel

on btn1 changed theState do render (sceneRadiosity.radiosity.meshingSize=39.3)
on btn2 changed theState do render (sceneRadiosity.radiosity.meshingSize=19.6)
on btn3 changed theState do render (sceneRadiosity.radiosity.meshingSize=9.8)
on btn4 changed theState do render (sceneRadiosity.radiosity.meshingSize=4.5)




on roRenderSizePresets open do
(
-- load presets
loadPresets()
chk1.checked = false

-- dock
cui.RegisterDialogBar roRenderSizePresets style:#(#cui_dock_top, #cui_dock_bottom, #cui_floatable, #cui_handles)
cui.DockDialogBar roRenderSizePresets dockPosition


local mode = getCommandPanelTaskMode()
setCommandPanelTaskMode #utility
setCommandPanelTaskMode mode
)

on roRenderSizePresets close do savePresets()

)

-- create
createdialog roRenderSizePresets style:#(#style_titlebar, #style_border, #style_sysmenu)

CGTalk Moderation
04-30-2008, 04:47 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.