class ParticleSystemWrapper( BaseWrapper ): def startEdit(self): # the object is selected to be edited # creates a directFrame to edit this object BaseWrapper.startEdit(self) if TKINTER_AVAILABLE: self.particlePanel = ParticlePanel( self.object.particleSystem ) def stopEdit(self): # the object is deselected from being edited BaseWrapper.stopEdit(self) if TKINTER_AVAILABLE: try: self.particlePanel.destroy() except: print "W: dgui.ParticleSystemWrapper.stopEdit: particelPanel destroy failed" traceback.print_exc()
class ParticleSystemWrapper(BaseWrapper): def startEdit(self): # the object is selected to be edited # creates a directFrame to edit this object BaseWrapper.startEdit(self) if TKINTER_AVAILABLE: self.particlePanel = ParticlePanel(self.object.particleSystem) def stopEdit(self): # the object is deselected from being edited BaseWrapper.stopEdit(self) if TKINTER_AVAILABLE: try: self.particlePanel.destroy() except: print "W: dgui.ParticleSystemWrapper.stopEdit: particelPanel destroy failed" traceback.print_exc()
import sys try: import _tkinter except: sys.exit("Please install python module 'Tkinter'") try: import Pmw except: sys.exit("Please install Python megawidgets") # Makes sure that Panda is configured to play nice with Tkinter from panda3d.core import * loadPrcFileData("", "want-tk true") # Open the Panda window from direct.showbase.ShowBase import ShowBase base = ShowBase() from direct.tkpanels.ParticlePanel import ParticlePanel pp = ParticlePanel() # Create the panel base.disableMouse() # Disable camera control to place it base.camera.setY(-10) # Place the camera base.setBackgroundColor( 0, 0, 0) # Most particle systems show up better on black backgrounds base.run()
# Particle panel - copied from Panda examples and then editted for extra functionality - original authors Shao Zhang, Phil Saltzman. # Useful for editting the various particles contained within this directory. import sys from panda3d.core import * from direct.showbase import DirectObject from direct.showbase.ShowBase import ShowBase # Get the particle panel up - requires tk... import _tkinter base.startTk() from direct.tkpanels.ParticlePanel import ParticlePanel # Create the particle panel... pp = ParticlePanel() base.setBackgroundColor(0.0, 0.0, 0.0) # Setup some basic rotating around code... class MouseRot(DirectObject.DirectObject): def __init__(self): base.disableMouse() self.centre = render.attachNewNode('cam-centre') base.camera.reparentTo(self.centre) base.camera.setY(-10.0) self.prevX = 0.0 self.prevY = 0.0 self.mouseDown = False
def startEdit(self): # the object is selected to be edited # creates a directFrame to edit this object BaseWrapper.startEdit(self) if TKINTER_AVAILABLE: self.particlePanel = ParticlePanel( self.object.particleSystem )
def startEdit(self): # the object is selected to be edited # creates a directFrame to edit this object BaseWrapper.startEdit(self) if TKINTER_AVAILABLE: self.particlePanel = ParticlePanel(self.object.particleSystem)