示例#1
0
    def draw(self, context):
        """UI draw function."""
        layout = self.layout
        scene = context.scene

        if scene:
            # GLASS OBJECTS
            col = layout.column(align=True)
            col.label(text='Glass Objects', icon_value=get_icon(_ICON_TYPES.mesh_glass))
            row = col.row(align=True)
            row.operator('object.glass_objects_in_wireframes', text='Wires')
            row.operator('object.glass_objects_textured', text='Textured')

            # SHADOW CASTERS
            col = layout.column(align=True)
            col.label(text='Shadow Casters', icon_value=get_icon(_ICON_TYPES.mesh_shadow_caster))
            row = col.row(align=True)
            row.operator('object.shadow_caster_objects_in_wireframes', text='Wires')
            row.operator('object.shadow_caster_objects_textured', text='Textured')

            # COLLISION LOCATORS
            col = layout.column(align=True)
            col.label(text='Collision Locators', icon_value=get_icon(_ICON_TYPES.loc_collider))
            row = col.row(align=True)
            row.operator('object.all_collision_locators_wires', text='All Wires')
            row.operator('object.no_collision_locators_wires', text='No Wires')
            row = col.row(align=True)
            row.operator('object.all_collision_locators_faces', text='All Faces')
            row.operator('object.no_collision_locators_faces', text='No Faces')
示例#2
0
 def locator_type_items(self, context):
     return [
         ('None', "None", "Object is not locator", 'X_VEC', 0),
         ('Prefab', "Prefab", "Prefab locator", get_icon(_ICON_TYPES.loc_prefab), 1),
         ('Model', "Model", "Model locator", get_icon(_ICON_TYPES.loc_model), 2),
         ('Collision', "Collision", "Collision locator", get_icon(_ICON_TYPES.loc_collider), 3),
     ]
示例#3
0
 def locator_collider_type_items(self, context):
     return [
         ('Box', "Box", "Box collider type", get_icon(_ICON_TYPES.loc_collider_box), 0),
         ('Sphere', "Sphere", "Sphere collider type", get_icon(_ICON_TYPES.loc_collider_sphere), 1),
         ('Capsule', "Capsule", "Capsule collider type", get_icon(_ICON_TYPES.loc_collider_capsule), 2),
         ('Cylinder', "Cylinder", "Cylinder collider type", get_icon(_ICON_TYPES.loc_collider_cylinder), 3),
         ('Convex', "Convex", "Convex collider type", get_icon(_ICON_TYPES.loc_collider_convex), 4),
     ]
示例#4
0
 def empty_object_type_items(self, context):
     return [
         ('None', "None", "Normal Blender Empty object", 'X_VEC', 0),
         ('SCS_Root', "Root Object",
          "Empty object will become a 'SCS Root Object'",
          get_icon(_ICON_TYPES.scs_root), 1),
         ('Locator', "Locator", "Empty object will become a 'Locator'",
          get_icon(_ICON_TYPES.loc), 2),
     ]
示例#5
0
    def draw(self, context):
        layout = self.layout
        scene = context.scene

        if scene:
            col = layout.column(align=True)
            col.operator('object.make_convex',
                         text='Make Convex',
                         icon_value=get_icon(_ICON_TYPES.loc_collider_convex))
            col.operator('object.convert_meshes_to_convex_locator',
                         text='Convert to Locator',
                         icon_value=get_icon(_ICON_TYPES.loc))
            col.operator('object.convert_convex_locator_to_mesh',
                         text='Convert to Mesh',
                         icon='OUTLINER_OB_MESH')
示例#6
0
 def empty_object_type_items(self, context):
     """Returns object type items in real time, because of accessing to custom icons.
     """
     return [
         ('None', "None", "Normal Blender Empty object", 'X_VEC', 0),
         ('SCS_Root', "Root Object", "Empty object will become a 'SCS Root Object'", get_icon(_ICON_TYPES.scs_root), 1),
         ('Locator', "Locator", "Empty object will become a 'Locator'", get_icon(_ICON_TYPES.loc), 2),
     ]
示例#7
0
    def draw(self, context):
        layout = self.layout
        scene = context.scene

        if scene:
            col = layout.column(align=True)
            col.operator('object.make_convex', text='Make Convex', icon_value=get_icon(_ICON_TYPES.loc_collider_convex))
            col.operator('object.convert_meshes_to_convex_locator', text='Convert to Locator', icon_value=get_icon(_ICON_TYPES.loc))
            col.operator('object.convert_convex_locator_to_mesh', text='Convert to Mesh', icon='OUTLINER_OB_MESH')
示例#8
0
    def draw(self, context):
        layout = self.layout
        scene = context.scene

        if scene:
            col = layout.column(align=True)
            row = col.row(align=True)
            row.operator('object.create_scs_root_object',
                         text='Add Root',
                         icon_value=get_icon(_ICON_TYPES.scs_root))
            row.operator('object.create_scs_root_object_dialog',
                         text='',
                         icon='OUTLINER_DATA_FONT')
示例#9
0
 def locator_prefab_type_items(self, context):
     return [
         ('Control Node', "Control Node", "Control node locator type", get_icon(_ICON_TYPES.loc_prefab_node), 0),
         ('Sign', "Sign", "Sign locator type", get_icon(_ICON_TYPES.loc_prefab_sign), 1),
         ('Spawn Point', "Spawn Point", "Spawn point locator type", get_icon(_ICON_TYPES.loc_prefab_spawn), 2),
         ('Traffic Semaphore', "Traffic Semaphore", "Traffic light locator type", get_icon(_ICON_TYPES.loc_prefab_semaphore), 3),
         # ('cob', "Colbox", "Colbox locator type", 'X_VEC', 4),
         ('Navigation Point', "Navigation Point", "Navigation point locator type", get_icon(_ICON_TYPES.loc_prefab_navigation), 5),
         # ('nac', "Navigation Curve", "Navigation curve locator type", 'X_VEC', 6),
         ('Map Point', "Map Point", "Map point locator type", get_icon(_ICON_TYPES.loc_prefab_map), 7),
         ('Trigger Point', "Trigger Point", "Trigger point locator type", get_icon(_ICON_TYPES.loc_prefab_trigger), 8),
     ]
示例#10
0
    def draw(self, context):
        """UI draw function."""
        layout = self.layout
        scene = context.scene

        if scene:
            scs_root_is_reachable = _object_utils.get_scs_root(
                context.active_object) is not None

            box = layout.box()

            row = box.row()
            row.prop(scene.scs_props, "visibility_tools_scope", expand=True)

            col = box.column(align=True)
            col.enabled = scs_root_is_reachable or scene.scs_props.visibility_tools_scope == "Global"
            row1 = col.row(align=True)
            row1.alignment = 'CENTER'
            props = row1.operator('object.switch_model_objects_visibility',
                                  text='',
                                  icon_value=get_icon(_ICON_TYPES.mesh))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row1.operator('object.switch_shadow_casters_visibility',
                                  text='',
                                  icon_value=get_icon(
                                      _ICON_TYPES.mesh_shadow_caster))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row1.operator('object.switch_glass_objects_visibility',
                                  text='',
                                  icon_value=get_icon(_ICON_TYPES.mesh_glass))
            props.view_type = _OP_consts.ViewType.viewonly
            # TODO: Material Physics - has it sense?
            row1.operator('object.blank_operator',
                          text='',
                          icon_value=get_icon(_ICON_TYPES.mesh_with_physics))
            row2 = col.row(align=True)
            row2.alignment = 'CENTER'
            props = row2.operator('object.switch_all_locators_visibility',
                                  text='',
                                  icon_value=get_icon(_ICON_TYPES.loc))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_model_locators_visibility',
                                  text='',
                                  icon_value=get_icon(_ICON_TYPES.loc_model))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_locators_visibility',
                                  text='',
                                  icon_value=get_icon(_ICON_TYPES.loc_prefab))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator(
                'object.switch_collision_locators_visibility',
                text='',
                icon_value=get_icon(_ICON_TYPES.loc_collider))
            props.view_type = _OP_consts.ViewType.viewonly

            col = box.column(align=True)
            col.enabled = scs_root_is_reachable or scene.scs_props.visibility_tools_scope == "Global"
            row2 = col.row(align=True)
            row2.alignment = 'CENTER'
            props = row2.operator('object.switch_prefab_nodes_visibility',
                                  text='',
                                  icon_value=get_icon(
                                      _ICON_TYPES.loc_prefab_node))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_signs_visibility',
                                  text='',
                                  icon_value=get_icon(
                                      _ICON_TYPES.loc_prefab_sign))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_spawns_visibility',
                                  text='',
                                  icon_value=get_icon(
                                      _ICON_TYPES.loc_prefab_spawn))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_traffics_visibility',
                                  text='',
                                  icon_value=get_icon(
                                      _ICON_TYPES.loc_prefab_semaphore))
            props.view_type = _OP_consts.ViewType.viewonly
            row2 = col.row(align=True)
            row2.alignment = 'CENTER'
            props = row2.operator(
                'object.switch_prefab_navigations_visibility',
                text='',
                icon_value=get_icon(_ICONS_consts.Types.loc_prefab_navigation))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_maps_visibility',
                                  text='',
                                  icon_value=get_icon(
                                      _ICON_TYPES.loc_prefab_map))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_triggers_visibility',
                                  text='',
                                  icon_value=get_icon(
                                      _ICON_TYPES.loc_prefab_trigger))
            props.view_type = _OP_consts.ViewType.viewonly
            row2.operator('object.blank_operator', text='', icon='BLANK1')

            col = layout.column(align=True)
            col.enabled = scs_root_is_reachable or scene.scs_props.visibility_tools_scope == "Global"
            col.label("Current SCS Root:",
                      icon_value=get_icon(_ICONS_consts.Types.scs_root))
            col.operator('object.invert_visibility_within_root',
                         text='Invert Visibility')
            col.operator('object.view_all_objects_within_root',
                         text='View All')
            col.operator('object.isolate_objects_within_root', text='Isolate')
示例#11
0
 def draw_header(self, context):
     self.layout.label('', icon_value=get_icon(_ICON_TYPES.scs_logo))
示例#12
0
    def draw(self, context):
        layout = self.layout
        scene = context.scene

        if scene:
            col = layout.column(align=True)
            row = col.row(align=True)
            row.operator('object.create_scs_root_object', text='Add Root', icon_value=get_icon(_ICON_TYPES.scs_root))
            row.operator('object.create_scs_root_object_dialog', text='', icon='OUTLINER_DATA_FONT')
示例#13
0
    def draw(self, context):
        """UI draw function."""
        layout = self.layout
        scene = context.scene

        if scene:
            scs_root_is_reachable = _object_utils.get_scs_root(context.active_object) is not None

            box = layout.box()

            row = box.row()
            row.prop(scene.scs_props, "visibility_tools_scope", expand=True)

            col = box.column(align=True)
            col.enabled = scs_root_is_reachable or scene.scs_props.visibility_tools_scope == "Global"
            row1 = col.row(align=True)
            row1.alignment = 'CENTER'
            props = row1.operator('object.switch_model_objects_visibility', text='', icon_value=get_icon(_ICON_TYPES.mesh))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row1.operator('object.switch_shadow_casters_visibility', text='', icon_value=get_icon(_ICON_TYPES.mesh_shadow_caster))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row1.operator('object.switch_glass_objects_visibility', text='', icon_value=get_icon(_ICON_TYPES.mesh_glass))
            props.view_type = _OP_consts.ViewType.viewonly
            # TODO: Material Physics - has it sense?
            row1.operator('object.blank_operator', text='', icon_value=get_icon(_ICON_TYPES.mesh_with_physics))
            row2 = col.row(align=True)
            row2.alignment = 'CENTER'
            props = row2.operator('object.switch_all_locators_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_model_locators_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc_model))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_locators_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc_prefab))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_collision_locators_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc_collider))
            props.view_type = _OP_consts.ViewType.viewonly

            col = box.column(align=True)
            col.enabled = scs_root_is_reachable or scene.scs_props.visibility_tools_scope == "Global"
            row2 = col.row(align=True)
            row2.alignment = 'CENTER'
            props = row2.operator('object.switch_prefab_nodes_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc_prefab_node))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_signs_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc_prefab_sign))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_spawns_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc_prefab_spawn))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_traffics_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc_prefab_semaphore))
            props.view_type = _OP_consts.ViewType.viewonly
            row2 = col.row(align=True)
            row2.alignment = 'CENTER'
            props = row2.operator('object.switch_prefab_navigations_visibility', text='',
                                  icon_value=get_icon(_ICONS_consts.Types.loc_prefab_navigation))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_maps_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc_prefab_map))
            props.view_type = _OP_consts.ViewType.viewonly
            props = row2.operator('object.switch_prefab_triggers_visibility', text='', icon_value=get_icon(_ICON_TYPES.loc_prefab_trigger))
            props.view_type = _OP_consts.ViewType.viewonly
            row2.operator('object.blank_operator', text='', icon='BLANK1')

            col = layout.column(align=True)
            col.enabled = scs_root_is_reachable or scene.scs_props.visibility_tools_scope == "Global"
            col.label("Current SCS Root:", icon_value=get_icon(_ICONS_consts.Types.scs_root))
            col.operator('object.invert_visibility_within_root', text='Invert Visibility')
            col.operator('object.view_all_objects_within_root', text='View All')
            col.operator('object.isolate_objects_within_root', text='Isolate')
示例#14
0
 def empty_object_type_items(self, context):
     return [
         ('None', "None", "Normal Blender Empty object", 'X_VEC', 0),
         ('SCS_Root', "Root Object", "Empty object will become a 'SCS Root Object'", get_icon(_ICON_TYPES.scs_root), 1),
         ('Locator', "Locator", "Empty object will become a 'Locator'", get_icon(_ICON_TYPES.loc), 2),
     ]