Spinner Help Please

Hello

I need to be able to get the values from a spinner into a piece of code that allows me to translate something.
So far i have this:

spinner spn_spinnerx "Translate Matrix X Amount"
spinner spn_spinnery "Translate Matrix Y Amount"
spinner spn_spinnerz "Translate Matrix Z Amount"

button translate_matrix "Translate Matrix"
on translate_matrix pressed do
(
mytransM = transMatrix [spn_spinnerx, spn_spinnery, spn_spinnerz] -----Here i need help i think
mymatrix= mymatrix*mytransM
)

Would love some help

Thanks

Comments

Comment viewing options

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

...

on translate_matrix pressed do
(
mytransM = transMatrix [spn_spinnerx.value, spn_spinnery.value, spn_spinnerz.value]
mymatrix= mymatrix*mytransM
)

barigazy

Shade926's picture

Error

I added that into my code and it comes back with this:

>> MAXScript Rollout Handler Exception:
-- Unknown property: "value" in undefined <<

The script looks like this now:

button translate_matrix "Translate Matrix"
on translate_matrix pressed do
(
mytransM = transMatrix [spn_spinnerx.value, spn_spinnery.value, spn_spinnerz.value]
mymatrix= mymatrix*mytransM
)

spinner spn_spinnerx "Translate Matrix X Amount"
spinner spn_spinnery "Translate Matrix Y Amount"
spinner spn_spinnerz "Translate Matrix Z Amount"

Any ideas???

barigazy's picture

:)

Your spinner definition need to be above the "on translate_matrix pressed ..."

barigazy

Shade926's picture

:)???

When i put the spinner definition in the listener the matrix becomes undefined??

barigazy's picture

...

You need to place all controls (spinners,butons etc..) inside rollout to get a value. Try to learn basic stuffs and then start to play with this.

rollout test "Test"
(
	local mymatrix = matrix3 1
	spinner spn_spinnerx "Translate Matrix X Amount"
	spinner spn_spinnery "Translate Matrix Y Amount"
	spinner spn_spinnerz "Translate Matrix Z Amount"
	button translate_matrix "Translate Matrix"
	on translate_matrix pressed do
	(
		mytransM = transMatrix [spn_spinnerx.value, spn_spinnery.value, spn_spinnerz.value] -----Here i need help i think
		mymatrix = mymatrix*mytransM
		format "mymatrix = %\n" mymatrix

This video training is very good for start http://www.scriptspot.com/3ds-max/tutorials/maxscript-101-free-online-tr...
)

)
createdialog test

barigazy

Comment viewing options

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