Hi,
I'm new to maxscript - but not to max. I wanted to create a rollout which would give some information about an object's animation : distance between next and previous frame, distance from the origin of the movement, etc...
I thought that it wouldn't be to hard to script... i was wrong ! the whole script works, except that i can't display the information in the rollout : i only can print it to the listener - which is not what i want. Here is a simple script that resume the problem :
---------- SCRIPT TEST -----------
if ((test_roll != undefined) and (test_roll.isdisplayed)) do (destroyDialog test_roll)
unRegisterTimeCallback refreshObjData
global objetSelect
global interfP1
fn objetFilter objetSelect = (superClassOf objetSelect == geometryClass)
fn refreshObjData =
(
frameP1 = currentTime +1
At time currentTime objPosX = objetSelect.pos.x
At time frameP1 objPosXP1 = objetSelect.pos.x
ecartSuivMm = (objPosXP1 - objPosX)
print ecartSuivMm
)
----------------
-- Rollout --
----------------
rollout test_roll "testUI"
(
label interfP1 "Intervalle f+1 : " align:#left pos:[10, 10]
pickbutton pbt_selObj "Select. objet" autoDisplay: true pos:[10, 40] width:80 filter:objetFilter
on pbt_selObj picked objetSelect do
(
if objetSelect != undefined do
(
select objetSelect
registerTimeCallback refreshObjData
)
)
)
createDialog test_roll 150 80
---------------
The whole thing is, i guess, about the refreshObjData function : how could i replace the "print ecartSuivMm" by something that would display the "ecartSuivMm" value in the rollout after the label "Intervalle f+1 :". I've search the maxscript help and found nothing. I'm sure the solution is quite simple but i have no idea left ! Please help me !!!
Anubis · 2009-08-29