Доброго времени суток!
MAXScript выкидывает сообщение об ошибке при попытке исполнения скрипта. Rollout создается, однако, при попытке выбрать объект обработчик pickbutton не срабатывает. Какого рода исключение может скрываться под **system exception** (гуглил — пусто, справку перелопатил — в коде вроде все ок)?
Злополучный скрипт
(
local theMesh
fn filterMesh obj = (
classOf obj == Editable_Mesh
)
rollout IntersectWithMesh "Intersection with mesh" (
timer timerControl interval:50 active:false
pickButton pickMesh "Pick mesh" width:280 filter:filterMesh
editText faceHit "Face index:"
editText normalHit "Normal vector:"
editText worldHit "World coords:"
editText baryCoords "Barycentric coords:"
)
on pickMesh picked obj do (
if obj != undefined do (
theMesh = obj
pickMesh.caption = obj.name
timerControl.active = true
)
)
on timerControl tick do (
theRay = mapScreenToWorldRay mouse.pos
theInt = IntersectRayEx theMesh theRay
if theInt != undefined then (
faceHit.text = theInt[2] as string
normalHit.text = theInt[1].dir as string
worldHit.text = theInt[1].pos as string
baryCoords.text = theInt[3] as string
) else (
faceHit.text = normalHit.text = worldHit.text = baryCoords.text = ""
)
)
createDialog IntersectWithMesh width:300
)
Доступ к резюме доступен только по пакетному доступу HR менеджерам зарегистрированных компаний. Узнать о вариантах корпоративных пакетов можно по ссылке.
Артур Сиятелев
MAXScript выкидывает сообщение об ошибке при попытке исполнения скрипта. Rollout создается, однако, при попытке выбрать объект обработчик pickbutton не срабатывает. Какого рода исключение может скрываться под **system exception** (гуглил — пусто, справку перелопатил — в коде вроде все ок)?
Злополучный скрипт
( local theMesh fn filterMesh obj = ( classOf obj == Editable_Mesh ) rollout IntersectWithMesh "Intersection with mesh" ( timer timerControl interval:50 active:false pickButton pickMesh "Pick mesh" width:280 filter:filterMesh editText faceHit "Face index:" editText normalHit "Normal vector:" editText worldHit "World coords:" editText baryCoords "Barycentric coords:" ) on pickMesh picked obj do ( if obj != undefined do ( theMesh = obj pickMesh.caption = obj.name timerControl.active = true ) ) on timerControl tick do ( theRay = mapScreenToWorldRay mouse.pos theInt = IntersectRayEx theMesh theRay if theInt != undefined then ( faceHit.text = theInt[2] as string normalHit.text = theInt[1].dir as string worldHit.text = theInt[1].pos as string baryCoords.text = theInt[3] as string ) else ( faceHit.text = normalHit.text = worldHit.text = baryCoords.text = "" ) ) createDialog IntersectWithMesh width:300 )igorznag
Правильно будет так:
( local theMesh fn filterMesh obj = ( classOf obj == Editable_Mesh ) rollout IntersectWithMesh "Intersection with mesh" ( timer timerControl interval:50 active:false pickButton pickMesh "Pick mesh" width:280 filter:filterMesh editText faceHit "Face index:" editText normalHit "Normal vector:" editText worldHit "World coords:" editText baryCoords "Barycentric coords:" on pickMesh picked obj do ( if obj != undefined do ( theMesh = obj pickMesh.caption = obj.name timerControl.active = true ) ) on timerControl tick do ( theRay = mapScreenToWorldRay mouse.pos theInt = IntersectRayEx theMesh theRay if theInt != undefined then ( faceHit.text = theInt[2] as string normalHit.text = theInt[1].dir as string worldHit.text = theInt[1].pos as string baryCoords.text = theInt[3] as string ) else ( faceHit.text = normalHit.text = worldHit.text = baryCoords.text = "" ) ) ) createDialog IntersectWithMesh width:300 )Артур Сиятелев
Спасибо!