Skip to main content

A Dear ImGui backend for Python-based Panda3D projects with built-in utilities.

Project description

panda3d-imgui

A Dear ImGui backend for Python-based Panda3D projects with built-in utilities (based on DIRECT Tools).

Screenshot 2025-11-05 at 10 58 18 PM

This module will allow you to use and create Dear ImGui user interfaces within a Panda3D window, preferbly used to create content creation/debugging tools. (It uses Dear ImGui Bundle which contains not only the Python bindings for Dear ImGui, but with other goodies as well.

How to use

You can install the module through pip:

pip install panda3d-imgui

And you can import this module as p3dimgui

import p3dimgui

It has a helper method called init which you can easlily add in your ShowBase class. This will create a ImGuiBackend object into base.imgui and initialize it, along side the built-in ultilities.

from direct.showbase.ShowBase import ShowBase

from imgui_bundle import imgui

import p3dimgui

class MyApp(ShowBase):
    def  __init__(self):
        ShowBase.__init__(self)

        # Install Dear ImGui
        p3dimgui.init()

Once initalized, it will send an event called imgui-new-frame every frame. You can accept this event whenever you want to draw with ImGui:

def draw(self):
   # Show the demo window.
   imgui.show_demo_window()

self.accept('imgui-new-frame', self.draw)

Combine all this and you would have something like this, which will start up a new Panda3D window and shows the Dear ImGui demo window.

from direct.showbase.ShowBase import ShowBase

from imgui_bundle import imgui

import p3dimgui

class MyApp(ShowBase):
    def  __init__(self):
        ShowBase.__init__(self)

        # Install Dear ImGui
        p3dimgui.init()

        self.accept('imgui-new-frame', self.draw)

    def draw(self):
        # Show the demo window.
        imgui.show_demo_window()

app = MyApp()
app.run()
image

For a more better demo which showcases all the built-in utilities aviliable (like the screenshot at the top), see the demo.py file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

panda3d_imgui-1.0.2.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

panda3d_imgui-1.0.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file panda3d_imgui-1.0.2.tar.gz.

File metadata

  • Download URL: panda3d_imgui-1.0.2.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for panda3d_imgui-1.0.2.tar.gz
Algorithm Hash digest
SHA256 68d66c8de41a1ca604aa31b0b7ef78f47ca5eea76be0523caa645eaf827a55e0
MD5 3431a4bc9a3afa599823c720315134b9
BLAKE2b-256 cc0b411045338be3655e916756d70028bd06d1fec7ffa1814e7cdc51a573f29b

See more details on using hashes here.

File details

Details for the file panda3d_imgui-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: panda3d_imgui-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for panda3d_imgui-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3bb1512d664e4983756151e9cce23be5b95c24ed8635b9884c14a3e8955fbbb7
MD5 1771f4e2ceb955c3fd6e3ae707c33c37
BLAKE2b-256 3e36a1822bc4156b81a44f9dfc5e2581bb86482fc07fb6f0b6dcf49840f813b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page