Re: [script] models vs instances
| Date : Fri, 16 Nov 2007 22:07:08 +0100 |
| To : <XSI(at)Softimage.COM> |
| From : "peter boeykens" <peter_b(at)skynet.be> |
| Subject : Re: [script] models vs instances |
thanks Bernard and Stephen. Hope the command doesnt slow down too much.
For the the instance group's owner, yeah, I was looking at an empty model and an instance in the sdk explorer, and tried to spot something to distinguish between them - the amounts of children and groups was one, the amount of owners another. So I checked who those owners were, the instance group was an obvious one, the partition was a bit unexpected.
I would find it logical to have some simple methods and properties for this in the OM.
.instances for a model, and .master for an instance.
I'll try not to end in a rant :-) but each time I get into scripting, most of the time and effort goes to workarounds for some essential things missing in the OM.
Perhaps, while I'm at it, I'll do some forward asking.
I want to make a script to turn selected instances into one piece of geometry.
For that I would need to duplicate the master model, match transforms with the instance, merge all created duplicates, transfer the UV's and materials and delete the duplicates.
It seems like none of this can be done in OM, except for the match transform, but not in one simple line of code I think. (hint hint! prove me wrong :-)
I'm afraid that such a script would become very slow - faster than doing it manual ofcourse - but still.
Also, one I'm very unhappy about is the "delete" on the merge operator - as well as simply deleting lots of objects.
It's incredible how slow this gets! Merging the geometry is very fast, transferring the UV's and materials too - but the deleting... It gets dead slow even on a few hundred objects. On a few thousand it often freezes XSI. (or at least goes way beyond my patience treshold)
I was thinking that maybe a routine to delete large amounts of objects one at a time or in groups of ten might be faster and more stable than the current behaviour. Dont know if anyone ever bothered to try this out?
----- Original Message ----- From: "Bernard Lebel" <3dbernard(at)gmail.com>
To: <XSI(at)Softimage.COM>
Sent: Friday, November 16, 2007 8:18 PM
Subject: Re: [script] models vs instances
Using commands you can get there:
getmaster( oInstance ) will return the source model, null if it's not an instance. getinstances( oModel ) will return a collection of instances, provided the model has instances and is not an instance.
I never thought of checking the instance group. This returns the group under the source model, so I guess checking the parent of that group will return the source model of the instance. Nice one.
Cheers Bernard
On Nov 16, 2007 1:02 PM, peter boeykens <peter_b(at)skynet.be> wrote:---hi all,
is there any OM ways to: create instances? detect wether a model is an instance? find the model the instance originates from?
my results so far are:
- instances are the same as models, as far as .type, typename and classname
are concerned.
- instances by default have 0 groups and 0 children
that's not a guarantee though: models usually have some children, but an
empty model doenst, and an instance can have children. models can have zero
groups too.
- instances have two interesting owners: the instance group, and a partition
models cannot have an owner that is a partition I think. the instance group
itself is an altogether normal group, nothing to differentiate it from
another group.
- And how to find the master object from the instance? Go to owners, find
all groups, and test if the groups belong to models? Its still no
guarantee...
So that means a lot of things to test for, and most criteria can have exceptions, and its all very indirect/cumbersome. Surely there must be some more straigthforward ways I am overlooking?
---
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
--- Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body: unsubscribe xsi
- References:
- Offset in PO_XSI_Reader operator
- From: "Bernard Lebel" <3dbernard(at)gmail.com>
- RE: Offset in PO_XSI_Reader operator
- From: "Mathieu Leclaire" <mleclair(at)hybride.com>
- Re: Offset in PO_XSI_Reader operator
- From: "Bernard Lebel" <3dbernard(at)gmail.com>
- [script] models vs instances
- From: "peter boeykens" <peter_b(at)skynet.be>
- Re: [script] models vs instances
- From: "Bernard Lebel" <3dbernard(at)gmail.com>
- Offset in PO_XSI_Reader operator
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: RE: SSS Split v2
- Next by Date: RE: SSS Split v2
- Previous by Thread: RE: SSS Split v2
- Next by Thread: RE: SSS Split v2
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |