[Closed] Live tape meter using max script
Hello guys,
Is there a way in 3dsmax script to display the distance of two objects in the scene as you move one object away from another during an animation?
Like a live tape meter’s value being displayed as two object move apart?
Thanks,
virtextri
yes, there is. i tell you more… there are many ways to do it.
so you have to specify and better explain what you really need. do you need this distance be renderable or you want to get it just for a reference?
I just want it as a flat display(or rendered, which ever is the easiest way) as a reference and the value attached to the object in question so
I could see that ball#1 is 2 inches away and ball#2 is 5 inches away let say from the camera.
It would also be nice at the same time if I could save the distance in a text file per frame.
Sorry guys, it is sounding complicated. But thanks for answering my question.
–virtextri
Quick and dirty :
rollout TapeMeter "Distance finder" width:300 height:50 (
/
finding distance between 2 objects
/
local firstObject
local secondObject
button btnFirstObject "Select the first object" across:2
button btnSecondObject "Select the second object"
Label dst "Distance : " across:2
EditText txtDistance readOnly:True
fn removeTransformListenerOn o = (
deleteAllChangeHandlers()
)
fn addTransformListenerOn o = (
when transform o changes do (
txtDistance.text = (distance firstObject secondObject) as string
)
)
on btnFirstObject pressed do (
if firstObject != undefined then removeTransformListenerOn firstObject
clearSelection()
firstObject = pickObject rubberBandColor:yellow
addTransformListenerOn firstObject
)
on btnSecondObject pressed do (
if secondObject != undefined then removeTransformListenerOn secondObject
clearSelection()
secondObject = pickObject rubberBandColor:yellow
addTransformListenerOn secondObject
)
)
createDialog TapeMeter
You should only remove the change handler that was added