MikeOwen
01-23-2009, 11:48 AM
Ref. Thread: http://forums.cgsociety.org/showthread.php?f=98&t=658623&highlight=map+channel
Hi,
I'm trying to collect 2 separate array's which both identify any bitmap textures in the scene which may have a "bitmap" assigned to any channel of say, a material, but it could also be the environment channel, etc, but the filepath has not been assigned. ie: m.filename == ""
The first array will collect any materials in the scene currently assigned to objects/environment, etc and the second array will collect any materials ONLY in the mat.editor, which are missing the bitmaptexture filepath.
So far, I have:
NONEBitmaps = for m in getClassInstances BitmapTexture where (m.filename == "") collect m
However, I'm getting a bit confused with regard the best approach to obtain the actual materials or mat.editor slots from these references...!
I'm thinking something along the lines of:
dependentRefs = for n in 1 to NONEBitmaps.count where (refs.dependents NONEBitmaps[n] != 0) collect n
mats = for i in dependentRefs where (superClassOf i == material) or (classof i == MaterialLibrary) collect i
But I'm still a bit of the mark...!
Any help, as always, would be appreciated!
Thanks,
Mike
Hi,
I'm trying to collect 2 separate array's which both identify any bitmap textures in the scene which may have a "bitmap" assigned to any channel of say, a material, but it could also be the environment channel, etc, but the filepath has not been assigned. ie: m.filename == ""
The first array will collect any materials in the scene currently assigned to objects/environment, etc and the second array will collect any materials ONLY in the mat.editor, which are missing the bitmaptexture filepath.
So far, I have:
NONEBitmaps = for m in getClassInstances BitmapTexture where (m.filename == "") collect m
However, I'm getting a bit confused with regard the best approach to obtain the actual materials or mat.editor slots from these references...!
I'm thinking something along the lines of:
dependentRefs = for n in 1 to NONEBitmaps.count where (refs.dependents NONEBitmaps[n] != 0) collect n
mats = for i in dependentRefs where (superClassOf i == material) or (classof i == MaterialLibrary) collect i
But I'm still a bit of the mark...!
Any help, as always, would be appreciated!
Thanks,
Mike
