Script : Collection freeze selection.
| Date : Sun, 2 Oct 2005 21:26:59 +0200 |
| To : XSI(at)Softimage.COM |
| From : guillaume laforge <guillaume.laforge.3d(at)gmail.com> |
| Subject : Script : Collection freeze selection. |
//Two collections. First one store the good models and the other one the objects under those models.
var oModelKind = XSIFactory.CreateObject ("XSI.Collection");
var oKind = XSIFactory.CreateObject ("
XSI.Collection");
//Run a function who search all the models with a CPset named "Character" and add them to oModelKind.
FindKind("Character",oModelKind)
//Then I want to find all the polymesh under those models stored in the oModelKind collection.
for(var en = new Enumerator( oModelKind ); !en.atEnd(); en.moveNext() )
{
var oModel = en.item();
var oPolies =
oModel.findchildren( "", siPolyMeshType, null, true );
oKind.add(oPolies);
}
// It works in the History log but not in the scene. It freeze the selection. Why ?
SelectObj(oKind);
//Function to store models with a specific CPset. The inputs are the name of the CPset and name of the collection to add the models.
function FindKind(Kind,ModelKind)
{
//Find all the models.
var oModels =
activesceneroot.findchildren( "", siModelType, null, true );
//Put the models of good "kind" in the collection.
for ( var en = new Enumerator( oModels ); !en.atEnd(); en.moveNext() )
{
var oModel =
en.item();
var oPSet = oModel.Properties((Kind));
if (oPSet)
{
oModelKind.add(oModel);
}
}
}
Any idea ?
Cheers,
Guillaume Laforge
PS : Sorry for the bad formatting in the script. I must instal firefox on my laptop someday. IE is not very friendly with Gmail :-/
- Follow-Ups:
- Re: Script : Collection freeze selection.
- From: Bernard Lebel <3dbernard(at)gmail.com>
- Re: Script : Collection freeze selection.
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: RE: Feature Request: Copy External Files under Project should take care of
- Next by Date: RE: Feature Request: Copy External Files under Project should take care of
- Previous by Thread: RE: Feature Request: Copy External Files under Project should take care of
- Next by Thread: RE: Feature Request: Copy External Files under Project should take care of
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |