I'm working on integrating Octane support for Relink Bitmaps and have come across a strange problem. This is regarding the integration of octane maps in the 3dsmax 2014 plugin - octane demo. Take a look.
Regarding problem 1: Octane attempts to load the bitmap when accessing the .filename property on all Octane specific maps Image_Texture/Alpha_Image_Texture, etc. Relink Bitmaps has to access the filename property to check if it exists (doesFileExist theMap.filename). No other map types/objects work like I'm seeing from Octane. Can anyone shed some light on this?
Problem 2: isProperty (octanemap) #filename - reports false...That's strange when "show Image_Texture" reports (correctly) that there is a filename property.
Check the below code which shows off both problems.
- Code: Select all
(
clearListener()
-- This code works fine and has no problem getting the property #filename in a BitmapTexture (not the bitmap is not attempted to be opened)
local bmaps = GetClassInstances BitmapTexture
if (bmaps.count > 0) then (
for m in bmaps do (
format "% filename: \"%\"\n" m.name m.filename
)
) else
format "No BitmapTexture in the scene\n"
/**************** PROBLEM #1 ****************/
-- Octane Problem with textures
-- This errors with a runtime error: -- Runtime error: Error opening bitmap: C:\Users\###\textures\04_FUNGUS.jpg
-- It shouldn't be attempting to open the bitmap when just accessing the #filename property
for m in (getClassInstances Alpha_Image_Texture) do (
print m.filename
)
-- Same thing for Image_Texture class
for m in (getClassInstances Image_Texture) do (
print m.filename
)
/**************** PROBLEM #2 ***************/
-- Amazingly this doesn't work even though there is a #filename property on Image_Texture class
local imgTexture = GetClassInstances Image_Texture -- Get the first Image_Texture in the scene
local bitTexture = GetClassInstances BitmapTexture -- Get the first BitmapTexture in the scene
if (bitTexture.count > 0) then
format "isProperty bitTexture[1] #filename = %\n" ((isProperty bitTexture[1] #filename) as string)
else
format "No BitmapTexture in the scene\n"
if (imgTexture.count > 0) then
format "isProperty imgTexture #filename = %\n" ((isProperty imgTexture #filename) as string)
else
format "No Image_Texture in the scene\n"
)