Thanks Ben and Matt! It amazes me that there isn't a more formal way to do this. I think if I use your method, Matt, I'd still have the same issue with my initial changes not sticking. I've already disabled the knobs I don't want them to mess with, so I'm less worried about that. It just seems like either there's a formal system for this that I'm totally missing or I'm accomplishing it all wrong. Ben's suggestion handles the autosave problem but there's lots of others that need fixing.
I'm just surprised that hacking a save to the preferences or changing it back with a callback really is the solution The Foundry envisioned for studio-wide preferences. Thanks! Den On Monday, August 24, 2015, Matt Plec <[email protected]> wrote: > For other knobs, like the autosave time, you could set a knob changed > callback to reset the value to what you want whenever it gets changed, > which seems to catch that prefs panel cancel resetting it. You might also > want to disable it so users don't get frustrated trying to set it to > something themselves. Try this in init.py (using 9.0v6, ): > > nuke.toNode('preferences')['AutoSaveTime'].setValue(33) > nuke.toNode('preferences')['AutoSaveTime'].setEnabled(False) > > def fixPrefs(): > k = nuke.thisKnob() > if (k.name() == 'AutoSaveTime'): > print 'fixing AutoSaveTime' > k.setValue(33) > > nuke.addKnobChanged(fixPrefs, nodeClass="Preferences") > > > > On Tue, Aug 25, 2015 at 8:42 AM, Ben Dickson <[email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>> wrote: > >> This should be doable with the nuke.addAutoSaveFilter callback >> >> >> http://docs.thefoundry.co.uk/nuke/80/pythondevguide/callbacks.html#autosavefilter >> >> >> On 25/08/15 11:56, Den Serras wrote: >> >>> I wonder if I'm going about this all wrong, considering the dearth of >>> information on this out there... >>> >>> I'm modifying some of the preferences in our Nuke setup globally, >>> notably the autosave location, which is a custom location (not the same >>> as the default environment variables). I set those preferences by >>> changing the knobs and then using a hacky script I found on the forums >>> by Javier Garcia to save the preferences. If I don't do the save, then >>> if the user opens the prefs and hits cancel, the changes are lost. >>> >>> It seems like a backwards way to solve some of this. There should be >>> some kind of studio preference which simply overrides any user values. >>> Is everyone just using this same trick? >>> >>> Thanks! >>> Den >>> >>> >>> >>> >>> _______________________________________________ >>> Nuke-python mailing list >>> [email protected] >>> <javascript:_e(%7B%7D,'cvml','[email protected]');>, >>> http://forums.thefoundry.co.uk/ >>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >>> >>> >> -- >> ben dickson >> 2D TD | [email protected] >> <javascript:_e(%7B%7D,'cvml','[email protected]');> >> rising sun pictures | www.rsp.com.au >> _______________________________________________ >> Nuke-python mailing list >> [email protected] >> <javascript:_e(%7B%7D,'cvml','[email protected]');>, >> http://forums.thefoundry.co.uk/ >> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python >> > >
_______________________________________________ Nuke-python mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
