displaying text overlays in the viewport (floating on objects)


hi guys,

is there anyway to display floating text above an object using maxscript? (see example image)


Hi Aeron,

Search for gw.text



This is a piece of code that Bobo showed at this year’s Siggraph MaxScript class. I think this is exaclty what you need:

unRegisterRedrawViewsCallback showObjectNames
fn showObjectNames=
gw.setTransform(Matrix3 1)
for o in objects where not o.isHidden do
gw.text o.pos (o.name) color:yellow
gw.text (o.pos+[0,0,-2]) (o.pos as string) color:yellow
gw.enlargeUpdateRect #whole
registerRedrawViewsCallback showObjectNames

I’ve already used it to make a script that shows the name and coordinates of some objects in the scene. It saves a lot of time when doing camera tracking.


To make it a single line, you can also replace the code lines

gw.text o.pos (o.name) color:yellow
gw.text (o.pos+[0,0,-2]) (o.pos as string) color:yellow


gw.text o.pos (o as string) color:yellow

because the MXS object signature shows both the class, the name and the position of the object…


Cool, these “gw” functions open up a lot of new possibilities…


thanks for the help guys,

there’s a problem though: when i execute the script the text is sometimes displayed, sometimes not at all. when it is displayed at first, it disappears when i pan the viewport or do anything else the causes a redraw

am i missing something?


they didn’t disappear when I moved around the viewport, although they were very flickery…I am not sure why they would have such a poor redraw rate since I have a quadro 3000, unless they are all getting slowly interpreted through max


i have a quadro 3000 as well

i just tested with various drivers… opengl and maxtreme work great, directx: nada


The question is why were you using directx in the first place?


Because DX cached meshes are several dozen times faster? :wink:
Of course, if you have MAXtreme, performance should be similar.


This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.