Exemple #1
0
 def fill_paths_section():
     """Fills up "Paths" section."""
     section = _SectionData("Paths")
     section.props.append(
         ("ProjectPath",
          _property.get_default(bpy.types.GlobalSCSProps.scs_project_path)))
     section.props.append(("", ""))
     section.props.append(
         ("ShaderPresetsFilePath",
          _property.get_default(
              bpy.types.GlobalSCSProps.shader_presets_filepath)))
     # section.props.append(("CgFXTemplatesFilePath", _get_scs_globals().cgfx_templates_filepath))
     # section.props.append(("CgFXRelDirPath", _get_scs_globals().cgfx_library_rel_path))
     section.props.append(
         ("SignRelFilePath",
          _property.get_default(
              bpy.types.GlobalSCSProps.sign_library_rel_path)))
     section.props.append(
         ("TSemProfileRelFilePath",
          _property.get_default(
              bpy.types.GlobalSCSProps.tsem_library_rel_path)))
     section.props.append(
         ("TrafficRulesRelFilePath",
          _property.get_default(
              bpy.types.GlobalSCSProps.traffic_rules_library_rel_path)))
     section.props.append(
         ("HookupRelDirPath",
          _property.get_default(
              bpy.types.GlobalSCSProps.hookup_library_rel_path)))
     section.props.append(
         ("MatSubsRelFilePath",
          _property.get_default(
              bpy.types.GlobalSCSProps.matsubs_library_rel_path)))
     return section
Exemple #2
0
 def fill_global_colors_section():
     """Fills up "GlobalColors" section."""
     section = _SectionData("GlobalColors")
     section.props.append(("PrefabLocatorsWire", tuple(_property.get_default(bpy.types.SceneSCSProps.locator_prefab_wire_color))))
     section.props.append(("ModelLocatorsWire", tuple(_property.get_default(bpy.types.SceneSCSProps.locator_model_wire_color))))
     section.props.append(("ColliderLocatorsWire", tuple(_property.get_default(bpy.types.SceneSCSProps.locator_coll_wire_color))))
     section.props.append(("ColliderLocatorsFace", tuple(_property.get_default(bpy.types.SceneSCSProps.locator_coll_face_color))))
     section.props.append(("NavigationCurveBase", tuple(_property.get_default(bpy.types.SceneSCSProps.np_connection_base_color))))
     section.props.append(("MapLineBase", tuple(_property.get_default(bpy.types.SceneSCSProps.mp_connection_base_color))))
     section.props.append(("TriggerLineBase", tuple(_property.get_default(bpy.types.SceneSCSProps.tp_connection_base_color))))
     section.props.append(("InfoText", tuple(_property.get_default(bpy.types.SceneSCSProps.info_text_color))))
     return section
Exemple #3
0
 def fill_global_colors_section():
     """Fills up "GlobalColors" section."""
     section = _SectionData("GlobalColors")
     section.props.append(("PrefabLocatorsWire", tuple(_property_utils.get_default(bpy.types.SceneSCSProps.locator_prefab_wire_color))))
     section.props.append(("ModelLocatorsWire", tuple(_property_utils.get_default(bpy.types.SceneSCSProps.locator_model_wire_color))))
     section.props.append(("ColliderLocatorsWire", tuple(_property_utils.get_default(bpy.types.SceneSCSProps.locator_coll_wire_color))))
     section.props.append(("ColliderLocatorsFace", tuple(_property_utils.get_default(bpy.types.SceneSCSProps.locator_coll_face_color))))
     section.props.append(("NavigationCurveBase", tuple(_property_utils.get_default(bpy.types.SceneSCSProps.np_connection_base_color))))
     section.props.append(("MapLineBase", tuple(_property_utils.get_default(bpy.types.SceneSCSProps.mp_connection_base_color))))
     section.props.append(("TriggerLineBase", tuple(_property_utils.get_default(bpy.types.SceneSCSProps.tp_connection_base_color))))
     section.props.append(("InfoText", tuple(_property_utils.get_default(bpy.types.SceneSCSProps.info_text_color))))
     return section
Exemple #4
0
 def fill_header_section():
     """Fills up "Header" section."""
     section = _SectionData("Header")
     section.props.append(("FormatVersion", 1))
     section.props.append(("Source", get_combined_ver_str()))
     section.props.append(("Type", "Configuration"))
     section.props.append(("Note", "User settings of SCS Blender Tools"))
     author = bpy.context.user_preferences.system.author
     if author:
         section.props.append(("Author", str(author)))
     section.props.append(("DumpLevel", _property.get_default(bpy.types.GlobalSCSProps.dump_level)))
     return section
Exemple #5
0
 def fill_header_section():
     """Fills up "Header" section."""
     section = _SectionData("Header")
     section.props.append(("FormatVersion", 1))
     section.props.append(("Source", get_combined_ver_str()))
     section.props.append(("Type", "Configuration"))
     section.props.append(("Note", "User settings of SCS Blender Tools"))
     author = bpy.context.user_preferences.system.author
     if author:
         section.props.append(("Author", str(author)))
     section.props.append(("DumpLevel", _property_utils.get_default(bpy.types.GlobalSCSProps.dump_level)))
     return section
Exemple #6
0
 def fill_global_display_section():
     """Fills up "GlobalDisplay" section."""
     section = _SectionData("GlobalDisplay")
     section.props.append(
         ("DisplayLocators",
          int(
              _property.get_default(
                  bpy.types.SceneSCSProps.display_locators))))
     section.props.append(
         ("LocatorSize",
          _property.get_default(bpy.types.SceneSCSProps.locator_size)))
     section.props.append(("LocatorEmptySize",
                           _property.get_default(
                               bpy.types.SceneSCSProps.locator_empty_size)))
     section.props.append(
         ("DisplayConnections",
          int(
              _property.get_default(
                  bpy.types.SceneSCSProps.display_connections))))
     section.props.append(
         ("CurveSegments",
          _property.get_default(bpy.types.SceneSCSProps.curve_segments)))
     section.props.append(
         ("DisplayTextInfo",
          _property.get_default(bpy.types.SceneSCSProps.display_info)))
     return section
Exemple #7
0
 def fill_global_display_section():
     """Fills up "GlobalDisplay" section."""
     section = _SectionData("GlobalDisplay")
     section.props.append(("DisplayLocators", int(_property.get_default(bpy.types.SceneSCSProps.display_locators))))
     section.props.append(("LocatorSize", _property.get_default(bpy.types.SceneSCSProps.locator_size)))
     section.props.append(("LocatorEmptySize", _property.get_default(bpy.types.SceneSCSProps.locator_empty_size)))
     section.props.append(("DisplayConnections", int(_property.get_default(bpy.types.SceneSCSProps.display_connections))))
     section.props.append(("CurveSegments", _property.get_default(bpy.types.SceneSCSProps.curve_segments)))
     section.props.append(("DisplayTextInfo", _property.get_default(bpy.types.SceneSCSProps.display_info)))
     return section
Exemple #8
0
 def fill_paths_section():
     """Fills up "Paths" section."""
     section = _SectionData("Paths")
     section.props.append(("ProjectPath", _property.get_default(bpy.types.GlobalSCSProps.scs_project_path)))
     section.props.append(("", ""))
     section.props.append(("ShaderPresetsFilePath", _property.get_default(bpy.types.GlobalSCSProps.shader_presets_filepath)))
     # section.props.append(("CgFXTemplatesFilePath", _get_scs_globals().cgfx_templates_filepath))
     # section.props.append(("CgFXRelDirPath", _get_scs_globals().cgfx_library_rel_path))
     section.props.append(("SignRelFilePath", _property.get_default(bpy.types.GlobalSCSProps.sign_library_rel_path)))
     section.props.append(("TSemProfileRelFilePath", _property.get_default(bpy.types.GlobalSCSProps.tsem_library_rel_path)))
     section.props.append(("TrafficRulesRelFilePath", _property.get_default(bpy.types.GlobalSCSProps.traffic_rules_library_rel_path)))
     section.props.append(("HookupRelDirPath", _property.get_default(bpy.types.GlobalSCSProps.hookup_library_rel_path)))
     section.props.append(("MatSubsRelFilePath", _property.get_default(bpy.types.GlobalSCSProps.matsubs_library_rel_path)))
     return section
Exemple #9
0
 def fill_export_section():
     """Fills up "Export" section."""
     section = _SectionData("Export")
     section.props.append(("ContentType", _property.get_default(bpy.types.GlobalSCSProps.content_type)))
     section.props.append(("ExportScale", _property.get_default(bpy.types.GlobalSCSProps.export_scale)))
     section.props.append(("ApplyModifiers", int(_property.get_default(bpy.types.GlobalSCSProps.apply_modifiers))))
     section.props.append(("ExcludeEdgesplit", int(_property.get_default(bpy.types.GlobalSCSProps.exclude_edgesplit))))
     section.props.append(("IncludeEdgesplit", int(_property.get_default(bpy.types.GlobalSCSProps.include_edgesplit))))
     section.props.append(("ActiveUVOnly", int(_property.get_default(bpy.types.GlobalSCSProps.active_uv_only))))
     section.props.append(("ExportVertexGroups", int(_property.get_default(bpy.types.GlobalSCSProps.export_vertex_groups))))
     section.props.append(("ExportVertexColor", int(_property.get_default(bpy.types.GlobalSCSProps.export_vertex_color))))
     section.props.append(("ExportVertexColorType", _property.get_default(bpy.types.GlobalSCSProps.export_vertex_color_type)))
     section.props.append(("ExportVertexColorType7", _property.get_default(bpy.types.GlobalSCSProps.export_vertex_color_type_7)))
     # section.props.append(("ExportAnimFile", info.get_default_prop_value(bpy.types.GlobalSCSProps.export_anim_file)))
     section.props.append(("ExportPimFile", int(_property.get_default(bpy.types.GlobalSCSProps.export_pim_file))))
     section.props.append(("OutputType", _property.get_default(bpy.types.GlobalSCSProps.output_type)))
     section.props.append(("ExportPitFile", int(_property.get_default(bpy.types.GlobalSCSProps.export_pit_file))))
     section.props.append(("ExportPicFile", int(_property.get_default(bpy.types.GlobalSCSProps.export_pic_file))))
     section.props.append(("ExportPipFile", int(_property.get_default(bpy.types.GlobalSCSProps.export_pip_file))))
     section.props.append(("SignExport", int(_property.get_default(bpy.types.GlobalSCSProps.sign_export))))
     return section
Exemple #10
0
 def fill_import_section():
     """Fills up "Import" section."""
     section = _SectionData("Import")
     section.props.append(("ImportScale", _property.get_default(bpy.types.GlobalSCSProps.import_scale)))
     section.props.append(("ImportPimFile", int(_property.get_default(bpy.types.GlobalSCSProps.import_pim_file))))
     section.props.append(("UseWelding", int(_property.get_default(bpy.types.GlobalSCSProps.use_welding))))
     section.props.append(("WeldingPrecision", int(_property.get_default(bpy.types.GlobalSCSProps.welding_precision))))
     section.props.append(("ImportPitFile", int(_property.get_default(bpy.types.GlobalSCSProps.import_pit_file))))
     section.props.append(("LoadTextures", int(_property.get_default(bpy.types.GlobalSCSProps.load_textures))))
     section.props.append(("ImportPicFile", int(_property.get_default(bpy.types.GlobalSCSProps.import_pic_file))))
     section.props.append(("ImportPipFile", int(_property.get_default(bpy.types.GlobalSCSProps.import_pip_file))))
     section.props.append(("ImportPisFile", int(_property.get_default(bpy.types.GlobalSCSProps.import_pis_file))))
     section.props.append(("ConnectedBones", int(_property.get_default(bpy.types.GlobalSCSProps.connected_bones))))
     section.props.append(("BoneImportScale", _property.get_default(bpy.types.GlobalSCSProps.bone_import_scale)))
     section.props.append(("ImportPiaFile", int(_property.get_default(bpy.types.GlobalSCSProps.import_pia_file))))
     section.props.append(("IncludeSubdirsForPia", int(_property.get_default(bpy.types.GlobalSCSProps.include_subdirs_for_pia))))
     section.props.append(("MeshCreationType", _property.get_default(bpy.types.GlobalSCSProps.mesh_creation_type)))
     return section
Exemple #11
0
def apply_settings():
    """Applies all the settings to the active scene."""

    config_container = _pix.get_data_from_file(get_config_filepath(), "    ")

    # save file paths in extra variables and apply them on the end
    # to make sure all of the settings are loaded first.
    # This is needed as some libraries reading are driven by other values from config file.
    # For example: "use_infixed"
    scs_project_path = _property_utils.get_default(bpy.types.GlobalSCSProps.scs_project_path)
    shader_presets_filepath = _property_utils.get_default(bpy.types.GlobalSCSProps.shader_presets_filepath)
    trigger_actions_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.trigger_actions_rel_path)
    sign_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.sign_library_rel_path)
    tsem_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.tsem_library_rel_path)
    traffic_rules_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.traffic_rules_library_rel_path)
    hookup_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.hookup_library_rel_path)
    matsubs_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.matsubs_library_rel_path)
    conv_hlpr_converters_path = _property_utils.get_default(bpy.types.GlobalSCSProps.conv_hlpr_converters_path)

    _get_scs_globals().config_update_lock = True
    # print('  > apply_settings...')
    settings_file_valid = 0
    for section in config_container:
        if settings_file_valid == 2:
            if section.type == "Paths":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "ProjectPath":
                        scs_project_path = prop[1]
                    elif prop[0] == "ShaderPresetsFilePath":
                        shader_presets_filepath = prop[1]
                    elif prop[0] == "TriggerActionsRelFilePath":
                        trigger_actions_rel_path = prop[1]
                    elif prop[0] == "TriggerActionsUseInfixed":
                        _get_scs_globals().trigger_actions_use_infixed = prop[1]
                    elif prop[0] == "SignRelFilePath":
                        sign_library_rel_path = prop[1]
                    elif prop[0] == "SignUseInfixed":
                        _get_scs_globals().sign_library_use_infixed = prop[1]
                    elif prop[0] == "TSemProfileRelFilePath":
                        tsem_library_rel_path = prop[1]
                    elif prop[0] == "TSemProfileUseInfixed":
                        _get_scs_globals().tsem_library_use_infixed = prop[1]
                    elif prop[0] == "TrafficRulesRelFilePath":
                        traffic_rules_library_rel_path = prop[1]
                    elif prop[0] == "TrafficRulesUseInfixed":
                        _get_scs_globals().traffic_rules_library_use_infixed = prop[1]
                    elif prop[0] == "HookupRelDirPath":
                        hookup_library_rel_path = prop[1]
                    elif prop[0] == "MatSubsRelFilePath":
                        matsubs_library_rel_path = prop[1]
                    elif prop[0] == "ConvertersPath":
                        conv_hlpr_converters_path = prop[1]
                    else:
                        lprint('W Unrecognised item "%s" has been found in setting file! Skipping...', (str(prop[0]),))
            elif section.type == "Import":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "ImportScale":
                        _get_scs_globals().import_scale = float(prop[1])
                    elif prop[0] == "ImportPimFile":
                        _get_scs_globals().import_pim_file = prop[1]
                    elif prop[0] == "UseWelding":
                        _get_scs_globals().use_welding = prop[1]
                    elif prop[0] == "WeldingPrecision":
                        _get_scs_globals().welding_precision = prop[1]
                    elif prop[0] == "UseNormals":
                        _get_scs_globals().use_normals = prop[1]
                    elif prop[0] == "ImportPitFile":
                        _get_scs_globals().import_pit_file = prop[1]
                    elif prop[0] == "LoadTextures":
                        _get_scs_globals().load_textures = prop[1]
                    elif prop[0] == "ImportPicFile":
                        _get_scs_globals().import_pic_file = prop[1]
                    elif prop[0] == "ImportPipFile":
                        _get_scs_globals().import_pip_file = prop[1]
                    elif prop[0] == "ImportPisFile":
                        _get_scs_globals().import_pis_file = prop[1]
                    elif prop[0] == "ConnectedBones":
                        _get_scs_globals().connected_bones = prop[1]
                    elif prop[0] == "BoneImportScale":
                        _get_scs_globals().bone_import_scale = float(prop[1])
                    elif prop[0] == "ImportPiaFile":
                        _get_scs_globals().import_pia_file = prop[1]
                    elif prop[0] == "IncludeSubdirsForPia":
                        _get_scs_globals().include_subdirs_for_pia = prop[1]
            elif section.type == "Export":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "ExportScale":
                        _get_scs_globals().export_scale = float(prop[1])
                    elif prop[0] == "ApplyModifiers":
                        _get_scs_globals().apply_modifiers = prop[1]
                    elif prop[0] == "ExcludeEdgesplit":
                        _get_scs_globals().exclude_edgesplit = prop[1]
                    elif prop[0] == "IncludeEdgesplit":
                        _get_scs_globals().include_edgesplit = prop[1]
                    elif prop[0] == "ActiveUVOnly":
                        _get_scs_globals().active_uv_only = prop[1]
                    elif prop[0] == "ExportVertexGroups":
                        _get_scs_globals().export_vertex_groups = prop[1]
                    elif prop[0] == "ExportVertexColor":
                        _get_scs_globals().export_vertex_color = prop[1]
                    elif prop[0] == "ExportVertexColorType":
                        _get_scs_globals().export_vertex_color_type = str(prop[1])
                    elif prop[0] == "ExportVertexColorType7":
                        _get_scs_globals().export_vertex_color_type_7 = str(prop[1])
                    # elif prop[0] == "ExportAnimFile":
                    # _get_scs_globals().export_anim_file = prop[1]
                    elif prop[0] == "ExportPimFile":
                        _get_scs_globals().export_pim_file = prop[1]
                    elif prop[0] == "OutputType":
                        _get_scs_globals().output_type = prop[1]
                    elif prop[0] == "ExportPitFile":
                        _get_scs_globals().export_pit_file = prop[1]
                    elif prop[0] == "ExportPicFile":
                        _get_scs_globals().export_pic_file = prop[1]
                    elif prop[0] == "ExportPipFile":
                        _get_scs_globals().export_pip_file = prop[1]
                    elif prop[0] == "SignExport":
                        _get_scs_globals().sign_export = prop[1]
            elif section.type == "GlobalDisplay":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "DisplayLocators":
                        _get_scs_globals().display_locators = prop[1]
                    elif prop[0] == "LocatorSize":
                        _get_scs_globals().locator_size = float(prop[1])
                    elif prop[0] == "LocatorEmptySize":
                        _get_scs_globals().locator_empty_size = float(prop[1])
                    elif prop[0] == "DisplayConnections":
                        _get_scs_globals().display_connections = prop[1]
                    elif prop[0] == "CurveSegments":
                        _get_scs_globals().curve_segments = prop[1]
                    elif prop[0] == "OptimizedConnsDrawing":
                        _get_scs_globals().optimized_connections_drawing = prop[1]
                    elif prop[0] == "DisplayTextInfo":
                        _get_scs_globals().display_info = prop[1]
                    else:
                        lprint('W Unrecognised item "%s" has been found in setting file! Skipping...', (str(prop[0]),))
            elif section.type == "GlobalColors":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "PrefabLocatorsWire":
                        _get_scs_globals().locator_prefab_wire_color = prop[1]
                    elif prop[0] == "ModelLocatorsWire":
                        _get_scs_globals().locator_model_wire_color = prop[1]
                    elif prop[0] == "ColliderLocatorsWire":
                        _get_scs_globals().locator_coll_wire_color = prop[1]
                    elif prop[0] == "ColliderLocatorsFace":
                        _get_scs_globals().locator_coll_face_color = prop[1]
                    elif prop[0] == "NavigationCurveBase":
                        _get_scs_globals().np_connection_base_color = prop[1]
                    elif prop[0] == "MapLineBase":
                        _get_scs_globals().mp_connection_base_color = prop[1]
                    elif prop[0] == "TriggerLineBase":
                        _get_scs_globals().tp_connection_base_color = prop[1]
                    elif prop[0] == "InfoText":
                        _get_scs_globals().info_text_color = prop[1]
                    else:
                        lprint('W Unrecognised item "%s" has been found in setting file! Skipping...', (str(prop[0]),))
            elif section.type == "Various":
                for prop in section.props:
                    # if prop[0] == "#":
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "DumpLevel":
                        _get_scs_globals().dump_level = prop[1]
        elif section.type == "Header":
            for prop in section.props:
                if prop[0] == "FormatVersion":
                    if prop[1] == 1:
                        settings_file_valid += 1
                elif prop[0] == "Type":
                    if prop[1] == "Configuration":
                        settings_file_valid += 1
                elif prop[0] == "DumpLevel":
                    _get_scs_globals().dump_level = prop[1]

    # now as last apply all of the file paths
    _get_scs_globals().scs_project_path = scs_project_path
    _get_scs_globals().shader_presets_filepath = shader_presets_filepath
    _get_scs_globals().trigger_actions_rel_path = trigger_actions_rel_path
    _get_scs_globals().sign_library_rel_path = sign_library_rel_path
    _get_scs_globals().tsem_library_rel_path = tsem_library_rel_path
    _get_scs_globals().traffic_rules_library_rel_path = traffic_rules_library_rel_path
    _get_scs_globals().hookup_library_rel_path = hookup_library_rel_path
    _get_scs_globals().matsubs_library_rel_path = matsubs_library_rel_path
    _get_scs_globals().conv_hlpr_converters_path = conv_hlpr_converters_path

    _get_scs_globals().config_update_lock = False
    return True
Exemple #12
0
 def fill_paths_section():
     """Fills up "Paths" section."""
     section = _SectionData("Paths")
     section.props.append(("ProjectPath", _property_utils.get_default(bpy.types.GlobalSCSProps.scs_project_path)))
     section.props.append(("", ""))
     section.props.append(("ShaderPresetsFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.shader_presets_filepath)))
     section.props.append(("TriggerActionsRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.trigger_actions_rel_path)))
     section.props.append(("TriggerActionsUseInfixed", int(_property_utils.get_default(bpy.types.GlobalSCSProps.trigger_actions_use_infixed))))
     section.props.append(("SignRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.sign_library_rel_path)))
     section.props.append(("SignUseInfixed", int(_property_utils.get_default(bpy.types.GlobalSCSProps.sign_library_use_infixed))))
     section.props.append(("TSemProfileRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.tsem_library_rel_path)))
     section.props.append(("TSemProfileUseInfixed", int(_property_utils.get_default(bpy.types.GlobalSCSProps.tsem_library_use_infixed))))
     section.props.append(("TrafficRulesRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.traffic_rules_library_rel_path)))
     section.props.append(("TrafficRulesUseInfixed", int(_property_utils.get_default(bpy.types.GlobalSCSProps.traffic_rules_library_use_infixed))))
     section.props.append(("HookupRelDirPath", _property_utils.get_default(bpy.types.GlobalSCSProps.hookup_library_rel_path)))
     section.props.append(("MatSubsRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.matsubs_library_rel_path)))
     section.props.append(("ConvertersPath", _property_utils.get_default(bpy.types.GlobalSCSProps.conv_hlpr_converters_path)))
     return section
Exemple #13
0
def apply_settings():
    """Applies all the settings to the active scene."""

    config_container = _pix.get_data_from_file(get_config_filepath(), "    ")

    # save file paths in extra variables and apply them on the end
    # to make sure all of the settings are loaded first.
    # This is needed as some libraries reading are driven by other values from config file.
    # For example: "use_infixed"
    scs_project_path = _property_utils.get_default(bpy.types.GlobalSCSProps.scs_project_path)
    shader_presets_filepath = _property_utils.get_default(bpy.types.GlobalSCSProps.shader_presets_filepath)
    trigger_actions_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.trigger_actions_rel_path)
    sign_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.sign_library_rel_path)
    tsem_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.tsem_library_rel_path)
    traffic_rules_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.traffic_rules_library_rel_path)
    hookup_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.hookup_library_rel_path)
    matsubs_library_rel_path = _property_utils.get_default(bpy.types.GlobalSCSProps.matsubs_library_rel_path)

    _get_scs_globals().config_update_lock = True
    # print('  > apply_settings...')
    settings_file_valid = 0
    for section in config_container:
        if settings_file_valid == 2:
            if section.type == "Paths":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "ProjectPath":
                        scs_project_path = prop[1]
                    elif prop[0] == "ShaderPresetsFilePath":
                        shader_presets_filepath = prop[1]
                    elif prop[0] == "TriggerActionsRelFilePath":
                        trigger_actions_rel_path = prop[1]
                    elif prop[0] == "TriggerActionsUseInfixed":
                        _get_scs_globals().trigger_actions_use_infixed = prop[1]
                    elif prop[0] == "SignRelFilePath":
                        sign_library_rel_path = prop[1]
                    elif prop[0] == "SignUseInfixed":
                        _get_scs_globals().sign_library_use_infixed = prop[1]
                    elif prop[0] == "TSemProfileRelFilePath":
                        tsem_library_rel_path = prop[1]
                    elif prop[0] == "TSemProfileUseInfixed":
                        _get_scs_globals().tsem_library_use_infixed = prop[1]
                    elif prop[0] == "TrafficRulesRelFilePath":
                        traffic_rules_library_rel_path = prop[1]
                    elif prop[0] == "TrafficRulesUseInfixed":
                        _get_scs_globals().traffic_rules_library_use_infixed = prop[1]
                    elif prop[0] == "HookupRelDirPath":
                        hookup_library_rel_path = prop[1]
                    elif prop[0] == "MatSubsRelFilePath":
                        matsubs_library_rel_path = prop[1]
                    else:
                        lprint('W Unrecognised item "%s" has been found in setting file! Skipping...', (str(prop[0]),))
            elif section.type == "Import":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "ImportScale":
                        _get_scs_globals().import_scale = float(prop[1])
                    elif prop[0] == "ImportPimFile":
                        _get_scs_globals().import_pim_file = prop[1]
                    elif prop[0] == "UseWelding":
                        _get_scs_globals().use_welding = prop[1]
                    elif prop[0] == "WeldingPrecision":
                        _get_scs_globals().welding_precision = prop[1]
                    elif prop[0] == "UseNormals":
                        _get_scs_globals().use_normals = prop[1]
                    elif prop[0] == "ImportPitFile":
                        _get_scs_globals().import_pit_file = prop[1]
                    elif prop[0] == "LoadTextures":
                        _get_scs_globals().load_textures = prop[1]
                    elif prop[0] == "ImportPicFile":
                        _get_scs_globals().import_pic_file = prop[1]
                    elif prop[0] == "ImportPipFile":
                        _get_scs_globals().import_pip_file = prop[1]
                    elif prop[0] == "ImportPisFile":
                        _get_scs_globals().import_pis_file = prop[1]
                    elif prop[0] == "ConnectedBones":
                        _get_scs_globals().connected_bones = prop[1]
                    elif prop[0] == "BoneImportScale":
                        _get_scs_globals().bone_import_scale = float(prop[1])
                    elif prop[0] == "ImportPiaFile":
                        _get_scs_globals().import_pia_file = prop[1]
                    elif prop[0] == "IncludeSubdirsForPia":
                        _get_scs_globals().include_subdirs_for_pia = prop[1]
            elif section.type == "Export":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "ContentType":
                        _get_scs_globals().content_type = prop[1]
                    elif prop[0] == "ExportScale":
                        _get_scs_globals().export_scale = float(prop[1])
                    elif prop[0] == "ApplyModifiers":
                        _get_scs_globals().apply_modifiers = prop[1]
                    elif prop[0] == "ExcludeEdgesplit":
                        _get_scs_globals().exclude_edgesplit = prop[1]
                    elif prop[0] == "IncludeEdgesplit":
                        _get_scs_globals().include_edgesplit = prop[1]
                    elif prop[0] == "ActiveUVOnly":
                        _get_scs_globals().active_uv_only = prop[1]
                    elif prop[0] == "ExportVertexGroups":
                        _get_scs_globals().export_vertex_groups = prop[1]
                    elif prop[0] == "ExportVertexColor":
                        _get_scs_globals().export_vertex_color = prop[1]
                    elif prop[0] == "ExportVertexColorType":
                        _get_scs_globals().export_vertex_color_type = str(prop[1])
                    elif prop[0] == "ExportVertexColorType7":
                        _get_scs_globals().export_vertex_color_type_7 = str(prop[1])
                    # elif prop[0] == "ExportAnimFile":
                    # _get_scs_globals().export_anim_file = prop[1]
                    elif prop[0] == "ExportPimFile":
                        _get_scs_globals().export_pim_file = prop[1]
                    elif prop[0] == "OutputType":
                        _get_scs_globals().output_type = prop[1]
                    elif prop[0] == "ExportPitFile":
                        _get_scs_globals().export_pit_file = prop[1]
                    elif prop[0] == "ExportPicFile":
                        _get_scs_globals().export_pic_file = prop[1]
                    elif prop[0] == "ExportPipFile":
                        _get_scs_globals().export_pip_file = prop[1]
                    elif prop[0] == "SignExport":
                        _get_scs_globals().sign_export = prop[1]
            elif section.type == "GlobalDisplay":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "DisplayLocators":
                        bpy.context.scene.scs_props.display_locators = prop[1]
                    elif prop[0] == "LocatorSize":
                        bpy.context.scene.scs_props.locator_size = float(prop[1])
                    elif prop[0] == "LocatorEmptySize":
                        bpy.context.scene.scs_props.locator_empty_size = float(prop[1])
                    elif prop[0] == "DisplayConnections":
                        bpy.context.scene.scs_props.display_connections = prop[1]
                    elif prop[0] == "CurveSegments":
                        bpy.context.scene.scs_props.curve_segments = prop[1]
                    elif prop[0] == "OptimizedConnsDrawing":
                        bpy.context.scene.scs_props.optimized_connections_drawing = prop[1]
                    elif prop[0] == "DisplayTextInfo":
                        bpy.context.scene.scs_props.display_info = prop[1]
                    else:
                        lprint('W Unrecognised item "%s" has been found in setting file! Skipping...', (str(prop[0]),))
            elif section.type == "GlobalColors":
                for prop in section.props:
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "PrefabLocatorsWire":
                        bpy.context.scene.scs_props.locator_prefab_wire_color = prop[1]
                    elif prop[0] == "ModelLocatorsWire":
                        bpy.context.scene.scs_props.locator_model_wire_color = prop[1]
                    elif prop[0] == "ColliderLocatorsWire":
                        bpy.context.scene.scs_props.locator_coll_wire_color = prop[1]
                    elif prop[0] == "ColliderLocatorsFace":
                        bpy.context.scene.scs_props.locator_coll_face_color = prop[1]
                    elif prop[0] == "NavigationCurveBase":
                        bpy.context.scene.scs_props.np_connection_base_color = prop[1]
                    elif prop[0] == "MapLineBase":
                        bpy.context.scene.scs_props.mp_connection_base_color = prop[1]
                    elif prop[0] == "TriggerLineBase":
                        bpy.context.scene.scs_props.tp_connection_base_color = prop[1]
                    elif prop[0] == "InfoText":
                        bpy.context.scene.scs_props.info_text_color = prop[1]
                    else:
                        lprint('W Unrecognised item "%s" has been found in setting file! Skipping...', (str(prop[0]),))
            elif section.type == "Various":
                for prop in section.props:
                    # if prop[0] == "#":
                    if prop[0] in ("", "#"):
                        pass
                    elif prop[0] == "DumpLevel":
                        _get_scs_globals().dump_level = prop[1]
        elif section.type == "Header":
            for prop in section.props:
                if prop[0] == "FormatVersion":
                    if prop[1] == 1:
                        settings_file_valid += 1
                elif prop[0] == "Type":
                    if prop[1] == "Configuration":
                        settings_file_valid += 1
                elif prop[0] == "DumpLevel":
                    _get_scs_globals().dump_level = prop[1]

    # now as last apply all of the file paths
    _get_scs_globals().scs_project_path = scs_project_path
    _get_scs_globals().shader_presets_filepath = shader_presets_filepath
    _get_scs_globals().trigger_actions_rel_path = trigger_actions_rel_path
    _get_scs_globals().sign_library_rel_path = sign_library_rel_path
    _get_scs_globals().tsem_library_rel_path = tsem_library_rel_path
    _get_scs_globals().traffic_rules_library_rel_path = traffic_rules_library_rel_path
    _get_scs_globals().hookup_library_rel_path = hookup_library_rel_path
    _get_scs_globals().matsubs_library_rel_path = matsubs_library_rel_path

    _get_scs_globals().config_update_lock = False
    return True
Exemple #14
0
 def fill_export_section():
     """Fills up "Export" section."""
     section = _SectionData("Export")
     section.props.append(("ContentType", _property_utils.get_default(bpy.types.GlobalSCSProps.content_type)))
     section.props.append(("ExportScale", _property_utils.get_default(bpy.types.GlobalSCSProps.export_scale)))
     section.props.append(("ApplyModifiers", int(_property_utils.get_default(bpy.types.GlobalSCSProps.apply_modifiers))))
     section.props.append(("ExcludeEdgesplit", int(_property_utils.get_default(bpy.types.GlobalSCSProps.exclude_edgesplit))))
     section.props.append(("IncludeEdgesplit", int(_property_utils.get_default(bpy.types.GlobalSCSProps.include_edgesplit))))
     section.props.append(("ActiveUVOnly", int(_property_utils.get_default(bpy.types.GlobalSCSProps.active_uv_only))))
     section.props.append(("ExportVertexGroups", int(_property_utils.get_default(bpy.types.GlobalSCSProps.export_vertex_groups))))
     section.props.append(("ExportVertexColor", int(_property_utils.get_default(bpy.types.GlobalSCSProps.export_vertex_color))))
     section.props.append(("ExportVertexColorType", _property_utils.get_default(bpy.types.GlobalSCSProps.export_vertex_color_type)))
     section.props.append(("ExportVertexColorType7", _property_utils.get_default(bpy.types.GlobalSCSProps.export_vertex_color_type_7)))
     # section.props.append(("ExportAnimFile", info.get_default_prop_value(bpy.types.GlobalSCSProps.export_anim_file)))
     section.props.append(("ExportPimFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.export_pim_file))))
     section.props.append(("OutputType", _property_utils.get_default(bpy.types.GlobalSCSProps.output_type)))
     section.props.append(("ExportPitFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.export_pit_file))))
     section.props.append(("ExportPicFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.export_pic_file))))
     section.props.append(("ExportPipFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.export_pip_file))))
     section.props.append(("SignExport", int(_property_utils.get_default(bpy.types.GlobalSCSProps.sign_export))))
     return section
Exemple #15
0
 def fill_import_section():
     """Fills up "Import" section."""
     section = _SectionData("Import")
     section.props.append(("ImportScale", _property_utils.get_default(bpy.types.GlobalSCSProps.import_scale)))
     section.props.append(("ImportPimFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.import_pim_file))))
     section.props.append(("UseWelding", int(_property_utils.get_default(bpy.types.GlobalSCSProps.use_welding))))
     section.props.append(("WeldingPrecision", int(_property_utils.get_default(bpy.types.GlobalSCSProps.welding_precision))))
     section.props.append(("UseNormals", int(_property_utils.get_default(bpy.types.GlobalSCSProps.use_normals))))
     section.props.append(("ImportPitFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.import_pit_file))))
     section.props.append(("LoadTextures", int(_property_utils.get_default(bpy.types.GlobalSCSProps.load_textures))))
     section.props.append(("ImportPicFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.import_pic_file))))
     section.props.append(("ImportPipFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.import_pip_file))))
     section.props.append(("ImportPisFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.import_pis_file))))
     section.props.append(("ConnectedBones", int(_property_utils.get_default(bpy.types.GlobalSCSProps.connected_bones))))
     section.props.append(("BoneImportScale", _property_utils.get_default(bpy.types.GlobalSCSProps.bone_import_scale)))
     section.props.append(("ImportPiaFile", int(_property_utils.get_default(bpy.types.GlobalSCSProps.import_pia_file))))
     section.props.append(("IncludeSubdirsForPia", int(_property_utils.get_default(bpy.types.GlobalSCSProps.include_subdirs_for_pia))))
     return section
Exemple #16
0
 def fill_paths_section():
     """Fills up "Paths" section."""
     section = _SectionData("Paths")
     section.props.append(("ProjectPath", _property_utils.get_default(bpy.types.GlobalSCSProps.scs_project_path)))
     section.props.append(("", ""))
     section.props.append(("ShaderPresetsFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.shader_presets_filepath)))
     section.props.append(("TriggerActionsRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.trigger_actions_rel_path)))
     section.props.append(("TriggerActionsUseInfixed", int(_property_utils.get_default(bpy.types.GlobalSCSProps.trigger_actions_use_infixed))))
     section.props.append(("SignRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.sign_library_rel_path)))
     section.props.append(("SignUseInfixed", int(_property_utils.get_default(bpy.types.GlobalSCSProps.sign_library_use_infixed))))
     section.props.append(("TSemProfileRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.tsem_library_rel_path)))
     section.props.append(("TSemProfileUseInfixed", int(_property_utils.get_default(bpy.types.GlobalSCSProps.tsem_library_use_infixed))))
     section.props.append(("TrafficRulesRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.traffic_rules_library_rel_path)))
     section.props.append(("TrafficRulesUseInfixed", int(_property_utils.get_default(bpy.types.GlobalSCSProps.traffic_rules_library_use_infixed))))
     section.props.append(("HookupRelDirPath", _property_utils.get_default(bpy.types.GlobalSCSProps.hookup_library_rel_path)))
     section.props.append(("MatSubsRelFilePath", _property_utils.get_default(bpy.types.GlobalSCSProps.matsubs_library_rel_path)))
     return section