Re: OM: Image Sources

Date : Fri, 20 Jan 2006 16:40:33 +0100
To : XSI(at)Softimage.COM
From : André Adam <a_adam(at)49games.de>
Subject : Re: OM: Image Sources
Ok, I guess this one is the most compact version possible:

var oImages = Dictionary.GetObject("Sources.Image").NestedObjects;

Good point of time for having a bit of weekend, thanks for all the help! :)

   -André


André Adam wrote:

That one works, cheers! :)

Bernard Lebel wrote:

Hi André,
If you are using XSI 5.0, you can use the nestedobjects property:


var oColl = XSIFactory.createobject( "XSI.Collection" ); oColl.items = "Sources.Image"

oImage = oColl(0);
oImages = oImage.nestedobjects;

if( oImages.count > 0 )
{
    for( var e = new Enumerator( oImages ); !e.atEnd(); e.moveNext() )
    {
        logmessage( e.item().fullname );
    }
}



Cheers
Bernard




On 1/20/06, André Adam <a_adam(at)49games.de> wrote:


Hi Bernard,

thanks, but this is similar to what I tried this morning. As long as
there are images in the scene, it works out well, but in case there are
no image sources, "Sources.Image.*" collects all sorts of other stuff,
which breaks the script. Looks like a bug to me actually, and a problem
for sure... EnumElements, as suggested by Guillaume, in contrast works
very well...

Thanks anyways! Cheers!

   -André



Bernard Lebel wrote:



var oImages = XSIFactory.createobject( "XSI.Collection" );
oImages.items = "Sources.Image.*"

for( var e = new Enumerator( oImages ); !e.atEnd(); e.moveNext() )
{
     logmessage( e.item().fullname );
}



Cheers
Bernard



On 1/20/06, André Adam <a_adam(at)49games.de> wrote:




Hi everybody!

Since I still miss my first cup of coffee this morning, anyone having a
quick suggestion how to access the scenes' Image Sources list through
the object model?


My current attempt looks as nasty as this:

var oImages = new ActiveXObject("XSI.Collection");
oImages.AddItems("Sources.Image.*");

The problem is, I collect all sorts of garbage this way in case there
are no image sources at all in the scene... (see below for the
collections' contents in such a case):

//INFO : Scene.Sources.Audio
//INFO : Scene.Sources.Animation
//INFO : Scene.Sources.Model
//INFO : Sources.Materials

Many thanks in advance for a quick hint! Cheers!

  -André


---
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



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