def doPrecache(cls): if cls.anim: precacheActor([cls.model, {'chan': cls.anim, 'zero': cls.model}]) elif cls.model: precacheModel(cls.model) if cls.hitSfxPath: precacheSound(cls.hitSfxPath)
def doPrecache(cls): if cls.ModelAnimPath: precacheActor([ cls.ModelPath, { 'chan': cls.ModelAnimPath, 'zero': cls.ModelPath } ]) elif cls.ModelPath: precacheModel(cls.ModelPath)
def precacheToons(): """ Precaches all Toon models and animations! """ from src.coginvasion.base.Precache import precacheActor, precacheModel from direct.actor.Actor import Actor for legType in LegHeightDict.keys(): toon = Actor() generateBodyPart(toon, 'legs', legType, 3, 'shorts') precacheActor(toon) toon.cleanup() toon.removeNode() for torsoType in TorsoHeightDict.keys(): toon = Actor() generateBodyPart(toon, 'torso', torsoType, 3, '') precacheActor(toon) toon.cleanup() toon.removeNode() for animal in HeadScales.keys(): if animal != "dog": precacheModel("phase_3/models/char/%s-heads-1000.bam" % animal) else: for headType in DogHeads: # precache all dog head models and animations mdl = "phase_3/models/char/tt_a_chr_%s_head_1000.bam" % headType partAnimations = {} # Load the body part animations. for animName in ANIMATIONS: animationData = list(ANIMATIONS[animName]) animPath = None if len(animationData) == 2: animPhase = animationData[0] animFile = animationData[1] # Let's create the path for the animation. animPath = BASE_MODEL % (animPhase, headType, '', 'head', animFile) if '_-' in animPath: animPath = animPath.replace('_-', '-') if '__' in animPath: animPath = animPath.replace('__', '_') partAnimations[animName] = animPath precacheActor([mdl, partAnimations])
def doPrecache(cls): print("BaseAttack(%s).doPrecache()" % cls.ModelPath) if cls.ModelAnimPath: precacheActor([ cls.ModelPath, { 'chan': cls.ModelAnimPath, 'zero': cls.ModelPath } ]) elif cls.ModelPath: precacheModel(cls.ModelPath) if cls.SpecialVM and cls.SpecialVMActor: precacheActor(cls.SpecialVMActor)
def doPrecache(cls): super(HL2Shotgun, cls).doPrecache() precacheSound(cls.sgFirePath) precacheSound(cls.sgDblFirePath) precacheSound(cls.sgPumpPath) precacheSound(cls.sgEmptyPath) for rl in cls.sgReloadPaths: precacheSound(rl) precacheModel(cls.ShellPath) for i in range(cls.ShellContactSoundRange[0], cls.ShellContactSoundRange[1] + 1): precacheSound(cls.ShellContactSoundPath.format(i))
def doPrecache(cls): super(NPC_VP, cls).doPrecache() precacheActor(cls.LegsActorDef) precacheActor(cls.TorsoActorDef) precacheActor(cls.HeadActorDef) precacheModel(cls.TreadsModel) precacheSound(cls.ThrowGearsSoundPath) precacheSound(cls.DoorOpenSoundPath) precacheSound(cls.DoorCloseSoundPath) precacheSound(cls.StatementSoundPath) precacheSound(cls.QuestionSoundPath) precacheSound(cls.GruntSoundPath) precacheSound(cls.StunSoundPath) precacheSound(cls.RaiseSoundPath) precacheSound(cls.JumpStartSoundPath) precacheSound(cls.JumpEndSoundPath) precacheSound(cls.ChirpSoundPath)
def doPrecache(cls): precacheModel(cls.ELEVATOR_MDL) precacheModel(cls.ICONS_MDL) precacheModel(cls.SIGN_MDL)
def doPrecache(cls): super(GumballBlaster, cls).doPrecache() precacheSound(cls.FireSoundPath) precacheModel(cls.BallsModelPath)
def doPrecache(cls): precacheSound(cls.buttonSoundPath) precacheModel(cls.buttonPath)
def doPrecache(cls): super(WaterCooler, cls).doPrecache() precacheSound(cls.SprayOnlyPath) precacheSound(cls.CoolerAppearPath) precacheModel(cls.SprayPath)
def doPrecache(cls): super(Fired, cls).doPrecache() precacheModel(GlowMdl) precacheSound(FiredProjectile.ImpactSoundPath) precacheSound(FiredProjectile.FlameEmitSfx) precacheScene(SuitAttacks.getSuitParticle("fire"))
def doPrecache(cls): super(cls, CogStomper).doPrecache() precacheModel(cls.StomperModelPath) precacheSound(cls.RaiseSoundPath) precacheSound(cls.BigStompSoundPath) precacheSound(cls.SmallStompSoundPath)
def doPrecache(cls): if cls.ModelPath: precacheModel(cls.ModelPath) if cls.ImpactSoundPath: precacheSound(cls.ImpactSoundPath)
def doPrecache(cls): super(SoundGag, cls).doPrecache() precacheModel(cls.megaphonePath) precacheSound(cls.appearSfxPath) precacheSound(cls.soundSfxPath)