Re: Duplicate with OM

Date : Fri, 10 Feb 2006 11:53:24 +0100
To : XSI(at)Softimage.COM
From : Arvid Björn <arvidbjorn(at)gmail.com>
Subject : Re: Duplicate with OM
I did some testing, here's the reason why I asked,

While creating hundreds of objects using this...
oTopNull.AddGeometry("cone", "MeshSurface");
I clocked it to 6 seconds

But using Duplicate(oCone); took about 25 seconds for the same ammount,

However I took Juans advice and multiduplicated it using
Duplicate(oCone, num) before the loop and I got it down to 10 seconds,
thanks Juan. =)

If there are any faster ways, I'm all ears!

-a

--
stockholm.postproduction | www.stopost.se

On 2/9/06, guillaume laforge <guillaume.laforge.3d(at)gmail.com> wrote:
> Thanks for the explanations.
>
>
> On 2/9/06, Bernard Lebel <3dbernard(at)gmail.com> wrote:
> > (from the docs)
> > The Duplicate command returns an XSICollection containing the
> > duplicated object(s).
> > The (0) I use after the command basically access the first index of
> > the XSICollection returned by the command.
> >
> > var oSphere = selection(0);
> > var oDup;
> >
> > for( i=0; i<5; i++ )
> > {
> >        oDup = duplicate( oSphere )(0);
> >        logmessage( oDup.fullname );
> > }
> >
> >
> > An alternate form could be, for sake of clarity:
> >
> > var oSphere = selection(0);
> > var oDupColl, oDup;
> >
> > for( i=0; i<5; i++ )
> > {
> >        oDupColl = duplicate( oSphere );
> >        oDup = oDupColl(0);
> >        logmessage( oDup.fullname );
> > }
> >
> >
> >
> > Finally, you could perform the duplication, and then loop over the
> > returned collection instead:
> >
> > var oSphere = selection(0);
> > var oDupColl = duplicate( oSphere, 5 );
> >
> > for( var i=0; i<oDupColl.count; i++ )
> > {
> >        oDup = oDupColl(i);
> >        logmessage( oDup.fullname );
> > }
> >
> >
> > That would be faster.
> >
> >
> >
> > Cheers
> > Bernard
> >
> >
> >
> > On 2/9/06, guillaume laforge <guillaume.laforge.3d(at)gmail.com> wrote:
> > > >I can live with that.
> > >
> > > Well in fact thats me who can't ;-) because I don't understand why you
> use
> > > Duplicate(oCone)(0) as the Duplicate command return the duplicated
> object by
> > > default ?
> > >
> > > for (i=0; i < 10; i++)
> > > {
> > > var oNewCone = Duplicate();
> > > logmessage(oNewCone);
> > > }
> > >
> > > Did I miss something ?
> > >
> > > Cheers
> > >
> > > Guillaume
> >
> > ---
> > 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


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.