Example #1
0
 def runScript(self, script_path):
     if not os.path.isfile(script_path):
         return
     try:
         log.info("executing: %s" % script_path)
         execfile(script_path, self.namespace, self.namespace)
     except Exception, e:
         err = traceback.format_exc()
         log.error("%s: %s" % (os.path.basename(script_path), err))
Example #2
0
 def draw(self, visible_only=True, bounds_only=False):
     """
     draws the scene
     
     :param visible_only: drawing depends on visible property being set
     :param bounds_only: draw object level bounding boxes only
     """
     try:
         self.scene.draw(visible_only, bounds_only)
     except RuntimeError, e:
         log.error(str(e))
Example #3
0
 def tabComplete(self):
     try:
         from rlcompleter import Completer
         c = Completer(self.namespace)
         cmd = self.getCommand()
         if "." in cmd:
             matches = c.attr_matches(cmd)
         else:
             matches = c.global_matches(cmd)
         if len(matches) == 1:
             cmd = matches[0]
         else:
             self.appendPlainText("\t".join(matches))
         self.newPrompt()
         self.setCommand(cmd)
     except ImportError, e:
         log.error(e)
Example #4
0
    def draw_bounds(self, seconds=0, mode=GL_LINES):
        """
        Draw scene-level bounding box for a given time in secs.
        """
        glPushName(self.state.scenes.index(self))
        
        # try to get top-most bounds from archive first...
        bounds = self.archive.bounds(seconds)

        if bounds is not None:
            draw_bounding_box(bounds, mode)
        
        # because instantiating the SceneWrapper is slow
        else:
            try:
                self.scene.draw_bounds(mode)
            except RuntimeError, e:
                log.error(str(e))
Example #5
0
 def draw(self):
     try:
         self.scene.draw()
     except RuntimeError, e:
         log.error(str(e))