trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

Save image error on mac 'CocoaAlternateEventLoop'

Open michaelprummer opened this issue 1 year ago • 2 comments

When I try to save a scene I get the following error:

Call: img = scene.save_image((512, 512), visible=True) Error: 'CocoaAlternateEventLoop' object has no attribute 'platform_event_loop'

I can not find anything related to this error, did someone else encounter this?

I am using trimesh 4.05 with python 3.12

michaelprummer avatar Nov 30 '23 22:11 michaelprummer

Same here! Using Mac OSX Ventura with python 3.10 and trimesh 4.05. Have you found a fix? It seems like it's maybe a problem with pyglet?

ishan-gaur avatar Dec 05 '23 05:12 ishan-gaur

I ended up fixing this by disabling the alternate event loop entirely. I just commented it out in the source file, but it looks like there is a proper way to do this by passing in an option to pyglet. Linked the file below. I got rid of lines 48 and 49.

https://github.com/pyglet/pyglet/blob/a6e2b23ccb20a8f80e3d60201e2b74c9c404a488/pyglet/app/init.py#L47

ishan-gaur avatar Dec 05 '23 06:12 ishan-gaur