Browse Source

direct: don't rely on vfs being present in builtins

rdb 5 years ago
parent
commit
8178fb21f3

+ 1 - 0
direct/src/distributed/ConnectionRepository.py

@@ -260,6 +260,7 @@ class ConnectionRepository(
             searchPath = getModelPath().getValue()
             for dcFileName in dcFileNames:
                 pathname = Filename(dcFileName)
+                vfs = VirtualFileSystem.getGlobalPtr()
                 vfs.resolveFilename(pathname, searchPath)
                 readResult = dcFile.read(pathname)
                 if not readResult:

+ 1 - 0
direct/src/distributed/ServerRepository.py

@@ -225,6 +225,7 @@ class ServerRepository:
             searchPath = getModelPath().getValue()
             for dcFileName in dcFileNames:
                 pathname = Filename(dcFileName)
+                vfs = VirtualFileSystem.getGlobalPtr()
                 vfs.resolveFilename(pathname, searchPath)
                 readResult = dcFile.read(pathname)
                 if not readResult:

+ 1 - 0
direct/src/particles/ParticleEffect.py

@@ -201,6 +201,7 @@ class ParticleEffect(NodePath):
               f.write('self.addForceGroup(%s)\n' % target)
 
     def loadConfig(self, filename):
+        vfs = VirtualFileSystem.getGlobalPtr()
         data = vfs.readFile(filename, 1)
         data = data.replace(b'\r', b'')
         try: