PDA

View Full Version : Coffee : Get objects a material is assigned to


Little_Devil
11-18-2009, 01:43 PM
hi,

i've got an object with a xpresso tag on it. inside the xpresso tag is a coffee node. i want
to check the object if the material assigned to it is exclusively assigned to this object. if
not it should duplicate the current material and assign it to the object.

i know how to create a new material, copy the old values and assign it, but i have no idea
how to do the search stuff.

it seems to me that neither BaseDocument nor BaseMaterial contain a function to return
the number/names of objects assigned to a material. i guess i have to use the BaseTag
class and iterate through every tag and every object in the scene.

at the moment i am trying to understand this container thing in coffee and could write a lot
more here, but i think this wouldn't help much. so my questions are :

1. Is this the right way to do this / are there easier ways to do it ?
2. is there a lib or a code snip available for lazy people like me ?
3. maybee some coffee keyword(s) i should focus on or a code snip of a compareable problem ?

i know my coffee knowledge is very small, but i have somehow to get through this :)

thanks in advance,
ferdinand

CGTalk Moderation
11-18-2009, 01:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.