demo_imguizmo_launcher.py 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # Part of ImGui Bundle - MIT License - Copyright (c) 2022-2026 Pascal Thomet - https://github.com/pthom/imgui_bundle
  2. import os.path
  3. import subprocess
  4. import sys
  5. from imgui_bundle import imgui, immapp, imgui_md
  6. from imgui_bundle.demos_python import demo_utils
  7. def demo_gui():
  8. imgui_md.render_unindented(
  9. """
  10. [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) provides an immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui.
  11. """
  12. )
  13. imgui.text(
  14. "Click the button below to launch the demo (below the button is a screenshot of the app that will be launched)"
  15. )
  16. if demo_utils.can_run_subprocess():
  17. if imgui.button("Run gizmo demo"):
  18. this_dir = os.path.dirname(__file__)
  19. subprocess.Popen(
  20. [sys.executable, this_dir + "/demos_imguizmo/demo_gizmo.py"]
  21. )
  22. demo_utils.show_python_vs_cpp_file("demos_imguizmo/demo_gizmo", nb_lines=30)
  23. def main():
  24. immapp.run(demo_gui, window_size=(1000, 800), with_markdown=True)
  25. if __name__ == "__main__":
  26. main()