привет ,аддон для блендер 3.3.0, не говори пока ничего:

bl_info = {
    "name": "F1 Track Data Editor",
    "author": "AlonsoBeast",
    "version": (1, 0),
    "blender": (3, 3, 0),
    "location": "View3D > Sidebar > F1 Track Builder Toolkit",
    "description": "Make prepare data to import in database file",
    "category": "3D View",
}

import bpy
import xml.etree.ElementTree as ET
from bpy_extras.io_utils import ExportHelper


TRACK_OPTIONS = [
    ("FULL LIST ID's","SHOW FULL LIST RESERVED TRACK ID's", ""),
    ("79", "ID 79 / frontend_track / RESERVED", ""),
    ("82", "ID 82 / Spa_Francorchamps / RESERVED", ""),
    ("83", "ID 83 / monza / RESERVED", ""),
    ("84", "ID 84 / catalunya / RESERVED", ""),
    ("85", "ID 85 / hungaroring / RESERVED", ""),
    ("86", "ID 86 / Abu_Dhabi / RESERVED", ""),
    ("87", "ID 87 / Bahrain / RESERVED", ""),
    ("88", "ID 88 / Brazil / RESERVED", ""),
    ("89", "ID 89 / Hockenheim / RESERVED", ""),
    ("90", "ID 90 / Istanbul / RESERVED", ""),
    ("91", "ID 91 / Melbourne / RESERVED", ""),
    ("92", "ID 92 / Monaco / RESERVED", ""),
    ("93", "ID 93 / Montreal / RESERVED", ""),
    ("95", "ID 95 / nurburgring / RESERVED", ""),
    ("96", "ID 96 / Sepang / RESERVED", ""),
    ("97", "ID 97 / Shanghai / RESERVED", ""),
    ("98", "ID 98 / Singapore / RESERVED", ""),
    ("99", "ID 99 / Suzuka / RESERVED", ""),
    ("100", "ID 100 / Valencia / RESERVED", ""),
    ("101", "ID 101 / Silverstone / RESERVED", ""),
    ("102", "ID 102 / Korea / RESERVED", ""),
    ("103", "ID 103 / Delhi / RESERVED", ""),
    ("104", "ID 104 / Texas / RESERVED", ""),
    ("105", "ID 105 / Jerez / RESERVED", ""),
    ("110", "ID 110 / Brands / RESERVED", ""),
    ("111", "ID 111 / Austria / RESERVED", ""),
    ("112", "ID 112 / Sochi / RESERVED", ""),
    ("113", "ID 113 / Imola / RESERVED", ""),
    ("114", "ID 114 / Estoril / RESERVED", ""),
    ("115", "ID 115 / Baku / RESERVED", ""),
    ("116", "ID 116 / Qatar / RESERVED", ""),
    ("117", "ID 117 / Miami / RESERVED", ""),
    ("118", "ID 118 / Mexico / RESERVED", ""),
    ("119", "ID 119 / Jeddah / RESERVED", ""),
    ("120", "ID 120 / Vegas / RESERVED", ""),
    ("121", "ID 121 / Zandvoort / RESERVED", ""),
    ("122", "ID 122 / Paul_ricard / RESERVED", ""),
    ("123", "ID 123 / Mugello / RESERVED", ""),
    ("124", "ID 124 / Portimao / RESERVED", ""),
]


