Notifications
Clear all

[Closed] Little bitty slider controls??

  1. The creation of unwanted keys by sliding along the time track

because with TimeCallback you set slider’s value which fires ValueChanged event which sets node’s value (height) and in animation node ON it creates a key.
so, you have set some flag (visible for ValueChanged event) to ignore this event if it was happened by TimeCallback

  1. Failure to unregister time callbacks.
   that's right. Unregister has to fail because you are trying to do it before the function declaration... I suggest you to register time callback on rollout open event and unregister on close.

Thanks for getting back to me so quickly! A couple issues though…

because with TimeCallback you set slider’s value which fires ValueChanged event which sets node’s value (height) and in animation node ON it creates a key.
so, you have set some flag (visible for ValueChanged event) to ignore this event if it was happened by TimeCallback

That’s a little over my head, can you explain it more for a noob?

that’s right. Unregister has to fail because you are trying to do it before the function declaration… I suggest you to register time callback on rollout open event and unregister on close.

Actually, I tried the unregister in several different places and it still would not work…

ok.

first of all you have to define the update function in the body of rollout (not in the body of onOpen rollout’s event). in this case the function might be visible for unregister. In the body of the update function set some flag “don’t set the node’s value again with ValueChanged event”. You have to do it before changing slider’s value. After you set slider’s value the ValueChanged event will be fired. On ValueChanged event you have to check state of this flag. If the flag is OFF you can set the node’s value (slider changed by used), if it’s ON – just reset it to OFF.


   fn updateSlider = 
   (
     slider.tag = 1 -- use slider's tag for example
     slider.value = thenode.height
   )
   on slider ValueChanged sender arg do 
   (
     if sender.tag == 0 then thenode.height = sender.value else sender.tag = 0 
   )	
   

you can unregister “update” functions when you removing subrollouts:


   unregisterTimeCallback subRollout.updateSlider
   -- and after
   removeSubRollout mainRollout subRollout
   

Thanks! I’ll give that a try and let you know how it work

there is an easier solution:
http://forums.cgsociety.org/showpost.php?p=6264750&postcount=441

Okay, took a little bit of extra tweaking but I’ve got it working now! Thanks for all the…

OMFG ARE YOU KIDDING ME??? (Just read the new post) :argh: :banghead:

Well thanks much anyway, I DID get it working, DID learn a lot, and DO now know more than I did. I’ll take a look at the new solution tomorrow, in the meantime I need some sleep

Page 2 / 2