Salut François,
Well it sort of works as far as installation/registration goes.
But then, the event has to named specifically this way:
function XSIApplication::OnBeginFrame( CustomData, RenderType,
FileName, Frame, Sequence, RenderField, Abort )
{
Application.LogMessage( "Progress: STARTING FRAME - " + Frame + " - "
+ FileName );
}
Now when the plugin loads, I get an error about XSIApplication not
being defined. If I changed that to Application, then I don't get the
error but the event is not triggered.
Btw I changed to JScript, since the Python version was giving a weird
type error.
Thanks
Bernard
On 12/6/05, francois.painchaud(at)sympatico.ca
<francois.painchaud(at)sympatico.ca> wrote:
> Salut Bernard,
>
> Then, you can use my home-brewed 4.2 self-installing events. For example:
>
> # Begin file MySelectionChangeEvent.py
>
> def XSILoadPlugin( in_oReg ) :
>
> in_oReg.Name = "MySelectionChangeEvent"
> in_oReg.Major = 1
> in_oReg.Minor = 0
> in_oReg.Author = "Francois Painchaud"
>
> try:
> Application.Advise( "OnSelectionChange",
> in_oReg.Filename,
> "",
> "Python",
> "MySelectionChangeEvent",
> None,
> None,
> False )
> except:
> pass
>
> return True
>
> def XSIApplication_OnSelectionChange( in_vCustomData, in_eChangeType ) :
>
> l_sNewSel = Application.Selection.GetAsText()
>
> Application.LogMessage( "New selection: " + l_sNewSel )
>
> return False
>
> # End file MySelectionChangeEvent.py
>
> François
>
> > De: Bernard Lebel <3dbernard(at)gmail.com>
> > Date: 2005/12/06 mar. PM 02:12:27 GMT-05:00
> > À: XSI(at)Softimage.COM
> > Objet: Re: [script] Events "FileName" argument
> >
> > 4.2
> >
> > On 12/6/05, francois.painchaud(at)sympatico.ca <francois.painchaud(at)sympatico.ca> wrote:
> > > XSI 4.2 or 5.0?
> > >
> > > > De: Bernard Lebel <3dbernard(at)gmail.com>
> > > > Date: 2005/12/06 mar. PM 12:20:07 GMT-05:00
> > > > À: XSI(at)Softimage.COM
> > > > Objet: [script] Events "FileName" argument
> > > >
> > > > Hello,
> > > >
> > > > Let say you install an Event using Advise(). Is there a way to tell
> > > > the FileName argument to use the actual plugin file that installs the
> > > > event? That is, without composing a path to that file, something along
> > > > the lines of "use myself"?
> > > >
> > > > I'd like a way to setup the events so they don't require other files
> > > > than the plugins.
> > > >
> > > > I'm using Python.
> > > >
> > > > Thanks
> > > > Bernard
>
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi