[Closed] ** system exception **
another maybe lame question. this function:
fn DisplayLargeImage index =
(
rollout rl "large preview"
(
local path = masterArray[index].large_pic_path
bitmap bmp fileName: path
)
CreateDialog rl
)
when evaluated generates this:
** system exception **
I haven’t seen this message before. What does this mean ?
Hi
you may need to increase heapsize memory allocation (customize/preferences/Maxscript)
bitmap needs 2 arguments:
bitmap bmp "" filename:thePath
path seems to be a special word in maxScript
better use thePath, myPath, somePath …
what else is going on with your code I don’t know.
maybe you can post some more …
where and how is your masterArray defined?
Georg
I’m pretty sure it’s because you’re declaring a rollout inside a function. If you want to dynamically declare a rollout you need to use the rolloutCreator function.
well
fn DisplayLargeImage index =
(
rollout rl "large preview"
(
--local lpPath = masterArray[index].large_pic_path
--bitmap bmp filename:lpPath
)
CreateDialog rl
)
evaluates fine and works.
fn DisplayLargeImage index =
(
rollout rl "large preview"
(
local lpPath = masterArray[index].large_pic_path
bitmap lp fileName:lpPath
)
CreateDialog rl
)
gives the system exeption.
fn DisplayLargeImage index =
(
local lpPath = masterArray[index].large_pic_path
print lpPath
rollout rl "large preview"
(
bitmap lp fileName:lpPath
)
CreateDialog rl
)
evaluates, but the result is:
“//File-server/public/Proxy/green_stuff/scenes/BlueAgave/PreviewH.jpg”
MAXScript Rollout Handler Exception: – Unable to convert: ButtonControl:btn_default_pic_1 to type: FileName <<
the function is called here:
local btn_default_pic_name = "btn_default_pic_" + index as string
db_entries_roll_dinamic.addhandler btn_default_pic_name #pressed codestr:("DisplayLargeImage "+ index as string +" ")
Any ideas
I don’t really know what you’re doing here, but in my experience putting rollouts inside of functions to call from somewhere else only works if you don’t pass any arguments from the function into the rollout.
Maxscript doesn’t like the index value being passed from the function into the rollout definition, so the workaround I use is to not pass any values into the rollout, and instead use the rollout’s On Open event handler to call a separate function that sets a certain set of values to what you need them to be inside the rollout. Its tedious, but it works.
I also don’t call createdialog within the function where the rollout is defined… I’m not sure if it matters, but I’ll usually create a variable and call the rollout function into that variable so that it stores the rollout, then use createdialog on that variable.