I've narrowed it down to this;
Try running it as it is, then open the PPG and click the button. I'm
getting "Object expected" here on the foo(); -line!
Main();
function Main()
{
var oCustomProperty = ActiveSceneRoot.AddProperty("CustomProperty",
false, "fooProp");
var oLayout = oCustomProperty.PPGLayout;
oLayout.Addbutton("MyBtn");
oLayout.Logic = MyBtn_OnClicked.toString();
oLayout.Language = "JScript" ;
}
function MyBtn_OnClicked()
{
foo();
}
function foo()
{
logmessage("footext");
}
--
stockholm.postproduction | www.stopost.se
On 3/21/06, RPS <kewboard24(at)gmail.com> wrote:
>
> Hi
> u can also try doing this way
>
> var oProp = ActiveSceneRoot.AddProperty( "CustomProperty", false, "myTool" )
> ;|
> var oPPGLayout = oProp.PPGLayout ;
> InspectObj(oPSet);
>
> this work for sure. i dont wat other error u are getting. if can provide the
> snippet i can have a look.
>
>
> RPS
>
>
>
>
>
>
>
>
> On 3/21/06, Arvid Björn <arvidbjorn(at)gmail.com> wrote:
> > Thanks Kim, actually I did log the type, which matched the object I
> > was looking for, but I just wasn't sure if that was enough. I'm still
> > getting "object expected" from a subroutine though. I'm not sure how
> > to track this one down! Jscript isn't very strict when it comes to
> > data types. How do you go about debugging these things?
> >
> >
> > --
> > stockholm.postproduction | www.stopost.se
> >
> > On 3/21/06, kim aldis <kim(at)cg-soup.com> wrote:
> > > PPG.inspected(0) is the way to go. If ever in doubt, log the type. It's
> > > usually enough to get you started.
> > >
> > >
> > > > -----Original Message-----
> > > > From: owner-xsi(at)Softimage.COM
> > > > [mailto: owner-xsi(at)Softimage.COM] On Behalf Of Arvid Björn
> > > > Sent: 21-March-2006 10:07
> > > > To: xsi(at)Softimage.COM
> > > > Subject: How to get PPG object?
> > > >
> > > > Hey, I'm having problems with a self-installed plugin. It
> > > > used to work when I had it in siModal-mode, as I executed
> > > > everything within the startup procedure. I had easy access to
> > > > the ppg-object as it was created like this:
> > > >
> > > > var oProp = ActiveSceneRoot.AddProperty( "CustomProperty",
> > > > false, "myTool" ) ;
> > > >
> > > > Now, since I've rearranged the tool as a regular floating
> > > > PPG, and the code is moved to a button in that PPG I get
> > > > "object expected"-errors all over the code. I tried this:
> > > >
> > > > var oProp = PPG.Inspected(0);
> > > >
> > > > But I'm not sure which object I actually get from that, but
> > > > clearly it's not working. What's the correct way to get this
> > > > object after it's allready been created?
> > > >
> > > >
> > > > Thanks a bunch
> > > > -arvid
> > > >
> > > > --
> > > > stockholm.postproduction | www.stopost.se
> > > >
> > > > ---
> > > > 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
> >
>
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi