Re: Scripting : Referenced Model owner

Date : Fri, 1 Jun 2007 22:10:00 +0200
To : XSI(at)Softimage.COM
From : "Christopher Crouzet" <christopher.crouzet(at)gmail.com>
Subject : Re: Scripting : Referenced Model owner
AFAIK, there is no direct method to find the top most model, but it can be achieved quite simply.
You just have to do a while loop statement or a recursive function which scan every parent model until it reaches the top most model determined by either it is referenced or the next top model is the scene root.

I've coded a such function in C++, you can check the code here : http://ccxsitoolkit.cvs.sourceforge.net/ccxsitoolkit/release_1.0/src/cc_projectitem.cpp?revision=1.3&view=markup


Christopher.

On 6/1/07, Adam Seeley <adam.seeley(at)clearpost.co.uk> wrote:
Hi,
 
I found that, but that will tell me the immediate Model that the object is within.
I have objects nested beneath Models beneath Models etc. all wrapped up in a large Referenced Model at the top.
It's the Top Referenced Model that I'm after.
 
I'm sure the items floating around in there somewhere.
If I try to alter a Property deep within the Referenced Model under various other models, it will spit this back pretty quickly.

'ERROR : 2103 - Objects in referenced model Referenced_MASTER_MODEL_V1 cannot be modified.

and mention the top Referenced Model rather than the items immediate Model.
 
Adam.
 


From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of Christopher Crouzet
Sent: 01 June 2007 18:21
To: XSI(at)Softimage.COM
Subject: Re: Scripting : Referenced Model owner

In the ProjectItem class (and all its childs like SceneItem, X3DObject, ...), you can find the 'Model' property.

The code in VBScript :
set topModel = oObject.Model


Christopher.

On 6/1/07, Adam Seeley <adam.seeley(at)clearpost.co.uk> wrote:
Hi,
 
Does anyone know how to find out which Referenced Model an Object belongs to or is within?
 
I guess it's something along the lines of oObject.Parent but more like to be oObject.ReferenceModelOwner
 
Looking at the docs, but still finding the navigation a bit tough when looking for specifics.
 
Many thanks,
 
Adam.
 
 

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.472 / Virus Database: 269.8.5/826 - Release Date: 31/05/2007 16:51



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.472 / Virus Database: 269.8.5/826 - Release Date: 31/05/2007 16:51


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.472 / Virus Database: 269.8.5/826 - Release Date: 31/05/2007 16:51



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.