bop_toolkit icon indicating copy to clipboard operation
bop_toolkit copied to clipboard

Unable to create more than one vispy renderer because of singleton

Open Usaali opened this issue 3 years ago • 0 comments

Hi, I was trying to get the render_train_imgs.py script to run and encountered a problem. I am not sure if its related to my python version or to the vispy renderer implementation, as i never worked with singletons before.

When creating a second renderer, for example a depth renderer after having an rgb renderer already, the singleton function returns the first renderer object instead of creating a second renderer. This means that the call to renderer.create_renderer returns fine but instead of having a depth renderer, it is the same rgb renderer object created by the previous call. image

For now i fixed it by adding the object to the instances dictionary in the singleton function with the mode instead of the class as a key, but this is more of a hotfix than an actual clean solution. image

Usaali avatar Jul 07 '22 20:07 Usaali