6foot5
10-27-2006, 01:56 AM
hi, im new to scripting and decided to make a wheel rotation script as my first attempt but i soon encounterd a problem:
i created a utility interface which allows the user to select his car body and four wheels via 'pickbuttons'
but i wanted to create a message to show if the user inadvertently picked geometry already assigned to another pickbutton.
eg. if the user picked box01 via the 'pick car body' button and then tried to pick the same box when using the 'pick front left wheel' button a warning message would appear.
yet although i thought i worded it correctly , no message box appears!
any pointers would be appreciated, thanks.
here is the script so far:
utility wheelscript "Wheel Rotation"
(
fn testclass obj = superclassof obj == GeometryClass
pickbutton car "Pick Car" filter:testclass
pickbutton frontleft "Pick front left wheel" filter:testclass
pickbutton frontright "Pick front right wheel" filter:testclass
pickbutton backleft "Pick back left wheel" filter:testclass
pickbutton backright "Pick back right wheel" filter:testclass
On car picked obj do
( if obj==frontleftobj then
messagebox "pick unassigned object please"
else
carobj=obj
)
On frontleft picked obj do
( if obj==carobj then
messagebox "pick unassigned object please"
else
frontleftobj=obj
)
)
i created a utility interface which allows the user to select his car body and four wheels via 'pickbuttons'
but i wanted to create a message to show if the user inadvertently picked geometry already assigned to another pickbutton.
eg. if the user picked box01 via the 'pick car body' button and then tried to pick the same box when using the 'pick front left wheel' button a warning message would appear.
yet although i thought i worded it correctly , no message box appears!
any pointers would be appreciated, thanks.
here is the script so far:
utility wheelscript "Wheel Rotation"
(
fn testclass obj = superclassof obj == GeometryClass
pickbutton car "Pick Car" filter:testclass
pickbutton frontleft "Pick front left wheel" filter:testclass
pickbutton frontright "Pick front right wheel" filter:testclass
pickbutton backleft "Pick back left wheel" filter:testclass
pickbutton backright "Pick back right wheel" filter:testclass
On car picked obj do
( if obj==frontleftobj then
messagebox "pick unassigned object please"
else
carobj=obj
)
On frontleft picked obj do
( if obj==carobj then
messagebox "pick unassigned object please"
else
frontleftobj=obj
)
)
