particle_panel.py 935 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/usr/bin/env python
  2. # Author: Shao Zhang, Phil Saltzman
  3. # Last Updated: 2015-03-13
  4. #
  5. # This file contians the minimum code needed to load the particle panel tool
  6. # See readme.txt for more information
  7. import sys
  8. try:
  9. import _tkinter
  10. except:
  11. sys.exit("Please install python module 'Tkinter'")
  12. try:
  13. import Pmw
  14. except:
  15. sys.exit("Please install Python megawidgets")
  16. # Makes sure that Panda is configured to play nice with Tkinter
  17. from panda3d.core import *
  18. loadPrcFileData("", "want-tk true")
  19. # Open the Panda window
  20. from direct.showbase.ShowBase import ShowBase
  21. base = ShowBase()
  22. from direct.tkpanels.ParticlePanel import ParticlePanel
  23. pp = ParticlePanel() # Create the panel
  24. base.disableMouse() # Disable camera control to place it
  25. base.camera.setY(-10) # Place the camera
  26. base.setBackgroundColor(0, 0, 0) # Most particle systems show up better on black backgrounds
  27. base.run()