Re: [scripting] n00b

Date : Wed, 25 Apr 2007 08:59:27 -0400
To : XSI(at)Softimage.COM
From : "Bernard Lebel" <3dbernard(at)gmail.com>
Subject : Re: [scripting] n00b
There is only *one* local material on an object. You can access it at
any time through its the LocalProperties attribute. However, if you
read the Material attribute or get it via the Properties attribute,
then you will get the inherited material. This happens when you
branch-apply a material on a parent or apply the material through a
group, layer, partition, etc.

If you mean cluster materials, run through the polygon clusters of the
object and then loop through their LocalProperties.


Cheers Bernard



On 4/25/07, Alexander Hemery <vortex(at)fhw.gr> wrote:


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.

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