Re: Checking for a material name with jscript

Date : Thu, 4 Oct 2007 19:14:24 -0500
To : XSI(at)Softimage.COM
From : "Gene Crucean" <emailgeneonthelist(at)gmail.com>
Subject : Re: Checking for a material name with jscript
Perfect, thanks guys.




On 10/4/07, Bernard Lebel <3dbernard(at)gmail.com> wrote:
You might want to use a XSICollection. I don't have XSI in front of
me, but that would look like:

oColl = XSIFactory.createobject( "XSI.Collection" );
oColl.items = "Sources.Material.*.material name";

if( oColl.count > 0 )
    blah


To find out the actual string to use, select the material object with
command logging enabled. Replace the library name by a wildcard.



Cheers
Bernard



On 10/4/07, Gene Crucean <emailgeneonthelist(at)gmail.com> wrote:
> So I need to check and see if a material has a specific name in my scene, if
> it doesn't exist, I need to create it. If it does then I need to apply it.
>
> Can anyone help me with some jscript? Or samples. Keep in mind I'm scripting
> retarded :)
>
>
>
>
> if(MyShader shader exists);
>   (
>      apply shader to partition;
>    )
> else
>   (
>      create shader and apply to partition;
>   )
>
>
>
> Cheers
> Gene
>
---
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.