Binding Multiple UI's to the same controller?


#1

Hiya can anyone help with this please?

I’m trying to wire a spinner to a slider so that they both represent the same information. With the current set up I have, it looks like it’s working where you can keyframe either the slider or the spinner but actually the slider takes precedence. If you only interact with the slider then everything behaves as expected. If you keyframe the spinner you won’t see a keyframe appear in the timeline, the slider will jump to the correct position on that frame but then as you scrub it, the slider seems to only work with the keyframes made with the slider and the spinner works with it’s own keys which aren’t visible. I must be confused about something pretty fundamental as I thought they’d by linked to the same controller

attributes TEST_CA
(
    parameters main rollout:params
    (        
        sliderValue    type:#float    UI:sliderValue
    )

    rollout params "Parameters"
    (
        slider sliderValue         "Value"     Width:150 Height:16 Align:#Left Offset:[0,0] Type:#float Range:[0,100,0] Orient:#Horizontal Ticks:10 toolTip:"0 to 100" across:2 Controller:(Bezier_Float())
        spinner spinnerValue     "" Width:45 Height:16 Align:#Right range:[0, 100, this.params.sliderValue.value] Controller:this.params.sliderValue.Controller
    )
)

Thanks for any help


#2

Try this:

attributes TEST_CA
(
    parameters main rollout:params
    (        
        sliderValue type:#float UI:(sl_val, sp_val)
    )

    rollout params "Parameters"
    (
		local ctrl = bezier_float()
		
        slider  sl_val "value:" width:150 height:16 offset:[0,0] range:[0,100,0] ticks:10 tooltip:"0 to 100" controller:ctrl
		spinner sp_val ""       width:45  height:16 align:#right range:[0,100,0] controller:ctrl
        
    )
)

#3

Thank you so much PolyTools3D you don’t want to know how long this now seemingly simple thing has plagued me. Really appreciate it