I Solved it with a refresh button... now we'll see if I can make that
OnInit to work :)
regards
stefan
On 8/14/06, Stefan Andersson <sanders3d(at)gmail.com> wrote:
it would be very cool if you could add the code to the python file
that I attached. It's always eaiser to study something once you have
it in front of you :)
So you would recommend to stay away totaly from DefineLayout and use
OnInit instead?
regards
stefan
On 8/14/06, Nick <nick.petit(at)gmail.com> wrote:
> that would be because you search the folders outside of any function, as a
> global which only gets created when you load the plugin, so what you're
> doing by right clicking and going "refresh" is actually unloading and
> reloading the plugin, hence also refreshing your global list of folders...
> stick that whole chunck directly in the layout building function so it gets
> called everytime the layout gets built (if you want that behaviour)
>
> The other problem is that you are doing the PPG Layout in a define callback
> which also gets initialised on plugin load. Swap it for a OnInit callback,
> it's a lot more flexible, it gets called everytime the PPG is inspected and
> DefineLayout is meant to be deprecated or phased out (not 100% sure about
> that, but I know Soft do recommend using OnInit instead).
> The thing is, even with an OnInit() callback, you'll have to close the PPG
> and re-inspect it for it to rebuild itself, so make a refresh button which
> does a PPG.Refresh() (which will work as long as the folder list generation
> is inside the OnInit callback function)
>
> If you need me to I can quickly send you some code for it...
>
>
> On 8/14/06, Stefan Andersson <sanders3d(at)gmail.com > wrote:
> > Hi All,
> >
> > I'm just wondering how one shuold use the PPG.refresh() command. I
> > just cant get it to work. I have this small little plugin that I wrote
> > that looks in a folder and return the folders it has within it as a
> > list. Now if I add a new folder I must refresh the PPG manually.
> > I asked about this before and people told me to use it on the "OnInit"
> > part, but I must be doing something wrong.
> > I've attached a simple version of it and I hope that anyone out there
> > could help me out understanding what I do wrong.
> >
> > regards
> > stefan andersson
> >
> >
> > --
> > Freelance Pixel Abuser
> > http://os3d.blogspot.com/
> >
> >
> >
>
>
--
Freelance Pixel Abuser
http://os3d.blogspot.com/
--
Freelance Pixel Abuser
http://os3d.blogspot.com/
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi