particle_panel.py 887 B

123456789101112131415161718192021222324252627282930313233
  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. # Open the Panda window
  17. from direct.showbase.ShowBase import ShowBase
  18. base = ShowBase()
  19. # Makes sure that Panda is configured to play nice with Tkinter
  20. base.startTk()
  21. from direct.tkpanels.ParticlePanel import ParticlePanel
  22. pp = ParticlePanel() # Create the panel
  23. base.disableMouse() # Disable camera control to place it
  24. base.camera.setY(-10) # Place the camera
  25. base.setBackgroundColor(0, 0, 0) # Most particle systems show up better on black backgrounds
  26. base.run()