PDA

View Full Version : Material and Texturemap Node ID?


galagast
02-10-2006, 06:44 AM
Hi, I'm just wondering if there's an equivalent of the inode.handle property of nodes for materials and texturemaps?

:)

reForm
02-23-2006, 03:34 PM
I'm wondering the same thing.

How do you identify a material uniquely, ie not with the .name of the material?

I'm trying to create an array of all unique materials in a scene. Any ideas?

galagast
02-24-2006, 12:41 AM
as a work around, what I sort of did was collect all the materials recursively into an array, then I used the array for indexing the materials. It's almost like building your own scenematerials. (although I'm guessing that it eats enough memory so just be sure to clear it whenever possible). One of the problems that you might encounter is that maps can have the same names, so if you were to query a texture by name, usually it would return the first occurance of the said texture.. so as another workaround, you can create another array parallel to the first one where you would then store additional info about the material/map... or to make things alot more easier, use structs to store everything... and some of the most useful bits of information that you can extract from a material are its dependents... but then using refs.dependents on every material/map can usually slow down your script... so I guess it would all boil down to what the scripter really needs...

just my two centavos.. :)

CGTalk Moderation
02-24-2006, 12:41 AM
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.