In our pipeline we use Custom user Preferences for things that don't change 
much, such as server paths, database schemas, etc..

I wrote a few simple commands which maintain custom user preferences and found 
the best way to manage them is to treat them like self installing Custom 
Properties using a  versioning scheme.

Every custom property I create for our production has a "version" and "type" 
parameter.  When a scene or model is loaded, an event script scans all the 
custom properties and compares the version and type parameters in the custom 
property to the values stored in the custom property's plugin.  If the plugin 
is newer, the custom property is deleted and re-instanced into the scene 
copying the old information across to the new instance.  I extend this same 
process to custom user preferences.  The main difference being that custom user 
preferences can only use a subset of the available parameter value types 
available for custom properties.

My code for managing custom user preferences is in the OnStartUp() event and 
performs the same tasks as described above.  The only difference is newly 
instanced custom properties to be used as custom user preferences must be 
installed at the scene root before calling InstallCustomPreference().  When 
deleting a custom user preference, you must first delete the custom property 
installed in the user preferences, then delete the associated .preset file in 
the user's workgroup location.  If you do it in any other order, you'll get 
flakey behaviors.


You may still get the error you report when installing the custom user 
preference for the first time, but it'll go away in future sessions of the 
application.  However, I have noticed the error is more frequent in 2012 and 
2013.  Appears to be an order-of-operations thing.  Just the other day one of 
our artists activated "Load last scene at startup" preference, and that 
triggered a bunch of errors.  It seems softimage loads the last scene before 
workgroups are parsed/scanned/loaded.



Matt





From: softimage-boun...@listproc.autodesk.com 
[mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Eric Thivierge
Sent: Friday, April 20, 2012 3:40 PM
To: softimage@listproc.autodesk.com
Subject: Re: can't load cusrom preference

I stay away from the built in preferences myself because they get a bit hairy 
trying to delete them eventually.

What you could do instead is have a text file holding your pref data which is 
stored as a Python dictionary (as a string) and then creating a plugin for the 
user that reads that string evals it back to a dictionary and builds the UI 
dynamically and allows the users to set the proper prefs. You could either 
store the prefs in the workgroup / addon directory or in the users xsi folder. 
I've found this to be cleaner.

- 2 cents

--------------------------------------------
Eric Thivierge
http://www.ethivierge.com

On Sat, Apr 21, 2012 at 7:34 AM, Tim Crowson 
<tim.crow...@magneticdreams.com<mailto:tim.crow...@magneticdreams.com>> wrote:
The warning in my first email is all I get.
-Tim


On 4/20/2012 4:26 PM, Stephen Blair wrote:

Works for me.

Do you have the actual error message?





From: 
softimage-boun...@listproc.autodesk.com<mailto:softimage-boun...@listproc.autodesk.com>
 [mailto:softimage-boun...@listproc.autodesk.com] On Behalf Of Tim Crowson

Sent: April-20-12 4:36 PM

To: softimage@listproc.autodesk.com<mailto:softimage@listproc.autodesk.com>

Subject: can't load cusrom preference



Gents,



I created a custom property in Python to house a single string and want to 
install it in our workgroup as a custom preference. I have placed it in the 
workgroup in \Addons\myTool\Data\Preferences\myCustomPref.Preset But when I run 
Application.RefreshCustomPreferences() I get the following warning:



# WARNING : 3000 - Not able to load a custom preference: 
Path\to\my\customPref.Preset



Any of you Jedis have insight into what might be wrong? I'm using 2012 SAP on 
Windows, FWIW.

--







Tim Crowson

Lead CG Artist





[cid:image001.gif@01CD1F1A.C10D56A0]





Magnetic Dreams Animation Studio, Inc.

2525 Lebanon Pike, Building C. Nashville, TN 37214

Ph  615.885.6801<tel:615.885.6801> | Fax  615.889.4768<tel:615.889.4768> | 
www.magneticdreams.com<http://www.magneticdreams.com><http://www.magneticdreams.com><http://www.magneticdreams.com>

tim.crow...@magneticdreams.com<mailto:tim.crow...@magneticdreams.com><mailto:tim.crow...@magneticdreams.com><mailto:tim.crow...@magneticdreams.com>



--



Tim Crowson
Lead CG Artist


[cid:image001.gif@01CD1F0D.E55D3820]

Magnetic Dreams Animation Studio, Inc.
2525 Lebanon Pike, Building C. Nashville, TN 37214
Ph  615.885.6801<tel:615.885.6801> | Fax  615.889.4768<tel:615.889.4768> | 
www.magneticdreams.com<http://www.magneticdreams.com>
tim.crow...@magneticdreams.com<mailto:tim.crow...@magneticdreams.com>



<<inline: image001.gif>>

Reply via email to