Hi Stephen, thanks for replying
So how do I get get all the local materials from an object ?
----- Original Message -----
From: Stephen Blair
To: XSI(at)Softimage.COM
Sent: Wednesday, April 25, 2007 3:22 PM
Subject: RE: [scripting] n00b
In the Script Editor, right-click, point to Syntax Help, and click Loop on
Selected Objects.
That will give you the corresponding VBScript for looping through a
collection of objects.
EnumElements gives you a collection of objects that are nested under
oObject.Material in the XSI data hierarchy.
________________________________
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf Of
Alexander Hemery
Sent: Wed 25 April 2007 4:03 AM
To: XSI(at)Softimage.COM
Subject: [scripting] n00b
Hello all,
I'm in need of a way to change the diffuse/ambient/spec values of all
materials (local/global) in a scene.
There's two types, Lambert and Phong and they all have textures connected.
Ideally I would like to change the Phongs to Lambert but that seems more
headacke right now. Changing the specular to black will do for now.
My scripting is very limited, I though of using two for each loops to go
through each object and through each object's materials, but I'm having a
hard time translating a JScript example I found in VBscript to get all the
local materials.
--
// Loop through the collection of materials
var e = new Enumerator(oObject.Materials);
for ( ; !e.atEnd(); e.moveNext() ) {
var oMat = e.item();
Application.LogMessage( "Found " + oMat );
--
And in VBscript I tried:
set e = EnumElements(oObject.Material)
which must be wrong cause I'm getting different results...
Any help would be greatly appreciated folks.
Overall, am I on the right track ? Is there an easier way of doing this ?
Many thanks in advance.
Alex.