With PlotShape command ( and I guess all the commands returning an
ISIVTCollection ) your code with a for loop doesn't work ( or I missed
something ).
Cheers
GUILLAUME LAFORGE :-)
On 7/14/07, javier <javier.vdp(at)gmail.com> wrote:
>
> Gilliaume,
>
> your method seems correct but you dont need to create an Enumerator for
> nested objects as nested objects are a collection so you can iterate them as
> such
>
> oNested = oClip.NestedObjects;
> for (i=0;i< oNested.Count;i++){
> if (oNested(i).Name == ...etc
>
> As you point out, NestedObjects feel dirty but they are the best way to
> get to properties and parameters of objects that have no OM connection
> built. Thus very useful.
>
> Otherwise, there is a more direct -- if dirtier way -- if you are sure
> that you have a clip and an instanced action, you know that "startoffset" is
> a parameter of the action, so you can check the full parameter name ( select
> your action and logmessage(selection(0).FullName and put the path below
>
> SetValue( oClip.FullName+". --you have to check this om string yourself--
> .startoffset", 15,null);
>
>
> javier
>
>
> On 7/12/07, Guillaume Laforge <guillaume(at)alamaison.fr> wrote:
> >
> >
> > In Jscript it can be tricky sometime...
> >
> > PlotShape command hide your new clip under two collections.
> >
> > Here is my try :
> >
> > var oPlot = PlotShape("cube", "plotMerged", 1, 40, 1, true, 1, 3, 2,
> > true, null, null);
> > var oClip = oPlot.item(1).item(1);//The joy of jscript...
> >
> > oEnum = new Enumerator(oClip.nestedobjects ) ;
> > for (;!oEnum.atEnd();oEnum.moveNext() )
> > {
> > var oNested = oEnum.item() ;
> > if( oNested.name == "Instanced Action" )
> > {
> > var oInstancedAction = oNested;
> > }
> > }
> > var oTimeCtrl = oInstancedAction.nestedobjects.item(0);
> > oTimeCtrl.parameters.item("startoffset").value = 15;
> >
> >
> > Hope this help
> >
> > --
> > Guillaume Laforge | La Maison
> >
> >
> > On Thu, 12 Jul 2007 17:20:21 -0400, "Mathieu Leclaire" <
> > mleclair(at)hybride.com> wrote:
> > > No, I'm in 5.11. but the point is to track down the track and the clip
> > from
> > > the PlotShape command so I can offset it.
> > >
> > > Mathieu Leclaire
> > > R&D Programmer
> > > Hybride Technologies
> > >
> > > "Yesterday is history, tomorrow is a mystery, today is a gift and that
> > is
> > > why it's called the present"
> > >
> > > -----Original Message-----
> > > From: Andre DeAngelis [mailto: andre.deangelis(at)ubisoft.com]
> > > Sent: Thursday, July 12, 2007 5:12 PM
> > > To: XSI(at)Softimage.COM
> > > Subject: RE: PlotShape and offset clip
> > >
> > > If you are using 6.x there is there offset method, though i am not
> > 100%
> > > sure
> > > if it only applies to Fcurve sources.
> > >
> > > AD
> > >
> > > _____
> > >
> > > From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On
> > Behalf
> > > Of
> > > Mathieu Leclaire
> > > Sent: July 12, 2007 4:47 PM
> > > To: XSI(at)Softimage.COM
> > > Subject: PlotShape and offset clip
> > >
> > > Once I called the PlotShape command { PlotShape(newMergedObj,
> > > "plotMerged",
> > > startFrame, endFrame, 1, true, 1, 3, 2, true, null, null); }, how can
> > I
> > > offset the start time of that newly plotted shape in JScript?
> > >
> > >
> > > Mathieu Leclaire
> > > R&D Programmer
> > > Hybride Technologies
> > >
> > > "Yesterday is history, tomorrow is a mystery, today is a gift and that
> > is
> > > why it's called the present"
> > >
> > >
> > >
> >
> >
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> > body:
> > unsubscribe xsi
> >
>
>
------=_Part_49243_25090693.1184440829113
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi Jaiviier,<br><br>I always use the enumerator object with collections. I find it faster to write it using a right clic in the script editor ( of course you can also choose a "for loop" in the right clic menu but you must write ".count" and clean up the line ).
<br>From the Jscript documentation, the enumerator object is designed to enumerate a collection so it should always work fine with ... collection :-) .<br><br>With <span class="e" id="q_113c5eff4335b2f8_2">PlotShape command ( and I guess all the commands returning an ISIVTCollection ) your code with a for loop doesn't work ( or I missed something ).
<br><br>Cheers<br><br>GUILLAUME LAFORGE :-)<br></span><br><br>On 7/14/07, <b class="gmail_sendername">javier</b> <<a href="mailto:javier.vdp(at)gmail.com">javier.vdp(at)gmail.com</a>> wrote:<div><span class="gmail_quote">
</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Gilliaume, <br><br>your method seems correct but you dont need to create an Enumerator for nested objects as nested objects are a collection so you can iterate them as such
<br><br>oNested = oClip.NestedObjects;<br>for (i=0;i<
oNested.Count;i++){<br>if (oNested(i).Name == ...etc<br><br>As you point out, NestedObjects feel dirty but they are the best way to get to properties and parameters of objects that have no OM connection built. Thus very useful.
<br><br>Otherwise, there is a more direct -- if dirtier way -- if you are sure that you have a clip and an instanced action, you know that "startoffset" is a parameter of the action, so you can check the full parameter name ( select your action and logmessage(selection(0).FullName and put the path below
<br><br>SetValue( oClip.FullName+". --you have to check this om string yourself-- .startoffset", 15,null);<br><span class="sg"><br><br>javier</span><div><span class="e" id="q_113c5eff4335b2f8_2"><br><br><br><div>
<span class="gmail_quote">On 7/12/07, <b class="gmail_sendername">Guillaume Laforge
</b> <<a href="mailto:guillaume(at)alamaison.fr" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">guillaume(at)alamaison.fr</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>In Jscript it can be tricky sometime...<br><br>PlotShape command hide your new clip under two collections.<br><br>Here is my try :<br><br>var oPlot = PlotShape("cube", "plotMerged", 1, 40, 1, true, 1, 3, 2, true, null, null);
<br>var oClip = oPlot.item(1).item(1);//The joy of jscript...<br><br>oEnum = new Enumerator(oClip.nestedobjects ) ;<br>for (;!oEnum.atEnd();oEnum.moveNext() )<br>{<br> var oNested = oEnum.item() ;<br> if( oNested.name
== "Instanced Action" )<br> {<br> var oInstancedAction = oNested;<br> }<br>}<br>var oTimeCtrl = oInstancedAction.nestedobjects.item(0);<br>oTimeCtrl.parameters.item("startoffset").value = 15;
<br><br><br>Hope this help<br><br>--<br>Guillaume Laforge | La Maison<br><br><br>On Thu, 12 Jul 2007 17:20:21 -0400, "Mathieu Leclaire" <<a href="mailto:mleclair(at)hybride.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
mleclair(at)hybride.com</a>> wrote:
<br>> No, I'm in 5.11. but the point is to track down the track and the clip from<br>> the PlotShape command so I can offset it.<br>><br>> Mathieu Leclaire<br>> R&D Programmer<br>> Hybride Technologies
<br>><br>> "Yesterday is history, tomorrow is a mystery, today is a gift and that is<br>> why it's called the present"<br>><br>> -----Original Message-----<br>> From: Andre DeAngelis [mailto:
<a href="mailto:andre.deangelis(at)ubisoft.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">andre.deangelis(at)ubisoft.com</a>]<br>> Sent: Thursday, July 12, 2007 5:12 PM<br>> To: <a href="mailto:XSI(at)Softimage.COM" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
XSI(at)Softimage.COM</a><br>> Subject: RE: PlotShape and offset clip
<br>><br>> If you are using 6.x there is there offset method, though i am not 100%<br>> sure<br>> if it only applies to Fcurve sources.<br>><br>> AD<br>><br>> _____<br>><br>> From: <a href="mailto:owner-xsi(at)Softimage.COM" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
owner-xsi(at)Softimage.COM</a> [mailto:<a href="mailto:owner-xsi(at)Softimage.COM" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">owner-xsi(at)Softimage.COM</a>] On Behalf<br>> Of<br>> Mathieu Leclaire
<br>> Sent: July 12, 2007 4:47 PM<br>> To: <a href="mailto:XSI(at)Softimage.COM" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
XSI(at)Softimage.COM</a><br>> Subject: PlotShape and offset clip<br>><br>> Once I called the PlotShape command { PlotShape(newMergedObj,<br>> "plotMerged",<br>> startFrame, endFrame, 1, true, 1, 3, 2, true, null, null); }, how can I
<br>> offset the start time of that newly plotted shape in JScript?<br>><br>><br>> Mathieu Leclaire<br>> R&D Programmer<br>> Hybride Technologies<br>><br>> "Yesterday is history, tomorrow is a mystery, today is a gift and that is
<br>> why it's called the present"<br>><br>><br>><br><br><br>---<br>Unsubscribe? Mail <a href="mailto:Majordomo(at)Softimage.COM" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Majordomo(at)Softimage.COM
</a> with the following text in body:<br>unsubscribe xsi
<br></blockquote></div><br>
</span></div></blockquote></div><br><br clear="all"><br>
------=_Part_49243_25090693.1184440829113--
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi