Ejemplo n.º 1
0
    def setOptions(self, optparser):
        """Add options specific to this tool."""
        Tool.setOptions(self, optparser)
        optparser.add_option("-F",
                             "--full-screen",
                             action="store_true",
                             default=False,
                             help="Full screen display")
        optparser.add_option(
            "-N",
            "--navigation-mode",
            metavar="MODE",
            help="Navigation mode (MAX, Maya, Softimage). Default: Maya")
        optparser.add_option("-d",
                             "--no-shadow",
                             action="store_true",
                             default=False,
                             help="Disable shadows")
        optparser.add_option("-R",
                             "--render-system",
                             metavar="NAME",
                             help="Render system (gl, d3d). Default: gl")
        optparser.add_option("-S",
                             "--stereo",
                             action="store_true",
                             default=False,
                             help="Activate stereo display")
        optparser.add_option(
            "-m",
            "--shadow-mode",
            metavar="NAME",
            help="Shadow Mode  (STENCIL_ADD, STENCIL_MOD, TEXTURE")

        print "mmmmhh0"
Ejemplo n.º 2
0
    def __init__(self):
        Tool.__init__(self, defaultoptionvar="VIEWEROGRE_DEFAULT_OPTIONS")

        # Search path for OGRE material scripts
        self.materialpath = r".\materials"
        
        Nopt = self.options.navigation_mode
        if Nopt==None or Nopt.lower()=="maya":
            self.navigation_mode = 1
        elif Nopt.lower()=="max":
            self.navigation_mode = 0
        elif Nopt.lower()=="softimage":
            self.navigation_mode = 2
        else:
            raise ValueError, "Unknown navigation mode. '%s'"%Nopt

        Ropt = self.options.render_system
        if Ropt==None or Ropt.lower()=="gl":
            self.use_opengl = 1
        elif Ropt.lower()=="d3d":
            self.use_opengl = 0
        else:
            raise ValueError, "Unknown render system: '%s'"%Ropt

        Topt = self.options.shadow_mode
        if Topt==None or Topt.lower()=="stencil_add":
            self.shadowmode = 0
        elif Topt.lower()=="stencil_mod":
            self.shadowmode = 1
        elif Topt.lower()=="texture":
            self.shadowmode = 2	    
        else:
            raise ValueError, "Unknown shadow mode: '%s'"%Topt   

	print "init done"
Ejemplo n.º 3
0
    def setOptionsFromGlobals(self):
        Tool.setOptionsFromGlobals(self)

        scene = getScene()
        self.options.full_screen = scene.getGlobal("fullscreen", self.options.full_screen)

        self.options.eye_distance = float(scene.getGlobal("eyedistance", self.options.eye_distance))

        # Check the stereo option and initialize the variable "stereo_mode"
        Sopt = scene.getGlobal("stereo", None)
        self.stereo_mode = self.translateKeyWordOpt(Sopt,
                                { None:0, "vsplit":1, "glstereo":2 },
                                "Unknown stereo mode: '%s'")

        # Check the polygon mode option
        Popt = scene.getGlobal("polygonmode", "fill")
        self.polygon_mode = self.translateKeyWordOpt(Popt,
                                { None:2, "point":0, "line":1, "fill":2 },
                                "Unknown polygon mode: '%s'")

        # Check the navigationmode option
        Nopt = scene.getGlobal("navigationmode", "maya")
        self.navigation_mode = self.translateKeyWordOpt(Nopt,
                            { None:1, "max":0, "maya":1, "softimage":2 },
                            "Unknown navigation mode: '%s'")
 def setOptions(self, optparser):
     """Add options specific to this tool."""
     
     Tool.setOptions(self, optparser)
     optparser.add_option("-r", "--renderer", type="string",
                          default="aqsis",
                          help="Renderer to use")
     optparser.add_option("-I", "--include", action="append", default=[],
                          help="Add include path for shader compilation")
     optparser.add_option("-B", "--bake", action="store_true", default=False,
                          help="Bake a texture map")
Ejemplo n.º 5
0
 def setOptions(self, optparser):
     """Add options specific to this tool."""
     
     Tool.setOptions(self, optparser)
     optparser.add_option("-r", "--renderer", type="string",
                          default="aqsis",
                          help="Renderer to use")
     optparser.add_option("-I", "--include", action="append", default=[],
                          help="Add include path for shader compilation")
     optparser.add_option("-B", "--bake", action="store_true", default=False,
                          help="Bake a texture map")
Ejemplo n.º 6
0
    def setOptions(self, optparser):
        """Add options specific to this tool."""

        Tool.setOptions(self, optparser)
        optparser.add_option("-F",
                             "--full-screen",
                             action="store_true",
                             default=False,
                             help="Full screen display")
        optparser.add_option("-S",
                             "--stereo",
                             metavar="MODE",
                             help="Activate stereo display (vsplit, glstereo)")
        optparser.add_option(
            "-D",
            "--eye-distance",
            type="float",
            default=0.07,
            help="Default eye distance for stereo display. Default: 0.07")
        optparser.add_option("-B",
                             "--bounding-box",
                             action="store_true",
                             default=False,
                             help="Show bounding boxes")
        optparser.add_option(
            "-P",
            "--polygon-mode",
            metavar="MODE",
            help="Polygon mode (fill, line, point). Default: fill")
        optparser.add_option("-s",
                             "--save",
                             metavar="NAME",
                             help="Save screenshots as images.")
        optparser.add_option(
            "-N",
            "--navigation-mode",
            metavar="MODE",
            help="Navigation mode (MAX, Maya, Softimage). Default: Maya")
        optparser.add_option("-X",
                             "--disable-spacedevice",
                             action="store_true",
                             default=False,
                             help="Disable SpaceMouse/SpaceBall.")
        optparser.add_option("-T",
                             "--disable-wintab",
                             action="store_true",
                             default=False,
                             help="Disable tablet support.")
Ejemplo n.º 7
0
    def setOptions(self, optparser):
        """Add options specific to this tool."""
        Tool.setOptions(self, optparser)
        optparser.add_option("-F", "--full-screen", action="store_true", default=False,
                             help="Full screen display")
        optparser.add_option("-N", "--navigation-mode", metavar="MODE",
                             help="Navigation mode (MAX, Maya, Softimage). Default: Maya")
        optparser.add_option("-d", "--no-shadow", action="store_true", default=False,
                             help="Disable shadows")
        optparser.add_option("-R", "--render-system", metavar="NAME",
                             help="Render system (gl, d3d). Default: gl")
        optparser.add_option("-S", "--stereo", action="store_true", default=False,
                             help="Activate stereo display")
        optparser.add_option("-m", "--shadow-mode", metavar="NAME",
                             help="Shadow Mode  (STENCIL_ADD, STENCIL_MOD, TEXTURE")

	print "mmmmhh0"
Ejemplo n.º 8
0
 def setOptions(self, optparser):
     """Add options specific to this tool."""
     
     Tool.setOptions(self, optparser)
     optparser.add_option("-F", "--full-screen", action="store_true", default=False,
                          help="Full screen display")
     optparser.add_option("-S", "--stereo", metavar="MODE",
                          help="Activate stereo display (vsplit, glstereo)")
     optparser.add_option("-D", "--eye-distance", type="float", default=0.07,
                          help="Default eye distance for stereo display. Default: 0.07")
     optparser.add_option("-B", "--bounding-box", action="store_true", default=False,
                          help="Show bounding boxes")
     optparser.add_option("-P", "--polygon-mode", metavar="MODE",
                          help="Polygon mode (fill, line, point). Default: fill")
     optparser.add_option("-s", "--save", metavar="NAME",
                          help="Save screenshots as images.")
     optparser.add_option("-N", "--navigation-mode", metavar="MODE",
                          help="Navigation mode (MAX, Maya, Softimage). Default: Maya")
     optparser.add_option("-X", "--disable-spacedevice", action="store_true", default=False,
                          help="Disable SpaceMouse/SpaceBall.")
     optparser.add_option("-T", "--disable-wintab", action="store_true", default=False,
                          help="Disable tablet support.")
    def setOptionsFromGlobals(self):
        Tool.setOptionsFromGlobals(self)

        scene = getScene()
        self.options.bake = scene.getGlobal("bake", self.options.bake)
 def __init__(self):
     Tool.__init__(self, defaultoptionvar="RENDER_DEFAULT_OPTIONS")
Ejemplo n.º 11
0
    def setOptionsFromGlobals(self):
        Tool.setOptionsFromGlobals(self)

        scene = getScene()
        self.options.bake = scene.getGlobal("bake", self.options.bake)
Ejemplo n.º 12
0
 def __init__(self):
     Tool.__init__(self, defaultoptionvar="RENDER_DEFAULT_OPTIONS")
Ejemplo n.º 13
0
    def __init__(self):
        Tool.__init__(self, defaultoptionvar="VIEWER_DEFAULT_OPTIONS")

        self.pygame_joysticks = []
        self.cgkit_joysticks = []

        self.spacedevice = None
        self.enable_spacedevice = False  # Disable SpaceMouse for now

        self.wintabcontext = None
        self.enable_wintab = True

        if sys.platform != "win32":
            self.enable_spacedevice = False
            self.enable_wintab = False

        # The window width (this is initially taken from the options)
        self.width = None
        # The window height (this is initially taken from the options)
        self.height = None
        # The pygame display flags
        self.flags = None

        scene = getScene()
        scene.setGlobal("stereo", self.options.stereo)
        scene.setGlobal("polygonmode", self.options.polygon_mode)
        scene.setGlobal("navigationmode", self.options.navigation_mode)

        self.separate_specular_color = False
        self.draw_orientation = True

        self.keydict = {
            8: KEY_BACK,
            9: KEY_TAB,
            13: KEY_RETURN,
            27: KEY_ESCAPE,
            32: KEY_SPACE,
            276: KEY_LEFT,
            273: KEY_UP,
            275: KEY_RIGHT,
            274: KEY_DOWN,
            301: KEY_CAPSLOCK,
            304: KEY_SHIFT_LEFT,
            303: KEY_SHIFT_RIGHT,
            306: KEY_CONTROL_LEFT,
            305: KEY_CONTROL_RIGHT,
            308: KEY_ALT_LEFT,
            307: KEY_ALT_RIGHT,
            310: KEY_WINDOWS_LEFT,
            309: KEY_WINDOWS_RIGHT,
            319: KEY_WINDOWS_MENU,
            317: KEY_PRINT,
            302: KEY_SCROLL,
            19: KEY_PAUSE,
            277: KEY_INSERT,
            127: KEY_DELETE,
            278: KEY_HOME,
            279: KEY_END,
            280: KEY_PRIOR,
            281: KEY_NEXT,
            282: KEY_F1,
            283: KEY_F2,
            284: KEY_F3,
            285: KEY_F4,
            286: KEY_F5,
            287: KEY_F6,
            288: KEY_F7,
            289: KEY_F8,
            290: KEY_F9,
            291: KEY_F10,
            292: KEY_F11,
            293: KEY_F12,
            300: KEY_NUMLOCK,
            256: KEY_NUMPAD0,
            257: KEY_NUMPAD1,
            258: KEY_NUMPAD2,
            259: KEY_NUMPAD3,
            260: KEY_NUMPAD4,
            261: KEY_NUMPAD5,
            262: KEY_NUMPAD6,
            263: KEY_NUMPAD7,
            264: KEY_NUMPAD8,
            265: KEY_NUMPAD9,
            266: KEY_NUMPAD_DECIMAL,
            267: KEY_NUMPAD_DIVIDE,
            268: KEY_NUMPAD_MULTIPLY,
            269: KEY_NUMPAD_SUBTRACT,
            270: KEY_NUMPAD_ADD,
            271: KEY_NUMPAD_ENTER
        }