FYI, there is also the SetGlobal command that you can use to store values. You use GetGlobal to access your data. The data remains active for the entire XSI session, so it can survive new scenes and new projects, but it's not persisted.
-mab
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf
Of Bernard Lebel
Sent: May 5, 2006 3:05 PM
To: XSI(at)Softimage.COM
Subject: Re: [script] Self-installed property global names defined
multiple times?
Thanks François, I'll check the pickle module out.
Bernard
On 5/5/06, Francois Lord <francoislord(at)gmail.com> wrote:
> I did exactly that recently (having invisible params to store data in
> PPG). I'm using pickle so I can store any kind of object in it (list,
> dictionary, object). Pickle is your friend, Bernard.
>
> Bernard Lebel wrote:
> > During the Define callback, all parameters are added to the property.
> > One of these parameters is the "project", wich is later presented as a
> > series of choices in a combo. Even though the combo is not added to
> > the layout at this stage, I still need a "default" value for the
> > "project" parameter. An empty string is not acceptable for me :-)
> > Like I said, I never know in advance the list of projects, that list
> > is built by calling a custom command. But to get a reliable default
> > value, I need that list right away so I can get the first item.
> >
> > Later, during the custom rebuild function, the combo is added to the
> > layout, using the list previously created during the Define callback.
> > Since names bound in a scope are generally exclusive to that scope, I
> > needed a way to propagate my list from the Define callback to the
> > custom rebuild function.
> >
> > I first tried typical globals (names bound in the top-level of the
> > plugin file), but it seems it is not a good idea! So instead I
> > implement these global as parameters of the property.
> >
> >
> > Does that make sense?
> >
> >
> > Berrnard
> >
> >
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi