-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"TypeError: 'NoneType' object is not callable" when calling Renderer.render_text() #284
Comments
Hi! it seems that the issue is related to using I upgraded pyopenGL to it's latest version and I can render again with text.
pyrender might complain about a mismatch version, but at the moment everything is running without any issues. |
That did not work for me.
I don't know if this is really related to the version mismatch, but I didn't had that error before. |
For the moment, I found a workaround which is at least acceptable. # # workaround for bug in PyOpenGL
try:
# original content of render_text(...)
except ctypes.ArgumentError:
label = pyglet.text.Label(text, font_name=font_name, font_size=font_pt, anchor_x=ANCHORS_X[align],
x=x, y=y, color=[int(c*255) for c in color], anchor_y=ANCHORS_Y[align])
label.draw() using the global arrays ANCHORS_X = ['center', 'left', 'right',
'left', 'right', 'center',
'left', 'right', 'center']
ANCHORS_Y = ['center', 'center', 'center',
'bottom', 'bottom', 'bottom',
'top', 'top', 'top'] At least, it works and the text is displayed again, although I know there are some drawbacks:
Hence, this is not a solution but at least a workaround until the underlying problem is fixed. |
OS: Ubuntu 24.04
pyrender: 0.1.45
pyglet: 2.0.15
PyOpenGL: 3.1.0
trimesh: 4.3.2
When I try to turn rotation on by pressing 'a', I get the following error log:
That has nothing to do with the actual rotation, but calling
render_text(...)
on the renderer object causes this problem.Since I use this function in my application to display various crucial information, I need some functional text rendering.
Although this problem seems to be related to the PyOpenGL library when loading texture for fonts, do you know if there's any workaround to show text until this bug is fixed in the library?
The text was updated successfully, but these errors were encountered: