registerTimeCallback

Hello!

I want to create events on the time slider changes. The registerTimeCallback can define functions based on the time slider "tick"ing, but i can't unRegister them.

The maxscript help says:

fn time_p = print currentTime
registerTimeCallback time_p

but if i write this...:

unRegisterTimeCallback time_p

... nothing change. The function keeps working when i move the time slider.

Anybody knows how can i turn OFF the functions in these cases?

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Malkalypse's picture

Nope

Changing a function or setting it to undefined once a registerTimeCallback has been set will not change the behavior of the callback.

From the doc: Note that it is the function value that is being registered, not the function name or global variable. This means that redefining the same-named function after registering it does not change the callback. You either need to unregister, re-define the function and then register it again, or make the registered function an intermediary which calls another function

barigazy's picture

In max2012 this works

In max2012 this works

fn time_p = print currentTime
registerTimeCallback time_p
------------------------------
unregisterTimeCallback time_p


I don't know which max version have problem with
unregisterTimeCallback fn.

bga

holycause's picture

like this? time_p =

like this?

time_p = undefined

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.