CyHiSo
10-12-2008, 05:29 PM
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?
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?
