I have a scripted plugin derived from Material. I have several parameters of type #bitmap. I want to set them null their values, but I can’t; MaxScript just tells me the parameter takes bitmap type, got undefined. On top of all of this, I can’t just make a bitmap instance in memory and assign that because it wants me to save the damned thing to disk.
[QUOTE=seth.frolich;25021]I can’t just make a bitmap instance in memory and assign that because it wants me to save the damned thing to disk.[/QUOTE]
Juts looked at an older script and realized how I solved that - with a temp bitmap file.
fn getUndefinedBitmap =(
--filename uses the max temp folder
undefinedBmpPath=(getdir #temp) + "\\undefined.bmp"
--if it has not been made, make it
if ( not doesfileexist undefinedBmpPath ) then (
format "create file :%
" undefinedBmpPath
undefinedBitmap = bitmap 1 1
undefinedBitmap.Filename=undefinedBmpPath
save undefinedBitmap
) else (
format "file exists :%
" undefinedBmpPath
)
--open the temp bitmap to a new bitmap object
undefinedBitmap = openbitmap undefinedBmpPath
undefinedBitmap
)