it does work, but the pref is restored after the script exits. You can change it permantely through c++ On Sep 7, 2012 6:30 PM, "Matt Lind" <ml...@carbinestudios.com> wrote:
> I’ve looked through my email archives and have seen plenty of discussion > about the undo history level not being permanently set by script. What I > do not see is a solution to temporarily setting the undo history via script. > **** > > ** ** > > In 2013_SP1 I can read the undo history value via scripting just fine, but > I cannot set the undo history level as all of these techniques fail > silently:**** > > ** ** > > var HistoryLevel = 0;**** > > ** ** > > Application.Preferences.SetPreferenceValue( > “General.undo”, HistoryLevel );**** > > SetValue( “preferences.General.undo”, HistoryLevel );**** > > SetUserPref( “General.undo”, HistoryLevel );**** > > ** ** > > While I never rely on setting undo history for tools, I have one rare > exception where it’s required to work around a problem – animation import. > We have many very large animation files which must be imported into the > scene, and by necessity we’re still running 32-bit Softimage. When we > import these large animation files the undo history buffer overflows and > causes Softimage to crash from running out of memory. The only available > workaround has been to set undo history to zero, import the files, then > restore undo history to it’s previous value.**** > > ** ** > > Any ideas how to set undo history from script?**** > > ** ** > > ** ** > > Matt**** > > ** ** > > ** ** >