MODEL_ID_OPTIONS = [
    ("FULL LIST ID's","SHOW FULL LIST RESERVED MODEL ID's", ""),
    ("44", "ID 44 / garage_01_00 / RESERVED", ""),
    ("118", "ID 118 / skipfe / RESERVED", ""),
    ("119", "ID 119 / garage_01_01 / RESERVED", ""),
    ("176", "ID 176 / Spa Francorchamps / RESERVED", ""),
    ("179", "ID 179 / Monza / RESERVED", ""),
    ("180", "ID 180 / Circuit de Catalunya / RESERVED", ""),
    ("181", "ID 181 / Hungaroring / RESERVED", ""),
    ("184", "ID 184 / Yas Marina Circuit / RESERVED", ""),
    ("185", "ID 185 / Bahrain International Circuit / RESERVED", ""),
    ("186", "ID 186 / Autodromo Jose Carlos Pace / RESERVED", ""),
    ("188", "ID 188 / Istanbul / RESERVED", ""),
    ("189", "ID 189 / Melbourne / RESERVED", ""),
    ("190", "ID 190 / Monaco / RESERVED", ""),
    ("191", "ID 191 / Montreal / RESERVED", ""),
    ("193", "ID 193 / Sepang / RESERVED", ""),
    ("194", "ID 194 / Shanghai / RESERVED", ""),
    ("195", "ID 195 / Singapore / RESERVED", ""),
    ("196", "ID 196 / Suzuka / RESERVED", ""),
    ("197", "ID 197 / Valencia / RESERVED", ""),
    ("199", "ID 199 / RESERVED", ""),
    ("201", "ID 201 / Silverstone / RESERVED", ""),
    ("202", "ID 202 / Korea / RESERVED", ""),
    ("205", "ID 205 / Nurburgring / RESERVED", ""),
    ("208", "ID 208 / Delhi / RESERVED", ""),
    ("212", "ID 212 / Hockenheim / RESERVED", ""),
    ("213", "ID 213 / Texas / RESERVED", ""),
    ("216", "ID 216 / Jerez / RESERVED", ""),
    ("219", "ID 219 / Brands Hatch / RESERVED", ""),
    ("220", "ID 220 / Austria / RESERVED", ""),
    ("221", "ID 221 / Sochi / RESERVED", ""),
    ("222", "ID 222 / Imola / RESERVED", ""),
    ("223", "ID 223 / Estoril / RESERVED", ""),
    ("224", "ID 224 / Baku / RESERVED", ""),
    ("225", "ID 225 / Miami / RESERVED", ""),
    ("226", "ID 226 / Qatar / RESERVED", ""),
    ("227", "ID 227 / Jeddah / RESERVED", ""),
    ("228", "ID 228 / Mexico / RESERVED", ""),
    ("229", "ID 229 / Las Vegas / RESERVED", ""),
    ("230", "ID 230 / Zandvoort / RESERVED", ""),
    ("231", "ID 231 / Paul Ricard / RESERVED", ""),
    ("232", "ID 232 / Mugello / RESERVED", ""),
    ("233", "ID 233 / Portimão, Algarve / RESERVED", ""),
]


FUEL_RESERVED_OPTIONS = [
    ("FULL LIST ID's","SHOW FULL LIST RESERVED FUEL ID's", ""),
    ("1", "ID 1 / spa_francorchamps / RESERVED", ""),
    ("2", "ID 2 / monza / RESERVED", ""),
    ("3", "ID 3 / catalunya / RESERVED", ""),
    ("4", "ID 4 / hungaroring / RESERVED", ""),
    ("5", "ID 5 / abu_dhabi / RESERVED", ""),
    ("6", "ID 6 / brazil / RESERVED", ""),
    ("7", "ID 7 / istanbul / RESERVED", ""),
    ("8", "ID 8 / melbourne / RESERVED", ""),
    ("9", "ID 9 / monaco / RESERVED", ""),
    ("10", "ID 10 / montreal / RESERVED", ""),
    ("11", "ID 11 / sepang / RESERVED", ""),
    ("12", "ID 12 / shanghai / RESERVED", ""),
    ("13", "ID 13 / singapore / RESERVED", ""),
    ("14", "ID 14 / suzuka / RESERVED", ""),
    ("15", "ID 15 / valencia / RESERVED", ""),
    ("16", "ID 16 / silverstone / RESERVED", ""),
    ("17", "ID 17 / korea / RESERVED", ""),
    ("18", "ID 18 / nurburgring / RESERVED", ""),
    ("19", "ID 19 / delhi / RESERVED", ""),
    ("20", "ID 20 / hockenheim / RESERVED", ""),
    ("21", "ID 21 / texas / RESERVED", ""),
    ("22", "ID 22 / bahrain / RESERVED", ""),
    ("23", "ID 23 / jerez / RESERVED", ""),
    ("24", "ID 24 / estoril / RESERVED", ""),
    ("25", "ID 25 / imola / RESERVED", ""),
    ("26", "ID 26 / brands / RESERVED", ""),
    ("27", "ID 27 / austria / RESERVED", ""),
    ("28", "ID 28 / sochi / RESERVED", ""),
    ("29", "ID 29 / qatar / RESERVED", ""),
    ("30", "ID 30 / miami / RESERVED", ""),
    ("31", "ID 31 / baku / RESERVED", ""),
    ("32", "ID 32 / jeddah / RESERVED", ""),
    ("33", "ID 33 / mexico / RESERVED", ""),
    ("34", "ID 34 / vegas / RESERVED", ""),
    ("35", "ID 35 / zandvoort / RESERVED", ""),
    ("36", "ID 36 / paul_ricard / RESERVED", ""),
    ("37", "ID 37 / mugello / RESERVED", ""),
    ("38", "ID 38 / portimao / RESERVED", ""),
]

PRIME_TYRE_OPTIONS = [
    ("2", "2 / Soft", "Soft tyre type"),
    ("3", "3 / Medium", "Medium tyre type"),
    ("4", "4 / Hard", "Hard tyre type"),
]


OPTION_TYRE_OPTIONS = [
    ("1", "1 / Soft", "Soft tyre type"),
    ("2", "2 / Medium", "Medium tyre type"),
    ("3", "3 / Hard", "Hard tyre type"),
]

def get_track_id_options(self, context):
    return TRACK_OPTIONS

def get_model_id_options(self, context):
    return MODEL_ID_OPTIONS
    
def get_fuel_reserved_options(self, context):
    return FUEL_RESERVED_OPTIONS 
    
def get_prime_tyre_options(self, context):
    return PRIME_TYRE_OPTIONS    

def get_option_tyre_options(self, context):
    return OPTION_TYRE_OPTIONS
    
def update_option_tyre(self, context):
    """Обновляет prime_tyre, когда меняется option_tyre"""
    option_value = int(self.option_tyre)
    prime_value = option_value + 1
    if prime_value in [2, 3, 4]:  
        self.prime_tyre = str(prime_value)

def update_prime_tyre(self, context):
    """Обновляет option_tyre, когда меняется prime_tyre"""
    prime_value = int(self.prime_tyre)
    option_value = prime_value - 1
    if option_value in [1, 2, 3]:  
        self.option_tyre = str(option_value)    

XML_DATA = '''
<root>
  <track>
    <additional_ground_clearance>0</additional_ground_clearance>
    <id>115</id>
    <license_package>0</license_package>
    <location_id>0</location_id>
    <name_string_id>baku</name_string_id>
    <nationality_id>75</nationality_id>
  </track>
  <track_car_handling>
    <AIDevTools>true</AIDevTools>
    <ID>32</ID>
    <Level>2</Level>
    <license_package>0</license_package>
    <Track>baku</Track>
  </track_car_handling>
  <track_fuel_distance>
    <fuel_usage_per_lap>2.11</fuel_usage_per_lap>
    <ID>31</ID>
    <l100percent>156.75</l100percent>
    <l10min>20</l10min>
    <l10percent>20</l10percent>
    <l12laps>20</l12laps>
    <l1lap>20</l1lap>
    <l20percent>19.01</l20percent>
    <l25percent>43.62</l25percent>
    <l30percent>45</l30percent>
    <l3laps>10.56</l3laps>
    <l40percent>56</l40percent>
    <l50percent>79.85</l50percent>
    <l5laps>14.79</l5laps>
    <l6laps>20</l6laps>
    <l75percent>106</l75percent>
    <l7laps>20</l7laps>
    <license_package>0</license_package>
    <track>baku</track>
  </track_fuel_distance>
  <track_model>
    <calender_glyph>24</calender_glyph>
    <calendar_glyph>24</calendar_glyph>
    <distance_to_first_corner>0</distance_to_first_corner>
    <downforce_level>2</downforce_level>
    <drs_double_detection>false</drs_double_detection>
    <easy_dry_lap_time_adjustment>0</easy_dry_lap_time_adjustment>
    <easy_wet_lap_time_adjustment>0</easy_wet_lap_time_adjustment>
    <every_track_achievement>false</every_track_achievement>
    <fe_index>0</fe_index>
    <file_string>baku</file_string>
    <final_lap_time_limit>110</final_lap_time_limit>
    <folder_string>circuits</folder_string>
    <fuel_tank_size>170</fuel_tank_size>
    <full_throttle_ratio>74</full_throttle_ratio>
    <gear_changes>48</gear_changes>
    <fullcareer_order>0</fullcareer_order>
    <mediumcareer_order>0</mediumcareer_order>
    <briefcareer_order>0</briefcareer_order>
    <seasonchallenge_order>0</seasonchallenge_order>
    <gp_mode_round_number>28</gp_mode_round_number>
    <hard_dry_lap_time_adjustment>0</hard_dry_lap_time_adjustment>
    <hard_wet_lap_time_adjustment>0</hard_wet_lap_time_adjustment>
    <id>224</id>
    <is_night_race>false</is_night_race>
    <lap_distance>2.71</lap_distance>
    <leaderboard_id>24</leaderboard_id>
    <length>0</length>
    <license_package>0</license_package>
    <local_audio_ambience>test</local_audio_ambience>
    <location>Test 5</location>
    <long_event_name>Race Preview Main Header</long_event_name>
    <long_track_name>Menu Second Header</long_track_name>
    <main_career_round_number>0</main_career_round_number>
    <max_safety_car>3</max_safety_car>
    <medium_event_name>Race Preview Second Header</medium_event_name>
    <minimap_dist_above>110</minimap_dist_above>
    <minimap_dist_behind>116</minimap_dist_behind>
    <minimap_file_string />
    <minimap_s1_icon_pos_x>-10</minimap_s1_icon_pos_x>
    <minimap_s1_icon_pos_y>1280</minimap_s1_icon_pos_y>
    <minimap_s2_icon_pos_x>-270</minimap_s2_icon_pos_x>
    <minimap_s2_icon_pos_y>260</minimap_s2_icon_pos_y>
    <minimap_s3_icon_pos_x>280</minimap_s3_icon_pos_x>
    <minimap_s3_icon_pos_y>17</minimap_s3_icon_pos_y>
    <minimap_sf_icon_pos_x>420</minimap_sf_icon_pos_x>
    <minimap_sf_icon_pos_y>1120</minimap_sf_icon_pos_y>
    <minimap_zoom>200</minimap_zoom>
    <name>lng_track_name_baku</name>
    <name_string_id>baku</name_string_id>
    <num_laps>51</num_laps>
    <number_of_turns>14</number_of_turns>
    <option_tyre>2</option_tyre>
    <p1_grip>0</p1_grip>
    <p2_grip>0.07912844</p2_grip>
    <p3_grip>0.1582569</p3_grip>
    <pit_lane_mirrored>true</pit_lane_mirrored>
    <pit_speed_limit_pq>16.667</pit_speed_limit_pq>
    <pit_speed_limit_race>27.778</pit_speed_limit_race>
    <pitstop_dry_race_time_cost>13.933</pitstop_dry_race_time_cost>
    <pitstop_wet_race_time_cost>14.72</pitstop_wet_race_time_cost>
    <prime_tyre>3</prime_tyre>
    <q1_grip>0.2110092</q1_grip>
    <q2_grip>0.2599388</q2_grip>
    <q3_grip>0.3088685</q3_grip>
    <race_fixture_name>lng_track_fixture_baku</race_fixture_name>
    <race_grip>0.3577982</race_grip>
    <route_string>route_0</route_string>
    <safety_car_chance>0.75</safety_car_chance>
    <seasonchallenge_weather>0</seasonchallenge_weather>
    <short_career_round_number>0</short_career_round_number>
    <short_career_weather>1</short_career_weather>
    <short_event_name>Menu Main Header</short_event_name>
    <short_pit_lane>false</short_pit_lane>
    <short_track_name>Test 6</short_track_name>
    <show_in_track_select_menu>true</show_in_track_select_menu>
    <skipfe_track>false</skipfe_track>
    <stat_average_lap_time>79</stat_average_lap_time>
    <stat_brake_wear_level>2</stat_brake_wear_level>
    <stat_downforce_level>2</stat_downforce_level>
    <supports_time_of_day>false</supports_time_of_day>
    <swap_for_dummy>false</swap_for_dummy>
    <top_speed>199</top_speed>
    <track_description>Your Nick</track_description>
    <track_id>115</track_id>
    <track_id_dev_string>baku</track_id_dev_string>
    <track_lights_on>false</track_lights_on>
    <tt_grip>0.3088685</tt_grip>
    <tyre_wear_level>2</tyre_wear_level>
    <upgrade_high_downforce>false</upgrade_high_downforce>
    <season>2014</season>
    <difficulty>3</difficulty>
  </track_model> 
  <track_difficulties>
    <easy>0.3</easy>
    <expert>1</expert>
    <hard>0.85</hard>
    <ID>26</ID>
    <license_package>0</license_package>
    <medium>0.533333</medium>
    <track>114</track>
  </track_difficulties>
</root>
'''

def load_xml_data():
    tree = ET.ElementTree(ET.fromstring(XML_DATA))
    return tree.getroot()

def update_scene_properties(context):
    root = load_xml_data()

    context.scene.track_id = root.find('.//track/id').text
    context.scene.name_string_id = root.find('.//track/name_string_id').text
    context.scene.nationality_id = root.find('.//track/nationality_id').text
    context.scene.carhandling_id = root.find('.//track_car_handling/ID').text
    context.scene.carhandling_track = root.find('.//track_car_handling/Track').text  
    context.scene.fuel_id = root.find('.//track_fuel_distance/ID').text
    context.scene.model_id = root.find('.//track_model/id').text
    context.scene.model_leaderboard_id = root.find('.//track_model/leaderboard_id').text
    context.scene.model_calender_glyph = root.find('.//track_model/calender_glyph').text
    context.scene.model_calendar_glyph = root.find('.//track_model/calendar_glyph').text
    context.scene.model_track_id = root.find('.//track_model/track_id').text
    context.scene.difficulty_id = root.find('.//track_difficulties/ID').text
    context.scene.difficulty_track = root.find('.//track_difficulties/track').text
    context.scene.selected_season = root.find('.//track_model/season').text
    context.scene.medium_event_name = root.find('.//track_model/medium_event_name').text
    context.scene.long_event_name = root.find('.//track_model/long_event_name').text
    context.scene.long_track_name = root.find('.//track_model/long_track_name').text
    context.scene.short_event_name = root.find('.//track_model/short_event_name').text
    context.scene.track_name = root.find('.//track_car_handling/Track').text  
    context.scene.track_description = root.find('.//track_model/track_description').text
    context.scene.fullcareer_order = root.find('.//track_model/fullcareer_order').text
    context.scene.num_laps = root.find('.//track_model/num_laps').text
    context.scene.gp_mode_round_number = root.find('.//track_model/gp_mode_round_number').text
    context.scene.main_career_round_number = root.find('.//track_model/main_career_round_number').text
    context.scene.prime_tyre = root.find('.//track_model/prime_tyre').text
    context.scene.option_tyre = root.find('.//track_model/option_tyre').text

class F1TrackBuilderPanel(bpy.types.Panel):
    bl_label = "F1 Track Data Editor"
    bl_idname = "VIEW3D_PT_f1_track_builder"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = 'F1 Track DataEditor'

    def draw(self, context):
        layout = self.layout
        layout.label(text="Track Name (lowercase only):")
        row = layout.row(align=True)
        row.prop(context.scene, 'track_name', text="", icon='TEXT')

        row = layout.row()
        row.operator("f1trackbuilder.rename_track", text="Rename Track")

        layout.label(text="Click Load Data Reference to show an example strings.")
        
        row = layout.row(align=True)
        row.prop(context.scene, 'track_id', text="Track ID Unique")
        row = layout.row(align=True)
        row.prop(context.scene, 'reserved_id_list', text="") 
        row = layout.row(align=True)
        row.prop(context.scene, 'model_id', text="Model ID Unique")
        row = layout.row(align=True)
        row.prop(context.scene, 'model_id_enum', text="")
        row = layout.row(align=True)
        row.prop(context.scene, 'short_event_name', text="Short Event Name")
        row = layout.row(align=True)
        row.prop(context.scene, 'long_track_name', text="Long Track Name")
        row = layout.row(align=True)
        row.prop(context.scene, 'long_event_name', text="Long Event Name")
        row = layout.row(align=True)
        row.prop(context.scene, 'medium_event_name', text="Medium Event Name")
        row = layout.row(align=True)
        row.prop(context.scene, 'fullcareer_order', text="Menu Card Order")
        row = layout.row(align=True)
        row.prop(context.scene, 'num_laps', text="Total Laps")
        row = layout.row(align=True)
        row.prop(context.scene, 'option_tyre', text="Option Tyre")
        row = layout.row(align=True)
        row.prop(context.scene, 'prime_tyre', text="Prime Tyre")
        row = layout.row(align=True)
        row.prop(context.scene, 'gp_mode_round_number', text="F1 2013 GP Menu Order")
        row = layout.row(align=True)
        row.prop(context.scene, 'main_career_round_number', text="F1 2013 Career Order")
        row = layout.row(align=True)
        row.prop(context.scene, 'track_description', text="Mod Author")

        layout.operator("f1trackbuilder.update_props", text="Load Data Reference")
        layout.operator("f1trackbuilder.export_xml", text="Export Data Track XML")

class RenameTrackOperator(bpy.types.Operator):
    bl_idname = "f1trackbuilder.rename_track"
    bl_label = "Rename Track"

    def execute(self, context):
        old_name = "baku"  
        new_name = context.scene.track_name
        
  
        if not new_name.islower():
            self.report({'ERROR'}, "Track name must be in lowercase only!")
            return {'CANCELLED'}


        new_name = new_name.replace(" ", "_")
        

        if not new_name:
            self.report({'ERROR'}, "Track name cannot be empty or consist only of spaces!")
            return {'CANCELLED'}

        self.report({'INFO'}, f"Will replace '{old_name}' with '{new_name}' in the XML.")
        context.scene.track_name = new_name 

        return {'FINISHED'}

class UpdateScenePropertiesOperator(bpy.types.Operator):
    bl_idname = "f1trackbuilder.update_props"
    bl_label = "Update Scene Properties"

    def execute(self, context):
        update_scene_properties(context)
        self.report({'INFO'}, "Data was updated")
        return {'FINISHED'}

class ExportXML(bpy.types.Operator, ExportHelper):
    bl_idname = "f1trackbuilder.export_xml"
    bl_label = "Export XML"
    
    filename_ext = ".xml"
    filter_glob: bpy.props.StringProperty(
        default="*.xml",
        options={'HIDDEN'},
        maxlen=255,
    )

    def execute(self, context):
    
        root = ET.fromstring(XML_DATA)


        track_id_value = context.scene.track_id

    
        for elem in root.iter():
            if elem.text:
          
                elem.text = elem.text.replace("baku", context.scene.track_name).replace("Baku", context.scene.track_name.capitalize())

        
                if elem.tag == "track":
                    id_elem = elem.find("id")
                    if id_elem is not None:
                        id_elem.text = track_id_value  
                    name_string_id_elem = elem.find("name_string_id")
                    if name_string_id_elem is not None:
                        name_string_id_elem.text = context.scene.name_string_id
                    nationality_id_elem = elem.find("nationality_id")
                    if nationality_id_elem is not None:
                        nationality_id_elem.text = context.scene.nationality_id

                elif elem.tag == "track_car_handling":
                    car_handling_id_elem = elem.find("ID")
                    if car_handling_id_elem is not None:
                        car_handling_id_elem.text = context.scene.carhandling_id
                    track_elem = elem.find("Track")
                    if track_elem is not None:
                        track_elem.text = context.scene.carhandling_track

                elif elem.tag == "track_fuel_distance":
                    id_elem = elem.find("ID")
                    if id_elem is not None:
                        id_elem.text = context.scene.fuel_id

                elif elem.tag == "track_model":
                    id_elem = elem.find("id")
                    if id_elem is not None:
                        id_elem.text = context.scene.model_id
                    leaderboard_id_elem = elem.find("leaderboard_id")
                    if leaderboard_id_elem is not None:
                        leaderboard_id_elem.text = context.scene.model_leaderboard_id
                    calendar_glyph_elem = elem.find("calender_glyph")
                    if calendar_glyph_elem is not None:
                        calendar_glyph_elem.text = context.scene.model_calender_glyph
                    city_glyph_elem = elem.find("calendar_glyph")
                    if city_glyph_elem is not None:
                        city_glyph_elem.text = context.scene.model_calendar_glyph
                    trackid_glyph_elem = elem.find("track_id")
                    if trackid_glyph_elem is not None:
                        trackid_glyph_elem.text = track_id_value  
                 
                    fullcareer_elem = elem.find("fullcareer_order")
                    if fullcareer_elem is not None:
                        fullcareer_elem.text = context.scene.fullcareer_order
                    num_laps_elem = elem.find("num_laps")
                    if num_laps_elem is not None:
                        num_laps_elem.text = context.scene.num_laps
                    gp_mode_elem = elem.find("gp_mode_round_number")
                    if gp_mode_elem is not None:
                        gp_mode_elem.text = context.scene.gp_mode_round_number
                    main_career_elem = elem.find("main_career_round_number")
                    if main_career_elem is not None:
                        main_career_elem.text = context.scene.main_career_round_number
                    track_desc_elem = elem.find("track_description")
                    if track_desc_elem is not None:
                        track_desc_elem.text = context.scene.track_description
                    prime_tyre_elem = elem.find("prime_tyre")
                    if prime_tyre_elem is not None:
                        prime_tyre_elem.text = context.scene.prime_tyre
                    option_tyre_elem = elem.find("option_tyre")
                    if option_tyre_elem is not None:
                        option_tyre_elem.text = context.scene.option_tyre                        

                
                    medium_event_elem = elem.find("medium_event_name")
                    if medium_event_elem is not None:
                        medium_event_elem.text = context.scene.medium_event_name
                    long_event_elem = elem.find("long_event_name")
                    if long_event_elem is not None:
                        long_event_elem.text = context.scene.long_event_name
                    long_track_elem = elem.find("long_track_name")
                    if long_track_elem is not None:
                        long_track_elem.text = context.scene.long_track_name
                    short_event_elem = elem.find("short_event_name")
                    if short_event_elem is not None:
                        short_event_elem.text = context.scene.short_event_name

                elif elem.tag == "track_difficulties":
                    id_elem = elem.find("ID")
                    if id_elem is not None:
                        id_elem.text = context.scene.difficulty_id
                    track_elem = elem.find("track")
                    if track_elem is not None:
                        track_elem.text = track_id_value  

            
                if elem.tag == "track_model":
                    season_elem = elem.find("season")
                    if season_elem is not None:
                        season_elem.text = context.scene.selected_season


        tree = ET.ElementTree(root)
        tree.write(self.filepath, encoding='utf-8', xml_declaration=True)

        self.report({'INFO'}, f"Save as {self.filepath}")
        return {'FINISHED'}

