createPreview batch style

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 03 March 2013   #1
createPreview batch style

Trying to create a tool that batch renders viewport previews. The problem is that Media Player opens and locks the _scene.avi temp file. If I turn off the AutoPlayPreview in the INI file it still pops up. If you manually change the options in preferences, it works. So, a couple of questions.

1. Is there a way to specify the _scene.avi name before rendering?

Or

2. Is there a way to "refresh" the preferences after changing the INI file?

An offline solution is to ask the user to change the preference before rendering. But I don't like asking the user to do anything, because they don't usually do it right.

Thanks in advance!

Code:
setINISetting (getMAXIniFile()) "Performance" "AutoPlayPreview" "0" createPreview outputAVI:true percentSize:100 \ start:animationRange.start.frame end:(animationRange.end.frame) skip:1 fps:framerate \ dspGeometry:true dspShapes:false dspLights:false \ dspCameras:false dspHelpers:false dspParticles:false dspBones:false \ dspGrid:false dspSafeFrame:true dspFrameNums:true dspBkg:false
__________________
Juan Martinez | Blog | Animator
 
Old 03 March 2013   #2
Any news on this?

I would also like to create a preview via maxscript. Because i use always the same settings. So i like to just click on a button to create a new preview...
 
Old 03 March 2013   #3
No, my best solution is to ask the user to turn it off.
__________________
Juan Martinez | Blog | Animator
 
Old 03 March 2013   #4
Code:
fn toggleAutoPlayPreview = ( fn PreferenceCallback = ( fn setCheckBoxState hwnd state = ( local BN_CLICKED = 0 local BM_SETCHECK = 241 local WM_COMMAND = 273 local parent = UIAccessor.getParentWindow hwnd local id = UIAccessor.getWindowResourceID hwnd windows.sendMessage hwnd BM_SETCHECK (if state then 1 else 0) 0 windows.sendMessage parent WM_COMMAND ((bit.shift BN_CLICKED 16) + id) hwnd ok ) hWND = DialogMonitorOPS.GetWindowHandle() if (UIAccessor.GetWindowText hWND) != "Preference Settings" do return true bt = windows.getchildhwnd hWND "AutoPlay Preview File" act = (getIniSetting (getMAXIniFile()) #Performance #AutoPlayPreview) as integer setCheckBoxState bt[1] (act == 0) UIAccessor.SendMessageID hWND #IDOK true ) DialogMonitorOPS.RegisterNotification PreferenceCallback id:#preferencesConfigure DialogMonitorOPS.Enabled = true max file preferences DialogMonitorOPS.unRegisterNotification id:#preferencesConfigure DialogMonitorOPS.Enabled = false (getIniSetting (getMAXIniFile()) #Performance #AutoPlayPreview) as integer ) toggleAutoPlayPreview()
 
Old 03 March 2013   #5
You sir are a hero of heroes! I will study this.
__________________
Juan Martinez | Blog | Animator
 
Old 03 March 2013   #6
here is probably more correct function that sets (not toggles) the AutoPlayPreview mode:
Code:
fn setAutoPlayPreview state enabled:off = ( state = if state then 1 else 0 local prev fn PreferenceCallback &state:&state &prev:&prev = ( fn getCheckBoxState hwnd = ( local BM_GETCHECK = 240 windows.sendMessage hwnd BM_GETCHECK 0 0 ) fn setCheckBoxState hwnd act = ( local BN_CLICKED = 0 local BM_SETCHECK = 241 local WM_COMMAND = 273 local parent = UIAccessor.getParentWindow hwnd local id = UIAccessor.getWindowResourceID hwnd windows.sendMessage hwnd BM_SETCHECK act 0 windows.sendMessage parent WM_COMMAND ((bit.shift BN_CLICKED 16) + id) hwnd act ) hWND = DialogMonitorOPS.GetWindowHandle() if (UIAccessor.GetWindowText hWND) == "Preference Settings" do ( if (bt = windows.getchildhwnd hWND "AutoPlay Preview File") != undefined do ( if (prev = getCheckBoxState bt[1]) != state do state = setCheckBoxState bt[1] state ) UIAccessor.SendMessageID hWND #IDOK ) true ) DialogMonitorOPS.RegisterNotification PreferenceCallback id:#preferencesConfigure DialogMonitorOPS.Enabled = true max file preferences DialogMonitorOPS.unRegisterNotification id:#preferencesConfigure DialogMonitorOPS.Enabled = enabled prev == 1 ) /* setAutoPlayPreview on enabled:DialogMonitorOPS.Enabled setAutoPlayPreview off enabled:DialogMonitorOPS.Enabled */


the function returns the previous state of AutoPlayPreview.
 
Old 03 March 2013   #7
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 01:56 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.