effect: make Drift and Sparks use new particle system

This commit is contained in:
Aidan 2013-11-20 21:36:54 -05:00
parent d910a8e5f6
commit 2326eb8741
2 changed files with 4 additions and 48 deletions

View file

@ -1,8 +1,7 @@
from pandac.PandaModules import *
from direct.particles import ParticleEffect
from direct.directnotify import DirectNotifyGlobal
from direct.showbase import AppRunnerGlobal
import os
from toontown.battle import BattleParticles
class Drift(NodePath):
@ -13,28 +12,7 @@ class Drift(NodePath):
self.renderParent.setBin('fixed', 0)
self.renderParent.setDepthWrite(0)
self.assign(parent.attachNewNode('drift'))
self.effect = ParticleEffect.ParticleEffect()
particleSearchPath = DSearchPath()
if AppRunnerGlobal.appRunner:
particleSearchPath.appendDirectory(Filename.expandFrom('$TT_3_5_ROOT/phase_3.5/etc'))
else:
basePath = os.path.expandvars('$TOONTOWN') or './toontown'
particleSearchPath.appendDirectory(Filename.fromOsSpecific(basePath + '/src/effects'))
particleSearchPath.appendDirectory(Filename('resources/phase_3.5/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_4/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_5/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_6/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_7/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_8/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_9/etc'))
particleSearchPath.appendDirectory(Filename('.'))
pfile = Filename('drift.ptf')
found = vfs.resolveFilename(pfile, particleSearchPath)
if not found:
notify.warning('loadParticleFile() - no path: %s' % pfile)
return
notify.debug('Loading particle file: %s' % pfile)
self.effect.loadConfig(pfile)
self.effect = BattleParticles.loadParticleFile('drift.ptf')
ren = self.effect.getParticlesNamed('particles-1').getRenderer()
ren.setTextureFromNode('phase_6/models/karting/driftSmoke', '**/*')

View file

@ -1,8 +1,7 @@
from pandac.PandaModules import *
from direct.particles import ParticleEffect
from direct.directnotify import DirectNotifyGlobal
from direct.showbase import AppRunnerGlobal
import os
from toontown.battle import BattleParticles
class Sparks(NodePath):
@ -13,28 +12,7 @@ class Sparks(NodePath):
self.renderParent.setBin('fixed', 0)
self.renderParent.setDepthWrite(0)
self.assign(parent.attachNewNode('sparks'))
self.effect = ParticleEffect.ParticleEffect('Sparks')
particleSearchPath = DSearchPath()
if AppRunnerGlobal.appRunner:
particleSearchPath.appendDirectory(Filename.expandFrom('$TT_3_5_ROOT/phase_3.5/etc'))
else:
basePath = os.path.expandvars('$TOONTOWN') or './toontown'
particleSearchPath.appendDirectory(Filename.fromOsSpecific(basePath + '/src/effects'))
particleSearchPath.appendDirectory(Filename('resources/phase_3.5/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_4/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_5/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_6/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_7/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_8/etc'))
particleSearchPath.appendDirectory(Filename('resources/phase_9/etc'))
particleSearchPath.appendDirectory(Filename('.'))
pfile = Filename('sparks.ptf')
found = vfs.resolveFilename(pfile, particleSearchPath)
if not found:
notify.warning('loadParticleFile() - no path: %s' % pfile)
return
notify.debug('Loading particle file: %s' % pfile)
self.effect.loadConfig(pfile)
self.effect = BattleParticles.loadParticleFile('sparks.ptf')
ren = self.effect.getParticlesNamed('particles-1').getRenderer()
ren.setTextureFromNode('phase_6/models/karting/particleSpark', '**/*')