Re: [PyMOL] Capturing scene pixels without writing image to disk

2020-05-07 Thread Thomas Holder
Calling cmd.draw() will schedule a rendering event to be executed in the rending loop. This means the command will return before the image was rendered. The only way to access the result is with a callback, which will be asynchronous with the script you're executing. Calling cmd.png() is relate

Re: [PyMOL] Capturing scene pixels without writing image to disk

2020-05-06 Thread Antonio Serrano
Thx for your quick response, Thomas. Please, could you elaborate the previous example a little bit further? I'm a little confused about what you can accomplish using the callback function you posted. Thx -- "Este mensaje es privado y confidencial y se dirige exclusivamente a su destinatario. Si

Re: [PyMOL] Capturing scene pixels without writing image to disk

2020-05-06 Thread Thomas Holder
Hi Antonio, This is currently not possible for ray tracing or for capturing the displayed image. It's possible for deferred on-screen rendering with a callback. def mycallback(image): print("got image of dimension", image.shape) cmd.raw_image_callback = mycallback cmd.draw() Cheers, Th