def register():
    bpy.utils.register_class(F1TrackBuilderPanel)
    bpy.utils.register_class(UpdateScenePropertiesOperator)
    bpy.utils.register_class(ExportXML)
    bpy.utils.register_class(RenameTrackOperator)

    bpy.types.Scene.track_id = bpy.props.StringProperty(name="Track ID Unique")
    bpy.types.Scene.name_string_id = bpy.props.StringProperty(name="Name String ID")
    bpy.types.Scene.nationality_id = bpy.props.StringProperty(name="Nationality ID")
    bpy.types.Scene.carhandling_id = bpy.props.StringProperty(name="Car Handling ID")
    bpy.types.Scene.carhandling_track = bpy.props.StringProperty(name="Car Handling Track")  
    bpy.types.Scene.model_id_enum = bpy.props.EnumProperty(
        name="Model ID Reserved",
        description="Select a Reserved Model ID",
        items=MODEL_ID_OPTIONS
    )
    bpy.types.Scene.fuel_reserved = bpy.props.EnumProperty(
        name="Fuel ID Reserved",
        description="Select a Reserved Fuel ID",
        items=FUEL_RESERVED_OPTIONS
    )
    bpy.types.Scene.fuel_id = bpy.props.StringProperty(name="Fuel ID Unique")
    bpy.types.Scene.model_id = bpy.props.StringProperty(name="Model ID Unique")
    bpy.types.Scene.model_leaderboard_id = bpy.props.StringProperty(name="Model Leaderboard ID Unique")
    bpy.types.Scene.model_calender_glyph = bpy.props.StringProperty(name="F1 2013 Calender Order - Unique")
    bpy.types.Scene.model_calendar_glyph = bpy.props.StringProperty(name="Calendar Order Unique")
    bpy.types.Scene.model_track_id = bpy.props.StringProperty(name="Model Track ID")
    bpy.types.Scene.difficulty_id = bpy.props.StringProperty(name="Difficulty ID Unique")
    bpy.types.Scene.difficulty_track = bpy.props.StringProperty(name="Difficulty Track Unique")
    bpy.types.Scene.selected_season = bpy.props.StringProperty(name="Select Game (Any Number)")
    bpy.types.Scene.medium_event_name = bpy.props.StringProperty(name="Medium Event Name Unique")
    bpy.types.Scene.long_event_name = bpy.props.StringProperty(name="Long Event Name Unique")
    bpy.types.Scene.long_track_name = bpy.props.StringProperty(name="Long Track Name Unique")
    bpy.types.Scene.short_event_name = bpy.props.StringProperty(name="Short Event Name Unique")
    bpy.types.Scene.fullcareer_order = bpy.props.StringProperty(name="Menu Card Order")
    bpy.types.Scene.num_laps = bpy.props.StringProperty(name="Total Laps")
    bpy.types.Scene.gp_mode_round_number = bpy.props.StringProperty(name="F1 2013 GP Menu Order")
    bpy.types.Scene.main_career_round_number = bpy.props.StringProperty(name="F1 2013 Career Order")
    bpy.types.Scene.track_description = bpy.props.StringProperty(name="Mod Author", default="Your Nick")
    bpy.types.Scene.reserved_id_list = bpy.props.EnumProperty(
        name="Show Reserved IDs",
        description="Select a Reserved Track ID",
        items=TRACK_OPTIONS
    )
    
    bpy.types.Scene.track_name = bpy.props.StringProperty(
        name="Track Name",
        description="Enter the new track name (lowercase only)",
        default="baku"  
    )
    bpy.types.Scene.prime_tyre = bpy.props.EnumProperty(
        name="Prime Tyre",
        description="Select the prime tyre type",
        items=PRIME_TYRE_OPTIONS,
        default="3",
        update=update_prime_tyre 
    )
    bpy.types.Scene.option_tyre = bpy.props.EnumProperty(
        name="Option Tyre",
        description="Select the option tyre type",
        items=OPTION_TYRE_OPTIONS,
        default="2",
        update=update_option_tyre 
    )

