re: Scripting - accessing Partition materials in non active Passes

Date : Thu, 24 May 2007 13:35:35 -0400
To : <XSI(at)Softimage.COM>
From : "briand(at)hatchling.com" <briand(at)hatchling.com>
Subject : re: Scripting - accessing Partition materials in non active Passes
This was posted on XSIbase


function InspectOverride(inPartition)
{
  // if nothing pass as argument use first selected object
  //
  if(!inPartition) inPartition = selection(0);
  if (inPartition) {
    // filter out non Group Selection
    //
    if (classname(inPartition) != "Group") {
      var rtn = XSIUIToolkit.Msgbox( "Not a Partition/Group",
          siMsgOkOnly, "Override Inspector" ) ;
    }
    else {
      // Get Local properties as properties collection object
      //
      var partOvdColl = inPartition.LocalProperties;
      for (var o = new Enumerator(partOvdColl); !o.atEnd(); o.moveNext())
      {
        oPartOvd = o.item();
        // filter out "VisibilityOverride"
        //
        if (oPartOvd.Parameters("Name").Value != "VisibilityOverride")
        {
          inspectObj(oPartOvd, null, "Override_Inspector", true);
        }
      }
    }
  }
}

InspectOverride();




From: "Adam Seeley" <adam.seeley(at)clearpost.co.uk>
Sent: Thursday, May 24, 2007 1:25 PM
To: XSI(at)Softimage.COM
Subject: Scripting - accessing Partition materials in non active Passes


Hi,

(in a nutshell)

Is there any way to access a Partitions Material when the Pass it belongs to isn't the Active one?



(not in a nutshell)

I'm creating a script that finds a the Material that has been assigned to a Partiton.
It's fine if the Pass is the current Pass, but is it possible to access a Partions Material if the Pass isn't the current one?

E.g.
Select a Partion in the current Pass with a Material applied and run

Set oSelection = application.selection(0)
logmessage "mat : " & oSelection.Material.Name

It will give you the Material name.
If you select a Partition that has a Material applied but it's Pass is not the current one, then the Material doesn't register (as per the Explorer view).

I could Set each Pass to Current as I go through them but that would slow the script a tad!


Thanks,

Adam.

(P.s. Still in VB land, but it probably won't matter.)


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.7.6 - Release Date: 20/05/2007 00:00


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