CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-21-2013, 01:42 AM   #1
martinez
Expert
 
martinez's Avatar
portfolio
Juan Martinez
Animator
Verse, Inc
Dallas, USA
 
Join Date: Feb 2002
Posts: 207
Send a message via ICQ to martinez Send a message via AIM to martinez
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-27-2013, 01:59 PM   #2
jedie
Expert
portfolio
jens d.
jojo, Germany
 
Join Date: Oct 2009
Posts: 338
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-27-2013, 03:01 PM   #3
martinez
Expert
 
martinez's Avatar
portfolio
Juan Martinez
Animator
Verse, Inc
Dallas, USA
 
Join Date: Feb 2002
Posts: 207
Send a message via ICQ to martinez Send a message via AIM to martinez
No, my best solution is to ask the user to turn it off.
__________________
Juan Martinez | Blog | Animator
 
Old 03-27-2013, 03:40 PM   #4
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,623
Send a message via ICQ to denisT
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-27-2013, 03:50 PM   #5
martinez
Expert
 
martinez's Avatar
portfolio
Juan Martinez
Animator
Verse, Inc
Dallas, USA
 
Join Date: Feb 2002
Posts: 207
Send a message via ICQ to martinez Send a message via AIM to martinez
You sir are a hero of heroes! I will study this.
__________________
Juan Martinez | Blog | Animator
 
Old 03-27-2013, 04:42 PM   #6
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,623
Send a message via ICQ to denisT
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-27-2013, 04:42 PM   #7
CGTalk Moderation
Expert
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,478
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 06:54 AM.


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