def unregister():
    bpy.utils.unregister_class(F1TrackBuilderPanel)
    bpy.utils.unregister_class(UpdateScenePropertiesOperator)
    bpy.utils.unregister_class(ExportXML)
    bpy.utils.unregister_class(RenameTrackOperator)

    del bpy.types.Scene.track_id
    del bpy.types.Scene.name_string_id
    del bpy.types.Scene.nationality_id
    del bpy.types.Scene.carhandling_id
    del bpy.types.Scene.carhandling_track  
    del bpy.types.Scene.fuel_id
    del bpy.types.Scene.fuel_reserved
    del bpy.types.Scene.model_id_enum
    del bpy.types.Scene.model_id
    del bpy.types.Scene.model_leaderboard_id
    del bpy.types.Scene.model_calender_glyph
    del bpy.types.Scene.model_calendar_glyph
    del bpy.types.Scene.model_track_id
    del bpy.types.Scene.difficulty_id
    del bpy.types.Scene.difficulty_track
    del bpy.types.Scene.selected_season
    del bpy.types.Scene.medium_event_name
    del bpy.types.Scene.long_event_name
    del bpy.types.Scene.long_track_name
    del bpy.types.Scene.short_event_name
    del bpy.types.Scene.fullcareer_order
    del bpy.types.Scene.num_laps
    del bpy.types.Scene.gp_mode_round_number
    del bpy.types.Scene.main_career_round_number
    del bpy.types.Scene.track_name
    del bpy.types.Scene.reserved_id_list
    del bpy.types.Scene.prime_tyre
    del bpy.types.Scene.option_tyre

if __name__ == "__main__":
    register()