diff --git a/direct/src/particles/Particles.py b/direct/src/particles/Particles.py index 10d6a758d2..3d1e72be5e 100644 --- a/direct/src/particles/Particles.py +++ b/direct/src/particles/Particles.py @@ -1,6 +1,4 @@ from pandac.PandaModules import * -from direct.particles.ParticleManagerGlobal import * -from direct.showbase.PhysicsManagerGlobal import * from pandac.PandaModules import ParticleSystem from pandac.PandaModules import BaseParticleFactory @@ -83,14 +81,14 @@ class Particles(ParticleSystem): def enable(self): if (self.fEnabled == 0): - physicsMgr.attachPhysical(self) - particleMgr.attachParticlesystem(self) + base.physicsMgr.attachPhysical(self) + base.particleMgr.attachParticlesystem(self) self.fEnabled = 1 def disable(self): if (self.fEnabled == 1): - physicsMgr.removePhysical(self) - particleMgr.removeParticlesystem(self) + base.physicsMgr.removePhysical(self) + base.particleMgr.removeParticlesystem(self) self.fEnabled = 0 def isEnabled(self): diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index 762b8c3654..397bfd566b 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -21,8 +21,6 @@ from JobManagerGlobal import * from EventManagerGlobal import * from PythonUtil import * from direct.showbase import PythonUtil -from direct.particles.ParticleManagerGlobal import * -from PhysicsManagerGlobal import * #from direct.interval.IntervalManager import ivalMgr from direct.interval import IntervalManager from InputStateGlobal import inputState @@ -243,14 +241,11 @@ class ShowBase(DirectObject.DirectObject): self.jobMgr = jobMgr # Particle manager - self.particleMgr = particleMgr - self.particleMgr.setFrameStepping(1) + self.particleMgr = None self.particleMgrEnabled = 0 # Physics manager - self.physicsMgr = physicsMgr - integrator = LinearEulerIntegrator() - self.physicsMgr.attachLinearIntegrator(integrator) + self.physicsMgr = None self.physicsMgrEnabled = 0 self.physicsMgrAngular = 0 @@ -1362,6 +1357,17 @@ class ShowBase(DirectObject.DirectObject): def enableParticles(self): if not self.particleMgrEnabled: + if not self.particleMgr: + from direct.particles.ParticleManagerGlobal import particleMgr + self.particleMgr = particleMgr + self.particleMgr.setFrameStepping(1) + + if not self.physicsMgr: + from PhysicsManagerGlobal import physicsMgr + self.physicsMgr = physicsMgr + integrator = LinearEulerIntegrator() + self.physicsMgr.attachLinearIntegrator(integrator) + self.particleMgrEnabled = 1 self.physicsMgrEnabled = 1 self.taskMgr.remove('manager-update') diff --git a/direct/src/showbase/Transitions.py b/direct/src/showbase/Transitions.py index 0551ec6c1d..b3b8255674 100644 --- a/direct/src/showbase/Transitions.py +++ b/direct/src/showbase/Transitions.py @@ -6,7 +6,9 @@ __all__ = ['Transitions'] from pandac.PandaModules import * from direct.gui.DirectGui import * from direct.task import Task -from direct.interval.IntervalGlobal import * +from direct.interval.LerpInterval import LerpColorScaleInterval, LerpColorInterval, LerpScaleInterval, LerpPosInterval +from direct.interval.MetaInterval import Sequence, Parallel +from direct.interval.FunctionInterval import Func class Transitions: