Hi guys! I'm working on a simple tool in maxscript for my own practice. The script works fine when I'm testing it out, however, when I shutdown max and start the tool for the first time, I get the following error: --Type error: Call needs function or class, got: undefined But when I close the rollout and re-run the exact…
Whoops, I meant to post my script. However, what you said makes sense! Thanks for the response. Testing it now. brb =] macroScript testScript category:"some category" toolTip:"" ( try(closerolloutfloater rof) catch("Dialog close error!") rollout test "Production Tools" ( group "Production Tools" ( button btn_K "tempTXTR"…
In your tool a function is being defined after it is used. It works on the second try because its defined at the end of the first pass. If you script is a single file, move all you function definitions to the top of the script. If you script is multiple files check this page for the evaluation order.…
Just a side note, I would change your function to: fn tempTXTR obj = ( obj.wirecolor = color 0 0 255 obj.material = meditMaterials[1] obj.name = "test") this way when you call your function you can add the "object" behind it, eg;on btn_K pressed do ( tempTXTR selection -- same as declaring obj = selection at the start of…