Message 1 of 4
Change Handler Runtime Error
Not applicable
10-10-2010
01:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi again everybody!
I'm having some trouble with a change handler. When I run a piece of code that executes the handler:
What happens when I execute the code is this:
Which is a problem because I expect the code to be executed often when there is no selection.
Secondly, I can't get the callback or handler to stop. It just keeps printing:
to the Listener. Even more confusing to me is that it prints whenever the viewport redraws instead of just when the selection changes.
I tried to set it like like it shows in the help file: How To ... Enhance the Morpher Modifier With Floating Controls
Thanks again for any tips. The help files are just so dang vague. It makes it really hard to get things to work right >:|
I'm having some trouble with a change handler. When I run a piece of code that executes the handler:
-- there's a rollout defined up here
on createCntrl close do
(
unregisterRedrawViewsCallback enableCheck
deleteAllChangeHandlers id:#controlOtron
global enabledCheck = undefined
) -- I did this to try and make the callback/handler stop when I close the window.
-- Does nothing as far as I can tell.
) -- end rollout
createDialog createCntrl 200 200
global enabledCheck -- declaring the fn as a global like it says in the help file
unregisterRedrawViewsCallback enableCheck
fn enabledCheck = print "poop"
registerRedrawViewsCallback enabledCheck
deleteAllChangeHandlers id:#controlOtron
when select selection changes id:#controlOtron handleAt:#redrawViews do enabledCheck()
) -- end of script
What happens when I execute the code is this:
-- Runtime error: group selection: selection empty
Which is a problem because I expect the code to be executed often when there is no selection.
Secondly, I can't get the callback or handler to stop. It just keeps printing:
"poop"
to the Listener. Even more confusing to me is that it prints whenever the viewport redraws instead of just when the selection changes.
I tried to set it like like it shows in the help file: How To ... Enhance the Morpher Modifier With Floating Controls
Thanks again for any tips. The help files are just so dang vague. It makes it really hard to get things to work right >:|