Hi!
I’m new here, and fairly new to maxscript (about a month and a half) I’m managing to do quite a lot with it, and i’ve coding for quite some time on other languages before. anyway. My current script is having a really strange bug…
It doesn’t crash or anything, except that it blocks the whole interface except for the script editor… and it does the “ping” sound when you click anywhere.
It basically acts as if there was a modal dialog window opened somewhere, but doesn’t show it. Pressing enter or esc doesn’t do anything.
And my script isn’t in a loop, it’s an empty scene as well.
I did register some callback events and I’m thinking it might be coming from here ( cause before i registered them, it used to work fine )
It doesn’t “hang” right after the start of the script, but after I used some features of my script, but I’ve checked that my GUI isn’t blocked in one of its event handler. it’s Idling afaik and exiting the handler fine.
So you have to kill max if you want to do anything with it.
I’ll update this thread if I manage to solve my problem before anyone answers.
EDIT 01- I commented the CallBacks and the bug disappears completely… now let’s try to identify which of them is messing with us
LayerSortInst = ACxM_SortLayers Layers:Layers
/*
fn CallbackRenamed ev nd = (
MarioPlumber.LayerSortInst.ProcessOne (GetByHandle nd[1])
)
callbackItem = NodeEventCallback mouseUp:true delay:1000 nameChanged:CallbackRenamed
callbacks.addScript #nodeCreated "MarioPlumber.LayerSortInst.ProcessOne (callbacks.notificationParam())" id:#ACxMulti_SortObj
callbacks.addScript #filePostMerge "MarioPlumber.LayerSortInst.ProcessAll()" id:#ACxMulti_SortObj
callbacks.addScript #postImport "MarioPlumber.LayerSortInst.ProcessAll()" id:#ACxMulti_SortObj
callbacks.addScript #NodeCloned "MarioPlumber.LayerSortInst.ProcessOne (callbacks.notificationParam())" id:#ACxMulti_SortObj
*/
(this basically aims to sort any node into the right layer, whenever we create, add(merge/import), clone, rename a node. )
Edit 02 -
Ok I think I’ve fixed it… Doesn’t happen anymore, (so far)
I added at the very start of the script a “removeCallback” just to be sure they’re not already registered.
uncommented my callbacks, one by one, trying the script, and it works…
So weird…
gonna keep testing.
Edit 03 - GAAAAAh the little B****** he’s back, and my code hasn’t changed >_< since edit 2… just been playing with the script to test it. now it Randomly happens.