Re: Scripting : Referenced Model owner

Date : Mon, 04 Jun 2007 12:00:46 +0930
To : XSI(at)Softimage.COM
From : Raffaele Fragapane <jaco(at)thejaco.com>
Subject : Re: Scripting : Referenced Model owner
any reason why you'd go up every individual object in a hierarchy (which in a decent rig can easily amount to several dozen hops), instead of just getting the model parent each time and hopping from there? seems like an awful lot of useless hops, but I might be missing the point.

******************************
|     Raffaele Fragapane       |
|     Rising Sun Pictures      |
|"The only way, is all the way"|
******************************



Bernard Lebel wrote:

I'd recursively walk up the hierarchy.



// Collection to store all visited models
oModels = XSIFactory.createobject( "XSI.Collection" );

checkParent( selection(0) );

// Get model before last (last model being the scene root
oModel = oModels.item( oModels.count-2 );
logmessage( oModel.fullname );


function checkParent( oObject )
{
if( oObject.type == "Scene" )
return;
else if( oObject.type == siModelType )
{
oModels.add( oObject );
}
checkParent( oObject.parent );
}





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