hi guys,
is there anyway to display floating text above an object using maxscript? (see example image)
hi guys,
is there anyway to display floating text above an object using maxscript? (see example image)
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
gw.updateScreen()
)
registerRedrawViewsCallback showObjectNames
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
with
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…
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
Because DX cached meshes are several dozen times faster?
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.