|
that seems to be pretty wasteful, isn't it?
oModel = Application.Selection(0) while not oModel.Model.IsEqualTo(Application.ActiveSceneRoot): oModel = oModel.Model
-- ''.join([chr(ord(c)-10) for c in 'xzo~s~J|}z8myw8k'])
teedee - Rising Sun Pictures
On 6/2/07, Bernard Lebel <3dbernard(at)gmail.com> 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
|