Notifications
Clear all

[Closed] parameter 'get' handler

Greetings

I’m trying to link both a spinner and a slider UI element to the same parameter value and am getting an ‘unknown system exception’.

It has something to do with setting the spinner value form the get handler

Cheers

Mikie

The code is as follows:


KongJoints = attributes "Kong_Joints"
attribID:#(0x53457a9, 0x50adb433)
(

	parameters p1 rollout:rl_p1
	(
		neckTurn type:#float ui:neckTurnSL
		
		on neckTurn get val do
		(
			this.rl_p1.neckTurnSP.value = val
			val
		)
	)

	rollout rl_p1 "Neck/Head Sliders"
	(
		slider neckTurnSL "Neck Turn" width:150 range:[-45,45,0] type:#float ticks:10
		spinner neckTurnSP "" width:60 range:[-45,45,0] align:#right offset:[0,-55]
		on neckTurnSP changed val do (neckTurn = val)
		on neckTurnSL rightclick do ( neckTurn = 0; )
		on neckTurnSR rightclick do ( neckTurn = 0; )
	)
)

Forgot to mention…

for the time being I’m using:
neckTurn type:#float ui:(neckTurnSL,neckTurnSP)

just to drive both to the same value... but eventually I was hoping to do some extra math in the get hander to display a different value on the spinner vs the slider.
2 Replies

i would stay with:
neckTurn type:#float ui:(neckTurnSL,neckTurnSP)

it binds both controls. do extra math when you apply the value, show the original value in the spinner, and draw any ‘range’ values for the slider.

That’s simpler. I assumed you couldn’t do that to something that’s been bound to a value with the ui: property for some reason…

Thanks!