Exemplo n.º 1
0
def reloadTextures(textureName=""):
    """
    Artfart command to reload all of the textures.

    TODO: A panel that says "Reloading textures... Please wait!"
    ...though it's not important since it's a staff command and
    only staff will see it.

    Stolen from ToontownStart.py
    Remount all phase files. This maybe might work? Idk. Lets see
    if Panda craps itself.

    Place raw files in /resources/non-mf/phase_*/ and they will be
    mounted without needing to multify!
    """

    # Lock ...
    vfs = VirtualFileSystem.getGlobalPtr()
    for file in glob.glob("resources/non-mf/phase_*/"):
        # Slightly hacky. We remove the trailing slash so we have a tail,
        # and select the tail value from the returned tuple. Finally we
        # prepend a slash for the mount point.
        mount_point = "/" + str(os.path.split(file[:-1])[1])
        vfs.mount(Filename(file), Filename(mount_point), 0)

    # ... and load.
    if textureName:
        pool = TexturePool.findAllTextures("*" + textureName + "*")
    else:
        pool = TexturePool.findAllTextures()
    for texture in pool:
        texture.reload()
    if textureName:
        return "Reloaded all textures matching '%s'" % textureName
    return "Reloaded all of the textures!"
def reloadTextures(textureName=''):
    """
    Artfart command to reload all of the textures.

    TODO: A panel that says "Reloading textures... Please wait!"
    ...though it's not important since it's a staff command and
    only staff will see it.

    Stolen from ToontownStart.py
    Remount all phase files. This maybe might work? Idk. Lets see
    if Panda craps itself.

    Place raw files in /resources/non-mf/phase_*/ and they will be
    mounted without needing to multify!
    """

    # Lock ...
    vfs = VirtualFileSystem.getGlobalPtr()
    for file in glob.glob('resources/non-mf/phase_*/'):
        # Slightly hacky. We remove the trailing slash so we have a tail,
        # and select the tail value from the returned tuple. Finally we
        # prepend a slash for the mount point.
        mount_point = '/' + str(os.path.split(file[:-1])[1])
        vfs.mount(Filename(file), Filename(mount_point), 0)

    # ... and load.
    if textureName:
        pool = TexturePool.findAllTextures('*' + textureName + '*')
    else:
        pool = TexturePool.findAllTextures()
    for texture in pool:
        texture.reload()
    if textureName:
        return "Reloaded all textures matching '%s'" % textureName
    return "Reloaded all of the textures!"
 def destroy(self):
   print "I: ShaderNode.destroy"
   #for tex, x in TextureMapping:
   #  TexturePool.releaseTexture(tex)
   for [alphamap, alphamapchannel], [detailTex, texscale] in self.AlphaMaps.items():
     TexturePool.releaseTexture(alphamap)
     TexturePool.releaseTexture(detailTex)
   self.Root.clearShader()
   self.Root.clearTexture()
Exemplo n.º 4
0
 def destroy(self):
     print "I: ShaderNode.destroy"
     #for tex, x in TextureMapping:
     #  TexturePool.releaseTexture(tex)
     for [alphamap, alphamapchannel], [detailTex,
                                       texscale] in self.AlphaMaps.items():
         TexturePool.releaseTexture(alphamap)
         TexturePool.releaseTexture(detailTex)
     self.Root.clearShader()
     self.Root.clearTexture()
Exemplo n.º 5
0
 def unload(self):
     Place.Place.unload(self)
     self.parentFSM.getStateNamed('cogdoInterior').removeChild(self.fsm)
     del self.parentFSM
     del self.fsm
     self.ignoreAll()
     ModelPool.garbageCollect()
     TexturePool.garbageCollect()
     self.townBattle.unload()
     self.townBattle.cleanup()
     del self.townBattle
     for i in xrange(1, 3):
         Suit.unloadSuits(i)
Exemplo n.º 6
0
 def unload(self):
     Place.Place.unload(self)
     self.parentFSM.getStateNamed('cogdoInterior').removeChild(self.fsm)
     del self.parentFSM
     del self.fsm
     self.ignoreAll()
     ModelPool.garbageCollect()
     TexturePool.garbageCollect()
     self.townBattle.unload()
     self.townBattle.cleanup()
     del self.townBattle
     for i in xrange(1, 3):
         Suit.unloadSuits(i)