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.

It is based on the C++ based project with the similar name. The difference that it is ported to Python for such users to use on their projects.

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.2.0.tar.gz (38.6 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.2.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for panda3d_imgui-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c91866e3689bb665cf5877769f6c3e4ba49c345afffa285cc53ee70bcedb07e3
MD5 bc8d709c3c8713500162dfbcaf79ded7
BLAKE2b-256 50e3641523fd1c0f8ce1490d6468e66a0f9c46bee9429950f415fa302dfc03fb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for panda3d_imgui-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18241fc77f82968af53cbe63434d5a3076470c8ec4025a874784346fa2e3bb24
MD5 73f808bed2f1c2e73a246a75a0823040
BLAKE2b-256 9eabf6a5dbafd88dd9bb51a131f6fd7387887b63610649d43588a3bb77be9d78

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