I'm sure it's something very simple that I'm just doing wrong...
Basically, I have a standard material with a texture in a diffuse map slot. The map holding the texture is the ordinary Bitmap map.
If I select an object assigned with this material and write this line into the listener:
$.material.diffuseMapthen I get an expected output saying
MyTexture:BitmapHowever, if I try to put it into an "if" statement and write:
if $.material.diffuseMap == Bitmap then print "yes it is Bitmap" else print "no it isn't Bitmap"then the output I'm getting is "no it isn't Bitmap"
Could anybody please tell me what I'm doing wrong?
Thanks!
David
Comments (2)
Comment policy
.
oh, I see. That solves it then. Thank you!
.
You can't compare class and instance of a class directly.
meditMaterials[1].diffuseMap == BitmapTexture >> false
meditMaterials[1].diffuseMap == Bitmap >> false
classOf meditMaterials[1].diffuseMap == Bitmap >> false
classOf meditMaterials[1].diffuseMap == BitmapTexture >> true
isKindOf meditMaterials[1].diffuseMap BitmapTexture >> true
isKindOf meditMaterials[1].diffuseMap.bitmap Bitmap >> true