Ejemplo n.º 1
0
 def setRenderer(self, type):
     if (self.rendererType == type):
         return None
     if (self.renderer):
         self.renderer = None
     self.rendererType = type
     if (type == "PointParticleRenderer"):
         self.renderer = PointParticleRenderer()
         self.renderer.setPointSize(1.0)
     elif (type == "LineParticleRenderer"):
         self.renderer = LineParticleRenderer()
     elif (type == "GeomParticleRenderer"):
         self.renderer = GeomParticleRenderer()
         # This was moved here because we do not want to download
         # the direct tools with toontown.
         if __dev__:
             from direct.directtools import DirectSelection
             npath = NodePath('default-geom')
             bbox = DirectSelection.DirectBoundingBox(npath)
             self.renderer.setGeomNode(bbox.lines.node())
     elif (type == "SparkleParticleRenderer"):
         self.renderer = SparkleParticleRenderer()
     elif (type == "SpriteParticleRenderer"):
         self.renderer = SpriteParticleRendererExt.SpriteParticleRendererExt()
         # self.renderer.setTextureFromFile()
     else:
         print "unknown renderer type: %s" % type
         return None
     ParticleSystem.setRenderer(self, self.renderer)
Ejemplo n.º 2
0
 def setRenderer(self, type):
     if self.rendererType == type:
         return None
     
     if self.renderer:
         self.renderer = None
     
     self.rendererType = type
     if type == 'PointParticleRenderer':
         self.renderer = PointParticleRenderer()
         self.renderer.setPointSize(1.0)
     elif type == 'LineParticleRenderer':
         self.renderer = LineParticleRenderer()
     elif type == 'GeomParticleRenderer':
         self.renderer = GeomParticleRenderer()
         if __dev__:
             DirectSelection = DirectSelection
             import direct.directtools
             npath = NodePath('default-geom')
             bbox = DirectSelection.DirectBoundingBox(npath)
             self.renderer.setGeomNode(bbox.lines.node())
         
     elif type == 'SparkleParticleRenderer':
         self.renderer = SparkleParticleRenderer()
     elif type == 'SpriteParticleRenderer':
         self.renderer = SpriteParticleRendererExt.SpriteParticleRendererExt()
     else:
         print 'unknown renderer type: %s' % type
         return None
     ParticleSystem.setRenderer(self, self.renderer)
Ejemplo n.º 3
0
 def setRenderer(self, type):
     if (self.rendererType == type):
         return None
     if (self.renderer):
         self.renderer = None
     self.rendererType = type
     if (type == "PointParticleRenderer"):
         self.renderer = PointParticleRenderer()
         self.renderer.setPointSize(1.0)
     elif (type == "LineParticleRenderer"):
         self.renderer = LineParticleRenderer()
     elif (type == "GeomParticleRenderer"):
         self.renderer = GeomParticleRenderer()
         # This was moved here because we do not want to download
         # the direct tools with toontown.
         if __dev__:
             from direct.directtools import DirectSelection
             npath = NodePath('default-geom')
             bbox = DirectSelection.DirectBoundingBox(npath)
             self.renderer.setGeomNode(bbox.lines.node())
     elif (type == "SparkleParticleRenderer"):
         self.renderer = SparkleParticleRenderer()
     elif (type == "SpriteParticleRenderer"):
         self.renderer = SpriteParticleRendererExt.SpriteParticleRendererExt(
         )
         # self.renderer.setTextureFromFile()
     else:
         print "unknown renderer type: %s" % type
         return None
     ParticleSystem.setRenderer(self, self.renderer)
Ejemplo n.º 4
0
 def setRenderer(self, type):
     if self.rendererType == type:
         return
     if self.renderer:
         self.renderer = None
     self.rendererType = type
     if type == 'PointParticleRenderer':
         self.renderer = PointParticleRenderer()
         self.renderer.setPointSize(1.0)
     elif type == 'LineParticleRenderer':
         self.renderer = LineParticleRenderer()
     elif type == 'GeomParticleRenderer':
         self.renderer = GeomParticleRenderer()
         if __dev__:
             from direct.directtools import DirectSelection
             npath = NodePath('default-geom')
             bbox = DirectSelection.DirectBoundingBox(npath)
             self.renderer.setGeomNode(bbox.lines.node())
     elif type == 'SparkleParticleRenderer':
         self.renderer = SparkleParticleRenderer()
     elif type == 'SpriteParticleRenderer':
         self.renderer = SpriteParticleRendererExt.SpriteParticleRendererExt()
     else:
         print 'unknown renderer type: %s' % type
         return
     ParticleSystem.setRenderer(self, self.renderer)
     return