Notifications
Clear all

[Closed] Cannot assign spinner.controller in Max 5…?

[color=white]I have a script working in Max 6 and I’m getting the following error when using it in Max 5:[/color]

– Runtime error: Cannot directly assign rollout controls: myspinner

The error occurs on the assigning of a value (either undefined or an existing controller) to the .controller property of a UI spinner. It appears that this can only be assigned in Max 5 when the spinner is created…? (I find absolutely no mention of such a change in any version of the MaxScript docs, which makes me wonder if I’m simply doing this wrong.)

Has anyone encountered this problem, or confirm that only Max 6 and above has this feature?

2 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

I tried in Max 8 first and it worked, which is a surprise because it is not documented!
According to the Reference, controller is only a creation parameter but not a property.
So I fired up my dusty Max 5 to see what it going on… No, it gives the same error message you’ve got.
Went to Max 6 – it worked there!
So it seems that the change has been made in Max 6 and I have missed it. I will add this in the next revision of the Reference…

Sorry!

Cheers,
Bobo

Thanks for the confirmation, Bobo.

You might also include a very brief mention in the next docs that assigning a controller to a spinner (using the property or the creation parameter) automatically synchronizes the appearance of the controller elsewhere in the UI, and automatically enables/updates the red Key Brackets for the spinner. This eliminates most/all of the need for an event handler.

This behavior might seem obvious to a programmer, and I certainly should have expected it myself…but I was totally surprised by it last month. I’ve used spinners for 2 years, but until now it was only for manipulating floats/integers held in variables.

I’ll bet that many novices aren’t aware of this feature…it sure makes for simpler scripting.