Example #1
0
    def draw_settings(self, layout, session, props):
        row = layout.row()
        if props.expand:
            row.prop(props,"expand", icon="TRIA_DOWN", text="Settings",
                     emboss=True)
        else:
            row.prop(props,"expand", icon="TRIA_RIGHT", text="Settings",
                     emboss=True)
            return
        for prop in ['agent_libs_path', 'tools_path']: # "loc", "path", "pack", "server_url", "username", "password",
            row = layout.row()
            row.prop(props, prop)

        row = layout.row()
        row.prop(props, 'tundra_path')
        if not props.tundra_path == self._prev_tundra_path:
            self._prev_tundra_path = props.tundra_path
            bpy.ops.b2rex.reload_components()
        if runexternal.find_application('server', [props.tundra_path], True):
            row.label(text='', icon='FILE_TICK')

        check_icon = ['CHECKBOX_DEHLT', 'CHECKBOX_HLT']
        col = layout.column_flow()
        col.operator('b2rex.toggleimportterrain', text="Import Terrain", icon=check_icon[props.importTerrain], emboss=False) 
        col.operator('b2rex.toggleimporttextures', text="Import Textures", icon=check_icon[props.importTextures], emboss=False) 
        col.operator('b2rex.toggle_safe_mode', text="Safe Mode",
                     icon=check_icon[b2rexpkg.safe_mode], emboss=False) 

        #col.prop(props,"regenMaterials")
        #col.prop(props,"regenObjects")

        #col.prop(props,"regenTextures")
        #col.prop(props,"regenMeshes")

        box = layout.row()
        box.operator_menu_enum("b2rex.loglevel", 'level', icon='INFO',
                               text=getLogLabel(props.loglevel))
        box = layout.row()
        box.prop(props, "kbytesPerSecond")
        box = layout.row()
        box.prop(props, "rt_budget")
        box = layout.row()
        box.prop(props, "rt_sec_budget")
        box = layout.row()
        box.prop(props, "pool_workers")
        box = layout.row()
        box.prop(props, "terrainLOD")
Example #2
0
 def draw(self, layout, session, props):
     if not self.expand(layout, title='Rex logic'):
         return False
     col = layout.column_flow(0)
     col.operator("b2rex.rexexport", text="Export").action = 'export'
     if runexternal.find_application('server', [props.tundra_path]):
         col.operator("b2rex.rexexport", text="Export and run").action = 'run'
     components = library.get_components('jsscript')
     box = layout.box()
     for component_name in components:
         component = components[component_name]
         box.label(component.name)
         if component.dependencies:
             deps = map(lambda s: s.replace('EC_', ''), component.dependencies)
             box.label("    "+", ".join(deps), icon='RNA')
         if component.attributes:
             box.label("    "+", ".join(component.attributes), icon='SETTINGS')
Example #3
0
    def run(self, context):
        """
        Export to tundra format and run the server on the given file.
        """
        dest_tundra = self.export(context)
        editor = self._parent

        # run tundra
        props = editor.exportSettings
        paths = []
        if props.tundra_path:
            paths.append(props.tundra_path)
        app_path = runexternal.find_application('server', paths)
        prevdir = os.curdir
        os.chdir(os.path.dirname(app_path))

        subprocess.call([app_path, '--file', dest_tundra])
        os.chdir(prevdir)
Example #4
0
    def run(self, context):
        """
        Export to tundra format and run the server on the given file.
        """
        dest_tundra = self.export(context)
        editor = self._parent

        # run tundra
        props = editor.exportSettings
        paths = []
        if props.tundra_path:
            paths.append(props.tundra_path)
        app_path = runexternal.find_application('server', paths)
        prevdir = os.curdir
        os.chdir(os.path.dirname(app_path))

        subprocess.call([app_path,
                          '--file',
                          dest_tundra])
        os.chdir(prevdir)
Example #5
0
 def draw(self, layout, session, props):
     if not self.expand(layout, title='Rex logic'):
         return False
     col = layout.column_flow(0)
     col.operator("b2rex.rexexport", text="Export").action = 'export'
     if runexternal.find_application('server', [props.tundra_path]):
         col.operator("b2rex.rexexport",
                      text="Export and run").action = 'run'
     components = library.get_components('jsscript')
     box = layout.box()
     for component_name in components:
         component = components[component_name]
         box.label(component.name)
         if component.dependencies:
             deps = map(lambda s: s.replace('EC_', ''),
                        component.dependencies)
             box.label("    " + ", ".join(deps), icon='RNA')
         if component.attributes:
             box.label("    " + ", ".join(component.attributes),
                       icon='SETTINGS')