Re: [CPP] How can I determine if a model is a instance
| Date : Thu, 1 Dec 2005 10:30:54 +0800 |
| To : <XSI(at)Softimage.COM> |
| From : "Steve Yin" <steve(at)vrdd.com> |
| Subject : Re: [CPP] How can I determine if a model is a instance |
the method you provided is working!! even more, you have told me more than I want, GREATE THANKS!!
Steve
----- Original Message ----- From: "Guy Rabiller" <guy(at)alamaison.fr>
To: <XSI(at)Softimage.COM>
Sent: Wednesday, November 30, 2005 7:37 PM
Subject: Re: [CPP] How can I determine if a model is a instance
Hi Steve,
either the GetMaster command or if you need the ObjectModel approach, try this heuristic: ( I think this might be the GetMaster approach ):
-> To Check if a Model is an Instance: ( and to find its Master ) 1) Check if one of the Model.GetOwners() is of ClassID siGroupID. 2) Check if the Group.GetParameters().GetCount() is 1 or 5. If it is 1 it is either an "InstanceGroup" of a Master Model or an "Associated Models" of a Light. From here, to distinguish the two of them, either check the name of the Group ( wich is rarely changed by the user ), or just to be sure, check if the Owner of the Group - there must be only 1 - is of Class siModelID. ( then you've found your master - or source - model )
-> To Check if a Model is a Master 1) Check if one of its Groups - if any - has Parameters Count equal to 1. If yes, then it has been instanciated and is/was a Master. ( you cant remove a Model InstanceGroup )
Tell me if that works for you.
Regarding Clones, freeze works here in v5, without the need to save/open. -- guy rabiller | 3d technical director (at) LaMaison
Steve Yin wrote:
no, there is no such a property.
----- Original Message ----- *From:* kim aldis <mailto:kim(at)cg-soup.com> *To:* XSI(at)Softimage.COM <mailto:XSI(at)Softimage.COM> *Sent:* Wednesday, November 30, 2005 5:28 PM *Subject:* RE: [CPP] How can I determine if a model is a instance
check to see if the model has a master property.
------------------------------------------------------------------------ *From:* owner-xsi(at)Softimage.COM <mailto:owner-xsi(at)Softimage.COM> [mailto:owner-xsi(at)Softimage.COM] *On Behalf Of *Steve Yin *Sent:* 30-November-2005 08:48 *To:* XSI(at)Softimage.COM <mailto:XSI(at)Softimage.COM> *Subject:* [CPP] How can I determine if a model is a instance
Hi people: I have a c++ problem, I'm trying to write a plugin for xsi, Now I need to determine if a model is a instance, and if it is, get the source model of instance.
I know cloned object have a opterator called copyop, but seems instanced model do not have this operator.
BTW, How can I change a cloned object to normal object? in XSI4.2 I just freeze the cloned object, save and open, then it will change to normal object. in XSI 5 this method(maybe a xsi bug) does not working.
Thanks :)
---
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
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: Re: [CPP] How can I determine if a model is a instance
- Next by Date: Re: [CPP] How can I determine if a model is a instance
- Previous by Thread: Re: [CPP] How can I determine if a model is a instance
- Next by Thread: Re: [CPP] How can I determine if a model is a instance
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |