Re: [script] Events "FileName" argument

Date : Wed, 7 Dec 2005 09:20:06 +1100
To : XSI(at)Softimage.COM
From : Aloys Baillet <aloys.baillet(at)gmail.com>
Subject : Re: [script] Events "FileName" argument
Hi Bernard,

As far as I remember, we didn't manage to make this thing work in only one file: we always had to do the registration from a plugin, and put the event file outside the Plugins hierarchy (in a sibling folder called Events).
Its a pain...
I don't know what the status in 5, though.

Aloys

On 07/12/05, Bernard Lebel <3dbernard(at)gmail.com > wrote:
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



--
Aloys Baillet - XSI Technical Director
Character Dpt - Animal Logic
--

Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.