I’m new to Panda3D, and trying to get it to work properly with my existing Tkinter-based application. I’ve searched the community but can’t seem to find the right answers except some of them seem to have been asked many years ago, but are not addressed.
Some of these questions may be general, I appreciate any help.
Panda Version: Panda3D-184.108.40.206-x64; Python 3.7.4
Windows 10, AlienWare laptop Intel-i9 w/GTX 1080.
I am able to get a Panda3D window running inside a Tkinter frame, using the standard rendering and the RenderPipeline PBR materials.
Is it normal for my FPS to dramatically drop in this configuration? I can get 350+ FPS in a 500x500 RenderPipeline Panda window without Tkinter. Putting the same window into a Tkinter frame in a very simple Tkinter toplevel drops to 40 FPS.
PyEval_RestoreThread: NULL tstate errors. I’ve seen many posts about this dating back years but no clear answer. They happen seemingly randomly, but maybe not. They don’t seem to happen on Tkinter button pressing, or bound Leave/Enter widget events. They happen when a new Toplevel is opened from another Toplevel when that underlying Toplevel has the Panda frame. Yet sometimes they work fine, other times the error hits. I can open/close the new Toplevel several times and it’ll be good, then it will Fatal error, other times I can’t open it once without the error. This issue is independent of whether the Panda frame is using RenderPipeline PBR or not. The error can also be triggered if the new Toplevel opens and I try to move it too much.
Resizing/Moving a Tkinter Toplevel or root with an embedded Panda frame. Again, I’ve seen this in the forums dating back many years but I don’t know if there’s a solution. I feel like I once in experimenting did find the solution to this, but now something I’ve done has reintroduced it. But basically any resizing or moving of a Tkinter window with a Panda frame seems like it loses control over whether mouse_L is pressed, causing it to jump back to the original position/size. Sometimes it works. This is also independent on whether it’s the PBR RenderPipe or not.
EDIT: Tkinter window with embedded Panda frame doesn’t return focus to entry/text widgets after a mouse click on the Panda frame. Using the default window with camera controls, a mouse click event there requires a focus_force() on entry/text widgets, but not other widgets? ie: after rotating the camera in the TK Panda frame, a click event in the rest of the TK toplevel is caught such as a button widget, but a click into an entry/text widget isn’t, and requires manually using focus_force() back into the widget to enable it?
Multiple Panda windows inside multiple Tkinter frames. I feel like I had this working without the PBR RenderPipeline… except the default mouse commands on one window affect all the other windows? Is it possible to have multiple independent Panda windows operating in multiple Tkinter toplevels simultaneously where the default mouse bindings on window1 do not affect window2 (ie: the zoom, rotate, etc.). I was never able to get multiple Panda windows running with RenderPipeline at all. After getting the first Panda window using PBR and initializing the RenderPipeline, all subsequent windows revert to non-PBR. But I can’t initialize/create a new RenderPipeline after the first one or it throws Windows font initialization errors?
I feel like some of these issues could be solved by catching the window events and pausing the Panda render. Is there a way to freeze the Panda render frame as an image and then manually unpause the rendering?
Thanks for any help. I’m still experimenting over here.