Update text with x.pos while rendering

Hi

hoefully a very very easy script.

I have one box. starting @ 0, it then moves to 50 along the x axis.
If it is animated over 50 frames, I want a text object to update on each frame with the x.pos of the box object.

So with this basic example, at frame 10, the text would be show "10".

It needs to update while rendering...surely this is possible??

Any Ideas?

Cheers

Dan

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
heaviside_rules's picture

Got a solution. I tried for

Got a solution. I tried for a long time to get the script given in the maxscript help topic "How do I change the text in a Text Shape dynamically?" to work (this is the script Dan was working on above) and never could. However, the modified text below works for me (Max 2009 SP1).

b=box name:"ControlBox" wirecolor:blue
t=text name:"ControlledText" wirecolor:red
t.baseobject.renderable=true
t.kerning.controller=float_script()
scrpt=" $'"+t.name+"'.text=$'"+b.name+"'.height as string\n0"
t.kerning.controller.script=scrpt
animate on at time 100 b.height*=2
max tool zoomextents all
playAnimation()

Ofer Zelichover's picture

Hi,  This has been asked

Hi,

 This has been asked alot, and there's an example in the maxscript help about this. Check out "How do I change the text in a Text Shape dynamically?" in the maxscript help.

 

Cheers,

youngdaniel's picture

I think this is very easy,

I think this is very easy, but everything I have tried has failed, surely someone can help me.
This if for a university project and I would appreciate any help?

I have tried working with this, but it doesnt work for me

b=box name:"ControlBox" wirecolor:blue
t=text name:"ControlledText" wirecolor:red
t.baseobject.renderable=true
t.kerning.controller=float_script()
scrpt="dependsOn
$'"+b.name+"';$'"+t.name+"'.text=$'"+b.name+"'.height
as string\n0"
t.kerning.controller.script=scrpt
animate on at time 100 b.height*=2
max tool zoomextents all
playAnimation()

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.