How to check if normal map is mapped and read the map?
V3Digitimes
Posts: 3,150
Hello,
I'm trying to grab the normal maps of a material, and for that of course I begin by checking the "oProperty.isMapped".
It works for the other maps (Diffuse, bump, ...). But for normal map I keep on having the message saying :
for the code :
if ((oNames == "Normal Map") && oProperty.isMapped())
Script Error: Line 680
TypeError: Result of expression 'oProperty.isMapped' [undefined] is not a function.
The same way, I cannot use the getMapValue on the property.
Yet I do exactly as I do for other surfaces?
Does any one has a clue if there is something specific with normal maps?
Comments
Normal maps are not Colors or Floats (no default value); most likely they are ImageProperties, so use something like this:
If you put
print( oNames + " is a " + oProperty.className() );
in your script, at a point where those are defined, you can get a list of the object types for the properties (to the bottom of the ScriptIDE if you are running from there, or to the log file if you are running from a script file).
Thanks a lot both for your help!
Indeed, when I run the script, "Normal Map is a DzImageProperty".
I totally ignored Normal maps were treated differently.
Now I just have to find out what I'm gonna do with that!