From 267ecf01ec95669d3dc940b28617cd8bb68232db Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 5 May 2009 22:42:40 +0000 Subject: [PATCH] use Loader to load egg files via cache --- direct/src/showbase/MakeAppMF.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/direct/src/showbase/MakeAppMF.py b/direct/src/showbase/MakeAppMF.py index c89a4e35b9..f2a07a974b 100644 --- a/direct/src/showbase/MakeAppMF.py +++ b/direct/src/showbase/MakeAppMF.py @@ -39,6 +39,7 @@ import imp import marshal import direct from direct.stdpy.file import open +from direct.showbase import Loader from pandac.PandaModules import * vfs = VirtualFileSystem.getGlobalPtr() @@ -80,6 +81,8 @@ class AppPacker: for type in PNMFileTypeRegistry.getGlobalPtr().getTypes(): self.image_extensions += type.getExtensions() + self.loader = Loader.Loader(self) + def scan(self, root, main): if self.compilation_mode != 'py': if __debug__: @@ -177,11 +180,11 @@ class AppPacker: def addEggFile(self, filename, outFilename): # Precompile egg files to bam's. - node = loadEggFile(filename) - if not node: + np = self.loader.loadModel(filename, okMissing = True) + if np.isEmpty(): raise StandardError, 'Could not read egg file %s' % (filename) - self.addNode(node, outFilename) + self.addNode(np.node(), outFilename) def addBamFile(self, filename, outFilename): # Load the bam file so we can massage its textures.