Sfoglia il codice sorgente

*** empty log message ***

Mark Mine 25 anni fa
parent
commit
71f898a76c

+ 11 - 2
direct/src/directscripts/python-mode.el

@@ -551,6 +551,9 @@ Currently-active file is at the head of the list.")
   (define-key py-shell-map [tab]   'tab-to-tab-stop)
   (define-key py-shell-map "\C-c-" 'py-up-exception)
   (define-key py-shell-map "\C-c=" 'py-down-exception)
+  ;; VR STUDIO ENHANCEMENTS
+  (define-key py-shell-map "\C-d"  'delete-char)
+  (define-key py-shell-map "\C-c\C-r" 'python-resume)
   )
 
 (defvar py-mode-syntax-table nil
@@ -1073,7 +1076,9 @@ comint believe the user typed this string so that
   (let ((curbuf (current-buffer))
 	(procbuf (process-buffer proc))
 					;(comint-scroll-to-bottom-on-output t)
-	(msg (format "## working on region in file %s...\n" filename))
+	;; VR STUDIO DE-HANCEMENT: GET RID OF ANNOYING MESSAGE
+	;(msg (format "## working on region in file %s...\n" filename))
+	(msg "")
 	(cmd (format "execfile(r'%s')\n" filename)))
     (unwind-protect
 	(save-excursion
@@ -3137,7 +3142,11 @@ These are Python temporary files awaiting execution."
 ;; arrange to kill temp files when Emacs exists
 (add-hook 'kill-emacs-hook 'py-kill-emacs-hook)
 
-
+;; VR STUDIO ENHANCEMENT
+;; Function to try to resume panda mainloop
+(defun python-resume ()
+  (interactive)
+  (py-execute-string "try:\n\trun()\nexcept:\n\tpass"))
 
 (provide 'python-mode)
 ;;; python-mode.el ends here

+ 2 - 1
direct/src/directutil/DirectSession.py

@@ -55,7 +55,8 @@ class DisplayRegionContext(PandaObject):
 class DirectSession(PandaObject):
     def __init__(self):
         self.contextList = []
-        self.contextList.append(DisplayRegionContext(base.win, base.camera))
+        for camera in base.cameraList:
+            self.contextList.append(DisplayRegionContext(base.win, camera))
 
         # Initialize the collection of selected nodePaths
         self.selectedNodePaths = {}

+ 11 - 1
direct/src/showbase/ShowBase.py

@@ -29,10 +29,14 @@ class ShowBase:
         self.renderTop = NodePath(NamedNode('renderTop'))
         self.render = self.renderTop.attachNewNode('render')
         self.hidden = NodePath(NamedNode('hidden'))
+        # This will be the list of cameras, one per display region
+        # For now, we only have one display region, so just create the
+        # default camera
         self.camera = self.render.attachNewNode('camera')
+        # And put it in the list
+        self.cameraList = [ self.camera ]
         self.dataRoot = NodePath(NamedNode('dataRoot'), DataRelation.getClassType())
         self.dataUnused = NodePath(NamedNode('dataUnused'), DataRelation.getClassType())
-
         self.pipe = makeGraphicsPipe()
         self.win = self.pipe.makeGraphicsWindow(self.renderTop.node(),
                                                 self.camera.node(),
@@ -40,7 +44,13 @@ class ShowBase:
                                                 self.initialState)
 
         self.render2d = NodePath(self.win.setupPanda2d())
+        # This is a list of cams associated with the display region's cameras
+        self.camList = []
+        for camera in self.cameraList:
+            self.camList.append( camera.find('**/+Camera') )
+        # Set the default camera
         self.cam = self.camera.find('**/+Camera')
+        # Just one per window
         self.mak = self.dataRoot.attachNewNode(MouseAndKeyboard(self.win, 0, 'mak'))
         self.trackball = self.dataUnused.attachNewNode(Trackball('trackball'))
         self.drive = self.dataUnused.attachNewNode(DriveInterface('drive'))