Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
FX tree : Select file input node only

FX tree : Select file input node only

2005-06-15       - By kim aldis

 Back
Reply:     1     2     3     4     5  

any time.



 __ __  

From: owner-xsi@(protected) [mailto:owner-xsi@(protected)] On Behalf Of
guillaume laforge
Sent: 15 June 2005 12:37
To: XSI@(protected)
Subject: Re: FX tree : Select file input node only


When I write some scripts to learn I often use "XSI collection" but in a
deadline I forget my new knowledge :-)
Thanks kim !



2005/6/15, kim aldis <kim@(protected)>:

you're looping through a list of items but changing that list as you loop
through it so it's count and item order is changing as you go. There's a few
ways to deal with this, either push the items you want to delete onto an
array in the main loop then delete the items in that array after the loop,
or make a copy of the selection first and loop through that.

Try this:-

var oColl = new ActiveXObject( "XSI.Collection" );
oColl.items = selection;    // selected items into collection

// loop through the collection. No reason not to use a traditional integer
loop for this but this is faster.
//
for ( var f=new Enumerator( oColl ); !f.atEnd(); f.moveNext() ) {
   var oItem = f.item();
   if ( oItem.type != "FileInputOp" ) {
       removefromselection( oItem );
   }
}


 __ __  

From: owner-xsi@(protected) [mailto:  <mailto:owner-xsi@(protected)>
owner-xsi@(protected)] On Behalf Of guillaume laforge
Sent: 15 June 2005 10:05
To: XSI@(protected)
Subject: FX tree : Select file input node only



Hi List,
I need to select all the file input nodes from a fxtree.
The script I write below seems to remove randomly some nodes ???
I don't understand why ?

//All the Fx tree nodes are selected.
var oSel = Selection;
for(i=0;i<oSel.count;i++)
if(oSel(i).type != "FileInputOp")
{
RemoveFromSelection(oSel(i))
}
logmessage("only file input nodes are selected !")

Any idea ?

Cheers,

Guillaume Laforge
CG artist
www.vol2nuit.fr <http://www.vol2nuit.fr/>







<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2627" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT face=Arial color=#0000ff size=2><SPAN
class=718154711-15062005>any time.</SPAN></FONT></DIV><FONT face=Arial
color=#0000ff size=2></FONT><BR>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid;
MARGIN-RIGHT: 0px">
 <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
 <HR tabIndex=-1>
 <FONT face=Tahoma><FONT size=2><B>From:</B> owner-xsi@(protected)
 [mailto:owner-xsi@(protected)] <B>On Behalf Of </B>guillaume
 laforge<BR><B>Sent:</B> 15 June 2005 12:37<BR><B>To:</B>
 XSI@(protected)<BR><STRONG>Subje</STRONG><STRONG>ct:</STRONG> Re: FX tree :
 Select file input node only<BR></FONT></FONT><BR></DIV>
 <DIV></DIV>
 <DIV>When I write some&nbsp;scripts to learn&nbsp;I often use "XSI collection
"
 but in a deadline I forget my new knowledge :-)</DIV>
 <DIV>Thanks kim !</DIV>
 <DIV><BR><BR>&nbsp;</DIV>
 <DIV><SPAN class=gmail_quote>2005/6/15, kim aldis &lt;<A
 href="mailto:kim@(protected)">kim@(protected)</A>&gt;:</SPAN>
 <BLOCKQUOTE class=gmail_quote
 style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px
solid">
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>you're
   looping through a list of items but changing that list as you loop through
   it so it's count and item order&nbsp;is changing as you go. There's a few
   ways to deal with this, either push the items you want to delete onto an
   array in the main loop then delete the items in that array after the loop,
   or make a copy of the selection first and loop through that.
   </FONT></SPAN></DIV>
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
   size=2></FONT></SPAN>&nbsp;</DIV>
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>Try
   this:-</FONT></SPAN></DIV>
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
   size=2></FONT></SPAN>&nbsp;</DIV>
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>var
   oColl = new ActiveXObject( "XSI.Collection" );<BR>oColl.items =
   selection;&nbsp;&nbsp;&nbsp; // selected items into
   collection</FONT></SPAN></DIV>
   <DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff size=2>// loop
   through the collection. No reason not to use a traditional integer loop for
   this but this is faster.</FONT></SPAN></DIV>
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
   size=2>//<BR>for ( var f=new Enumerator( oColl ); !f.atEnd(); f.moveNext()
)
   {</FONT></SPAN></DIV>
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
   size=2>&nbsp;&nbsp;&nbsp; var oItem = f.item();</FONT></SPAN></DIV>
   <DIV dir=ltr align=left><SPAN>&nbsp;&nbsp;&nbsp; <FONT face=Arial
   color=#0000ff size=2>if ( oItem.type != "FileInputOp" )
{</FONT></SPAN></DIV>
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
   size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; removefromselection(
oItem
   );</FONT></SPAN></DIV>
   <DIV dir=ltr align=left><SPAN>&nbsp;&nbsp;&nbsp; <FONT face=Arial
   color=#0000ff size=2>}</FONT></SPAN></DIV>
   <DIV dir=ltr align=left><SPAN><FONT face=Arial color=#0000ff
   size=2>}</FONT></SPAN></DIV><BR>
   <BLOCKQUOTE dir=ltr
   style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid;
MARGIN-RIGHT: 0px">
     <DIV lang=en-us dir=ltr align=left>
     <HR>
     <FONT face=Tahoma size=2><B>From:</B> <A
     onclick="return top.js.OpenExtLink(window,event,this)"
     href="mailto:owner-xsi@(protected)"
     target=_blank>owner-xsi@(protected)</A> [mailto:<A
     onclick="return top.js.OpenExtLink(window,event,this)"
     href="mailto:owner-xsi@(protected)" target=_blank>
     owner-xsi@(protected)</A>] <B>On Behalf Of </B>guillaume
     laforge<BR><B>Sent:</B> 15 June 2005 10:05<BR><B>To:</B> <A
     onclick="return top.js.OpenExtLink(window,event,this)"
     href="mailto:XSI@(protected)"
     target=_blank>XSI@(protected)</A><BR><B>Subject:</B> FX tree : Select
     file input node only<BR></FONT><BR>&nbsp;</DIV>
     <DIV><SPAN class=e id=q_1047f547a1207bdc_1>
     <DIV></DIV>
     <DIV>Hi List,</DIV>
     <DIV><FONT size=2>
     <P>I need to select all the file input nodes from a fxtree. <BR>The
script
     I write below&nbsp;seems to&nbsp;remove randomly some nodes ???<BR>I don
't
     understand why ?</P>
     <P>//All the Fx tree nodes are selected.<BR>var oSel =
     Selection;<BR>for(i=0;i&lt;oSel.count;i++)<BR>if(oSel(i).type !=
     "FileInputOp")<BR>{<BR>RemoveFromSelection(oSel(i))<BR>}<BR>logmessage(
"only
     file input nodes are selected !") </P>
     <P>Any idea ?</P>
     <P>Cheers,</P>
     <P>Guillaume Laforge<BR>CG&nbsp;artist<BR><A
     onclick="return top.js.OpenExtLink(window,event,this)"
     href="http://www.vol2nuit.fr/" target=_blank>www.vol2nuit.fr</A></P>
     <P>&nbsp;</P>
     <P>&nbsp;</P></FONT></DIV></SPAN></DIV></BLOCKQUOTE></BLOCKQUOTE></DIV>
<BR></BLOCKQUOTE></BODY></HTML>