newbie, simple path constraint script having problems with
Hi
I am trying to learn a bit of maxscript so i thought i would just do a simple path constraint script with a rollout!!
i am having problems getting the "go" button to add the "track" into the path contraint any help or advice would be great.
rollout Thomas "Thomas Train" width:162 height:169
(
pickbutton btn "--pick front train--" pos:[19,63] width:130 height:25
pickbutton btn9 "--pick track--" pos:[19,16] width:131 height:26
button btn3 "Go" pos:[22,109] width:128 height:29
--variables, the axis is 0-X axis, and thepath = the slinethe train will go on
--pick the train
on btn picked obj do
(
btn.text = obj.name
Thomas = obj
--if obj != undefined do
--Thomas.wirecolor = red
)
--pick the track
on btn9 picked obj2 do
(
btn9.text = obj2.name
thepath = obj2
--if obj2 != undefined do
--plastictrack.wirecolor = red
)
on btn3 pressed do
(
--select train named Thomas and apply a path contraint to the position controller
Thomas.pos.controller = Path_Constraint ()
Thomas.pos.controller.follow = on
Thomas.pos.controller.axis = 0
theConstraint = path_constraint()
--need to apply -btn9- the spline to the path constraint
--
Thomas.position.controller = theConstraint
theConstraint.path = thepath
)
)
(
createdialog Thomas
)
Comments
like this
bga