Re: Script : Collection freeze selection.

Date : Sun, 2 Oct 2005 16:48:18 -0400
To : XSI(at)Softimage.COM
From : Bernard Lebel <3dbernard(at)gmail.com>
Subject : Re: Script : Collection freeze selection.
> // Get valid models
> var oModels = FindKind( "Character" );
>
> // Test if valid models were found.
> if( oModels.count > 0 )
> {
>         // Create collection to store valid meshes under valid models
>         var oMeshes = XSIFactory.CreateObject( "XSI.Collection" );
>
>         // Collect polygon meshes under valid models
>         for( var e = new Enumerator( oModels ); !e.atEnd(); e.moveNext() )
>         {
>                 oMeshes.additems( e.item().findchildren( "", siPolyMeshType, null, true ) );
>         }
>
>         // Test if polygon meshes were found, if so, select them
>         if( oMeshes.count > 0 )
>         {
>                 selectobj( oMeshes );
>         }
> }
>
>
>
> function FindKind( sKind )
> {
>         // Create collection to store valid models
>         var oAllModels = XSIFactory.CreateObject( "XSI.Collection" );
>
>         // Iterate all models
>         for( var oAllModelsEnum = new Enumerator( activesceneroot.models );
> !oAllModelsEnum.atEnd(); oAllModelsEnum.moveNext() )
>         {
>                 var oCpset = oAllModelsEnum.item().properties( sKind );
>                 if( oCpset )
>                 {
>                         oAllModels.add( oAllModelsEnum.item() );
>                 }
>         }
>
>         return( oAllModels );
> }
>
>
>
>
> > PS : Sorry for the bad formatting in the script. I must instal firefox on my
> > laptop someday. IE is not very friendly with Gmail :-/
>
> That has nothing to do with IE. Firefox also mangles the code formatting.



[ Bernard ] Well, sometimes ;-)

---
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.