Hello , Im new to maxscript and iv'e been doing some practice scripting basics to better understand it.
Ok, here it is.I'm trying to add a mousepoint handler to my script. The problem I'm having, is that im not sure where the placement for the event to go in and how to structure it. Any suggestion or guidance would be appreciated, Thanks.
global myFloater
(
try
closeRolloutFloater myFloater
catch()
myfloater = newRolloutFloater "My Rock" 200 300
rollout myRollout "Rock Pro"
(
global myBox
group "Rocksize"
(
spinner spnLen "Length: " range:[1.0, 10.0, 1.0] type:#worldunits
spinner spnWid "Width: " range:[1.0, 10.0, 1.0] type:#worldunits
spinner spnHei "Height: " range:[1.0, 10.0, 1.0] type:#worldunits
)
button createRock "MakeRock"
on createRock pressed do
(
sL = spnLen.value
sW = spnWid.value
sH = spnHei.value
myBox = box length:sL width:sW height:sH pos:worldPoint lengthsegs:5 widthsegs:5 heightsegs:5
myBox.name = uniqueName "Rock_"
select myBox
for i in selection do i.pivot = i.center
addModifier myBox (spherify())
addModifier myBox (turbosmooth())
myBox.spherify.percent = 100
)
tool create
(
local myBox
on mousePoint clickno do
if clickno == 1 then myBox = myBox pos:worldPoint else #stop
on mouseMove clickno do myBox.pos = worldPoint
)
)
)
addrollout myRollout myfloater
Anubis · 2010-07-13