- Type error: Call needs function or class, got: undefined PLEASE HELP!!!!
I get this error, if even BitmapLister is global! Please HELP!!!!
Here is the script:
macroScript Bitmaps category: "artrender" ( try(destroydialog ::BitmapLister)catch() bitmaps=#() GLOBAL BitmapLister cur_obj_selection=#() BitmapLister_iso_x = getinisetting "$plugcfg\\RacoonScripts.ini" "BitmapLister" "pos_x" as integer BitmapLister_iso_y = getinisetting "$plugcfg\\RacoonScripts.ini" "BitmapLister" "pos_y" as integer BitmapLister_size_h = (if (tmp = (getinisetting "$plugcfg\\RacoonScripts.ini" "BitmapLister" "size_h" as integer)) == 0 then 324 else tmp) BitmapLister_size_w = (if (tmp = (getinisetting "$plugcfg\\RacoonScripts.ini" "BitmapLister" "size_w" as integer)) == 0 then 152 else tmp) numBitmaps = 0 function enable_event = ( callbacks.addScript #selectionSetChanged "check_selection()" id:#m3dLearnEvent ) function disable_event = ( callbacks.RemoveScripts #selectionSetChanged id:#m3dLearnEvent ) ------------------------------ function check_selection = ( this_sel_count = (selection as array).count BitmapLister.lbl_num_picked.text = "num picked: " + (this_sel_count as string) ) rollout BitmapLister "Maps" width:231 height:65 ( label lbl_num_picked "Num Picked: 0" pos:[380,20] width:62 height:40 dotNetControl lv "System.Windows.Forms.ListView" width:657 height:200 pos:[5,100] on BitmapLister close do ( disable_event() setinisetting "$plugcfg\\RacoonScripts.ini" "BitmapLister" "pos_x" ((GetDialogPos BitmapLister).x as string) setinisetting "$plugcfg\\RacoonScripts.ini" "BitmapLister" "pos_y" ((GetDialogPos BitmapLister).y as string) setinisetting "$plugcfg\\RacoonScripts.ini" "BitmapLister" "size_w" ((GetDialogSize BitmapLister).x as string) setinisetting "$plugcfg\\RacoonScripts.ini" "BitmapLister" "size_h" ((GetDialogSize BitmapLister).y as string) ) on BitmapLister open do ( check_selection() enable_event() ) ) createdialog BitmapLister pos:[BitmapLister_iso_x,BitmapLister_iso_y] height:(BitmapLister_size_h) width:(BitmapLister_size_w) style:#(#style_resizing,#style_sysmenu,#style_titlebar) )
Comments
I'll worry about your
I'll worry about your
check_selection
function.It s'd be visible for
callbacks.addScript()
.Also maybe is good to make it more robust:
And I'll suggets to move functions
fillInList
andinitListView
inside BitmapLister rollout, and then the last command in those function will become:BitmapLister.fillInList BitmapLister.lv
i.e.:
my recent MAXScripts RSS (archive here)
Yep. you are right. No need
Yep. you are right. No need to be outside roll definition.
bga
example
bga
STILL THE SAME ERROR
I want to thank you for this help! Srry that I disturb you, but I've tried your code at two computers, and it's giving the same error! I've tried to put after this GLOBAL BitmapLister and it does not help also! Please, tell me! The error appears after selecting any object in scene!
Also, restart 3d max (not reset), and try! It may happen that after many times of trying in the same scene, it could start working! this happend to my previous scripts! But they should work even from the start!
try now
bga
THANK YOUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU!
I'M SO HAPPY! THANK YOU, BARIGAZYYYYYYYYYYYYYYYYYYY!
:) :) :)
Cheers dude!
bga