I don't think you can query that from any component object. I guess you
will end up collecting all polygon clusters with local materials,
subtracting them from the object's polygon collection and test you
polygon in question against these resulting groups. And it will get even
more funny if polygon clusters used for material assignment accidetially
overlap.
-André
Matt Lind wrote:
Given a polygon, how do you determine (from scripting) which material
is active for that polygon?
I'm writing a tool to apply a custom operator to selected polygons.
One of the steps is to create a new polygon cluster and apply a copy
of the material which originated on the selected polygons so I can
retain the same look but isolate some features for manipulation by the
operator. Problem is that I cannot determine which material belongs
to the polygons.
Example:
Our modeler created a character and applied a new material with a
lambert shader attached. This material covers the entire character
and is dull grey. Later, one of our riggers created 50 polygon
clusters, each with it's own local material. So now the character has
51 materials total, 50 which are mapped to polygons via the clusters.
The original material (lambert) is a zombie material because it's not
mapped to any polygons as the clusters took all it's polygons away.
From scripting, if I query the object which material is current, XSI
returns the first applied material (lambert). Obviously this doesn't
do me any good. Other than doing the famous cluster traversal, how
can I find out which material(s) are applied to selected polygon(s)?
thanks,
Matt
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi