Example #1
0
    def scs_project_path_update(self, context):
        # Update all related paths so their libraries gets reloaded from new "SCS Project Path" location.
        if not _get_scs_globals().config_update_lock:
            # utils.update_cgfx_library_rel_path(_get_scs_globals().cgfx_library_rel_path)
            _config_container.update_sign_library_rel_path(
                _get_scs_globals().scs_sign_model_inventory,
                _get_scs_globals().sign_library_rel_path)

            _config_container.update_tsem_library_rel_path(
                _get_scs_globals().scs_tsem_profile_inventory,
                _get_scs_globals().tsem_library_rel_path)

            _config_container.update_traffic_rules_library_rel_path(
                _get_scs_globals().scs_traffic_rules_inventory,
                _get_scs_globals().traffic_rules_library_rel_path)

            _config_container.update_hookup_library_rel_path(
                _get_scs_globals().scs_hookup_inventory,
                _get_scs_globals().hookup_library_rel_path)

            _config_container.update_matsubs_inventory(
                _get_scs_globals().scs_matsubs_inventory,
                _get_scs_globals().matsubs_library_rel_path)

            _config_container.update_item_in_file('Paths.ProjectPath',
                                                  self.scs_project_path)

        # Update Blender image textures according to SCS texture records, so the images are loaded always from the correct locations.
        _material_utils.correct_blender_texture_paths()

        return None
Example #2
0
def post_save(scene):
    # reaload inventories
    readonly = True
    scs_globals = _get_scs_globals()
    _config_container.update_hookup_library_rel_path(
        scs_globals.scs_hookup_inventory,
        scs_globals.hookup_library_rel_path,
        readonly
    )
    _config_container.update_matsubs_inventory(
        scs_globals.scs_matsubs_inventory,
        scs_globals.matsubs_library_rel_path,
        readonly
    )
    _config_container.update_traffic_rules_library_rel_path(
        scs_globals.scs_traffic_rules_inventory,
        scs_globals.traffic_rules_library_rel_path,
        readonly
    )
    _config_container.update_tsem_library_rel_path(
        scs_globals.scs_tsem_profile_inventory,
        scs_globals.tsem_library_rel_path,
        readonly
    )
    _config_container.update_sign_library_rel_path(
        scs_globals.scs_sign_model_inventory,
        scs_globals.sign_library_rel_path,
        readonly
    )
Example #3
0
    def scs_project_path_update(self, context):
        # Update all related paths so their libraries gets reloaded from new "SCS Project Path" location.
        if not _get_scs_globals().config_update_lock:
            # utils.update_cgfx_library_rel_path(_get_scs_globals().cgfx_library_rel_path)
            _config_container.update_sign_library_rel_path(_get_scs_globals().scs_sign_model_inventory,
                                                           _get_scs_globals().sign_library_rel_path)

            _config_container.update_tsem_library_rel_path(_get_scs_globals().scs_tsem_profile_inventory,
                                                           _get_scs_globals().tsem_library_rel_path)

            _config_container.update_traffic_rules_library_rel_path(_get_scs_globals().scs_traffic_rules_inventory,
                                                                    _get_scs_globals().traffic_rules_library_rel_path)

            _config_container.update_hookup_library_rel_path(_get_scs_globals().scs_hookup_inventory,
                                                             _get_scs_globals().hookup_library_rel_path)

            _config_container.update_matsubs_inventory(_get_scs_globals().scs_matsubs_inventory,
                                                       _get_scs_globals().matsubs_library_rel_path)

            _config_container.update_item_in_file('Paths.ProjectPath', self.scs_project_path)

        # Update Blender image textures according to SCS texture records, so the images are loaded always from the correct locations.
        _material_utils.correct_blender_texture_paths()

        return None
Example #4
0
def post_save(scene):
    # reload inventories
    readonly = True
    scs_globals = _get_scs_globals()
    _config_container.update_hookup_library_rel_path(
        scs_globals.scs_hookup_inventory,
        scs_globals.hookup_library_rel_path,
        readonly
    )
    _config_container.update_matsubs_inventory(
        scs_globals.scs_matsubs_inventory,
        scs_globals.matsubs_library_rel_path,
        readonly
    )
    _config_container.update_traffic_rules_library_rel_path(
        scs_globals.scs_traffic_rules_inventory,
        scs_globals.traffic_rules_library_rel_path,
        readonly
    )
    _config_container.update_tsem_library_rel_path(
        scs_globals.scs_tsem_profile_inventory,
        scs_globals.tsem_library_rel_path,
        readonly
    )
    _config_container.update_sign_library_rel_path(
        scs_globals.scs_sign_model_inventory,
        scs_globals.sign_library_rel_path,
        readonly
    )
Example #5
0
    def scs_project_path_update(self, context):
        # Update all related paths so their libraries gets reloaded from new "SCS Project Path" location.
        if not _get_scs_globals().config_update_lock:
            _config_container.update_sign_library_rel_path(
                _get_scs_globals().scs_sign_model_inventory,
                _get_scs_globals().sign_library_rel_path)

            _config_container.update_tsem_library_rel_path(
                _get_scs_globals().scs_tsem_profile_inventory,
                _get_scs_globals().tsem_library_rel_path)

            _config_container.update_traffic_rules_library_rel_path(
                _get_scs_globals().scs_traffic_rules_inventory,
                _get_scs_globals().traffic_rules_library_rel_path)

            _config_container.update_hookup_library_rel_path(
                _get_scs_globals().scs_hookup_inventory,
                _get_scs_globals().hookup_library_rel_path)

            _config_container.update_matsubs_inventory(
                _get_scs_globals().scs_matsubs_inventory,
                _get_scs_globals().matsubs_library_rel_path)

            _config_container.update_item_in_file('Paths.ProjectPath',
                                                  self.scs_project_path)

        return None
Example #6
0
    def tsem_library_use_infixed_update(self, context):

        if not _get_scs_globals(
        ).config_update_lock:  # prevent reloading library when blender is starting
            _config_container.update_tsem_library_rel_path(
                _get_scs_globals().scs_tsem_profile_inventory,
                self.tsem_library_rel_path,
                readonly=True)

        _config_container.update_item_in_file(
            'Paths.TSemProfileUseInfixed', int(self.tsem_library_use_infixed))
Example #7
0
 def tsem_library_rel_path_update(self, context):
     # print('Traffic Semaphore Profile Path UPDATE: "%s"' % self.tsem_library_rel_path)
     _config_container.update_tsem_library_rel_path(_get_scs_globals().scs_tsem_profile_inventory,
                                                    self.tsem_library_rel_path)
     return None
Example #8
0
 def tsem_library_rel_path_update(self, context):
     # print('Traffic Semaphore Profile Path UPDATE: "%s"' % self.tsem_library_rel_path)
     _config_container.update_tsem_library_rel_path(
         _get_scs_globals().scs_tsem_profile_inventory,
         self.tsem_library_rel_path)
     return None
Example #9
0
 def tsem_library_rel_path_update(self, context):
     _config_container.update_tsem_library_rel_path(
         _get_scs_globals().scs_tsem_profile_inventory,
         self.tsem_library_rel_path)
     return None