Browse Source

mount p3d files at cwd, not at /mf

David Rose 16 years ago
parent
commit
23d5b8e3b5
1 changed files with 8 additions and 3 deletions
  1. 8 3
      direct/src/p3d/AppRunner.py

+ 8 - 3
direct/src/p3d/AppRunner.py

@@ -149,9 +149,10 @@ class AppRunner(DirectObject):
         self.downloadTask = None
 
         # The mount point for the multifile.  For now, this is always
-        # the same, but when we move to multiple-instance sessions, it
-        # may have to be different for each instance.
-        self.multifileRoot = '/mf'
+        # the current working directory, for convenience; but when we
+        # move to multiple-instance sessions, it may have to be
+        # different for each instance.
+        self.multifileRoot = ExecutionEnvironment.getCwd().cStr()
 
         # The "main" object will be exposed to the DOM as a property
         # of the plugin object; that is, document.pluginobject.main in
@@ -448,6 +449,10 @@ class AppRunner(DirectObject):
         VFSImporter.register()
         sys.path.append(self.multifileRoot)
 
+        # Make sure that $MAIN_DIR is set to the p3d root before we
+        # start executing the code in this file.
+        ExecutionEnvironment.setEnvironmentVariable("MAIN_DIR", Filename(self.multifileRoot).toOsSpecific())
+
         # Put our root directory on the model-path, too.
         getModelPath().appendDirectory(self.multifileRoot)