Added to vismach.py:
# capture current transformation matrix
class Capture:
def __init__(self):
self.transform = []
def capture(self):
self.transform = glGetDoublev(GL_MODELVIEW_MATRIX)
And inside class O:
def redraw(self, *args):
if self.winfo_width() == 1: return
self.model.traverse()
print tooltip.transform <---- added
Added to scaragui.py:
global tooltip
tooltip = Capture()
tool = Collection([
tooltip,
Sphere(0.0, 0.0, tool_len, tool_dia),
CylinderZ(tool_len, tool_radius, tool_dia, tool_radius),
CylinderZ(tool_dia, tool_radius, 0.0, 0.0)])
result:
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__
return self.func(*args)
File "/usr/lib/python2.4/lib-tk/Tkinter.py", line 456, in callit
func(*args)
File "/home/jmkasunich/emcdev/emc2head/lib/python/vismach.py", line 347, in update
t.tkRedraw()
File "/home/jmkasunich/emcdev/emc2head/lib/python/rs274/OpenGLTk.py", line 496, in tkRedraw
self.redraw(self)
File "/home/jmkasunich/emcdev/emc2head/lib/python/vismach.py", line 331, in redraw
print tooltip.transform
NameError: global name 'tooltip' is not defined