[Closed] registerRedrawViewsCallback problem
Hi everybody!
I wanna learn more about text displaying in the viewports.I wrote a small script that shows me grid size in the corner of viewport.I registered it with registerRedrawViewsCallback and its works fine. But, when i tried launch script like this(i found it here,on cgtalk) :
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,-10]) (o.pos as string) color:yellow
)
gw.enlargeUpdateRect #whole
gw.updateScreen()
)
registerRedrawViewsCallback showObjectNames
showObjectNames()
i met some problem.I see name and position of selected object,but callback don’t work.And text dissapears,when ia move pan,zoom viewport , etc. I tried this script both at work and at the home, but it doesn’t work. What am i doing wrong?
can’t say I can help – it works fine here… 3ds Max 2009, 32bit, SP1
Edit: try switching drivers / playing with driver settings, perhaps
Hi,Richard!
i tried to switch max display driver to Open GL and everything worked fine.But in Direct3D it doesn’t want to work on 3dsmax2008 , GeForce 7600, 178.13 driver version at office
and on GeForce 8800 GT at home. What dirver settings might be responsible for this bug?
if I had to guess – and that’s what it would be, a total guess… Direct3D has been guaranteed bluescreen-material on my computers – I’d say the “Use Incremental Scene Updates” option would appear to be suspect… either that one or “Use Cached D3DX Meshes”
I played with this options, but nothing change to better
when i evaluate script , vertex position flashes once and dissapears forever
well, time to change to OpenGL
Other users will have to step in here, but as far as I can tell the code is solid; and it working in OpenGL for you seems to indicate that it is.