Message 1 of 4
Unexpected Filename from diffuseMap

Not applicable
08-24-2009
02:31 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I can't figure out where this filename is coming from in my output.
My scene has 2 materials. both have the diffuse channel mapped to an actual .dds file and should have readbale names in the output.
My script is saying the filename is {E39FE6C3-ABE1-40B6-AE4C-55F092CB08C9}, which looks more like a registry key than a filename! 😛
Anyone have suggestions on how that output is showing up?
The same script works on other scenes I have, but I don't see that value anywhere in the actual scene. I have one object - an asteroid. I have assigned my material to it several times to be sure, and that material has diffuse mapped to a .dds file.
Here is the material export part of my script:
EDIT:
I checked the name property of the material and it is indeed the correct material. The diffuse channel is mapped to "C:\users\cpisz.HOMENETWORK\documents\graphics\asteroid\asteroid02_diffuse.dds"
I am stupified.
My scene has 2 materials. both have the diffuse channel mapped to an actual .dds file and should have readbale names in the output.
My script is saying the filename is {E39FE6C3-ABE1-40B6-AE4C-55F092CB08C9}, which looks more like a registry key than a filename! 😛
Anyone have suggestions on how that output is showing up?
The same script works on other scenes I have, but I don't see that value anywhere in the actual scene. I have one object - an asteroid. I have assigned my material to it several times to be sure, and that material has diffuse mapped to a .dds file.
Here is the material export part of my script:
global MATERIAL_START = 0
-- Material type bytes
global STANDARD_MATERIAL = 0
-- Shader Types
global MAX_ANISOTROPIC = 0
global MAX_BLINN = 1
global MAX_METAL = 2
global MAX_MULTILAYER = 3
global MAX_OREN_NAYAR_BLINN = 4
global MAX_PHONG = 5
global MAX_STRAUSS = 6
global MAX_TRANSLUCENT = 7
-----------------------------------------------------------------------------------------------------------
-- ExportMaterial
--
-- @param rootMaterial - The root material to be written out to file
-- @param outFile - The opened binary file to write to
--
-- @throws error message string, if there was an error
fn ExportMaterial rootMaterial binFile =
(
format " Exporting Material...\n"
format " {\n"
writeByte binFile MATERIAL_START #unsigned
format " Material Start Marker\n"
format " Wrote Byte: %\n\n" MATERIAL_START
-- Standard Material
if classOf rootMaterial == standardMaterial then
(
writeByte binFile STANDARD_MATERIAL #unsigned
format " Standard Material Type\n"
format " Wrote Byte: %\n\n" STANDARD_MATERIAL
if rootMaterial.shaderType == MAX_BLINN then
(
writeByte binFile MAX_BLINN #unsigned
format " Blinn Shader Type\n"
format " Wrote Byte: %\n\n" MAX_BLINN
)
else
(
throw "Unsupported shader type used"
)
-- Ambient
if rootMaterial.ambientMapEnable == true then
(
writeByte binFile 1 #unsigned
format " Ambient Color Mapped\n"
format " Wrote Byte: %\n\n" 1
texMap = rootMaterial.ambientMap
if classOf texMap == BitmapTexture then
(
writeString binFile (filenameFromPath texMap.filename)
format " Ambient Color Filename\n"
format " Wrote String: %\n\n" (filenameFromPath texMap.filename)
)
else
(
throw "One or more materials mapped ambient to something other than a bitmap, which is not supported"
)
)
else
(
writeByte binFile 0 #unsigned
format " Ambient Color Not Mapped\n"
format " Wrote Byte: %\n\n" 0
writeFloat binFile (rootMaterial.ambient.r / 255.0)
writeFloat binFile (rootMaterial.ambient.g / 255.0)
writeFloat binFile (rootMaterial.ambient.b / 255.0)
writeFloat binFile (rootMaterial.ambient.a / 255.0)
format " Ambient Color RGBA\n"
format " Wrote 4 Floats: "
format "% " (rootMaterial.ambient.r / 255.0)
format "% " (rootMaterial.ambient.g / 255.0)
format "% " (rootMaterial.ambient.b / 255.0)
format "% \n\n" (rootMaterial.ambient.a / 255.0)
)
-- Diffuse
if rootMaterial.diffuseMapEnable == true then
(
writeByte binFile 1 #unsigned
format " Diffuse Color Mapped\n"
format " Wrote Byte: %\n\n" 1
texMap = rootMaterial.diffuseMap
if classOf texMap == BitmapTexture then
(
writeString binFile (filenameFromPath texMap.filename)
format " Diffuse Color Filename\n"
format " Wrote String: %\n\n" (filenameFromPath texMap.filename)
)
else
(
throw "One or more materials mapped diffuse to something other than a bitmap, which is not supported"
)
)
else
(
writeByte binFile 0 #unsigned
format " Diffuse Color Not Mapped\n"
format " Wrote Byte: %\n\n" 0
writeFloat binFile (rootMaterial.diffuse.r / 255.0)
writeFloat binFile (rootMaterial.diffuse.g / 255.0)
writeFloat binFile (rootMaterial.diffuse.b / 255.0)
writeFloat binFile (rootMaterial.diffuse.a / 255.0)
format " Diffuse Color RGBA\n"
format " Wrote 4 Floats: "
format "% " (rootMaterial.diffuse.r / 255.0)
format "% " (rootMaterial.diffuse.g / 255.0)
format "% " (rootMaterial.diffuse.b / 255.0)
format "% \n\n" (rootMaterial.diffuse.a / 255.0)
)
)
else
(
throw "Unsupported material type used"
)
format " }\n\n"
)
EDIT:
I checked the name property of the material and it is indeed the correct material. The diffuse channel is mapped to "C:\users\cpisz.HOMENETWORK\documents\graphics\asteroid\asteroid02_diffuse.dds"
I am stupified.