Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7bc25a1
cleaned up level importer, added type hints, tested for bugs a little…
Nov 20, 2022
9a2511b
removed accidentally created file
Nov 20, 2022
35fe6f5
Merge remote-tracking branch 'KCS/fast64_main' into fast64_main
Nov 23, 2022
6fb0c4c
Merge branch 'fast64_main' into importers
Nov 23, 2022
8a47ee5
Merge remote-tracking branch 'fast64/main' into importers
Dec 4, 2022
10d30a1
Merge remote-tracking branch 'fast64/main' into importers
May 10, 2023
5bfec0d
rewrote import plugin to use generic data parser scheme for all parsi…
Jun 29, 2023
3d9a53b
made code cleaner and added type hints
Jun 30, 2023
1a53408
made armature exporting matching for goomba as test, with working ani…
Jul 7, 2023
a7ce46f
fixed file cleaning errors, fixed vtx buffer name parsing issue, fixe…
Sep 10, 2023
17d7b7e
added enums for selecting actor models to import
Sep 10, 2023
d2bc689
Merge remote-tracking branch 'fast64/main' into importers
Feb 17, 2024
33de751
Merge remote-tracking branch 'fast64/main' into importers
Mar 1, 2024
2e47830
merged and fixed a bunch of stuffs and all that you are welcome reonu
Aug 3, 2024
3ef1690
fixed more bugs with importing and added macro parsing for all the de…
Aug 4, 2024
7fba392
merged main
Jan 1, 2025
933676e
fixed plugin UVs on newer blender versions
Jan 1, 2025
c7ceaa1
fixed a bunch of importing bugs, made armatures work, cleaned up code…
Mar 13, 2025
c456be7
added support for linking objects for special objects, added passes f…
Mar 18, 2025
4da4809
profiling, sped up import by approx half, still much more to go
Mar 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
934 changes: 934 additions & 0 deletions fast64_internal/f3d/f3d_import.py

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions fast64_internal/sm64/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@
sm64_anim_unregister,
)

from .sm64_level_importer import (
sm64_import_panel_register,
sm64_import_panel_unregister,
sm64_import_register,
sm64_import_unregister,
)


def sm64_panel_register():
settings_panels_register()
Expand All @@ -98,6 +105,7 @@ def sm64_panel_register():
sm64_bone_panel_register()
sm64_cam_panel_register()
sm64_obj_panel_register()
sm64_import_panel_register()
sm64_geo_parser_panel_register()
sm64_geo_writer_panel_register()
sm64_spline_panel_register()
Expand All @@ -113,6 +121,7 @@ def sm64_panel_unregister():
sm64_bone_panel_unregister()
sm64_cam_panel_unregister()
sm64_obj_panel_unregister()
sm64_import_panel_unregister()
sm64_geo_parser_panel_unregister()
sm64_geo_writer_panel_unregister()
sm64_spline_panel_unregister()
Expand All @@ -130,6 +139,7 @@ def sm64_register(register_panels: bool):
sm64_obj_register()
sm64_geo_parser_register()
sm64_geo_writer_register()
sm64_import_register()
sm64_level_register()
sm64_spline_register()
sm64_dl_writer_register()
Expand All @@ -156,6 +166,7 @@ def sm64_unregister(unregister_panels: bool):
sm64_dl_parser_unregister()
sm64_anim_unregister()
settings_props_unregister()
sm64_import_unregister()

if unregister_panels:
sm64_panel_unregister()
3 changes: 3 additions & 0 deletions fast64_internal/sm64/settings/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from ...utility import directory_path_checks, directory_ui_warnings, prop_split, set_prop_if_in_data, upgrade_old_prop
from ..sm64_constants import defaultExtendSegment4
from ..sm64_objects import SM64_CombinedObjectProperties
from ..sm64_level_importer import SM64_ImportProperties
from ..sm64_utility import export_rom_ui_warnings, import_rom_ui_warnings
from ..tools import SM64_AddrConvProperties

Expand Down Expand Up @@ -81,6 +82,8 @@ class SM64_Properties(PropertyGroup):
name="Matstack Fix",
description="Exports account for matstack fix requirements",
)
# importing, do I need to upgrade props for this?
importer: PointerProperty(type=SM64_ImportProperties)

@property
def binary_export(self):
Expand Down
264 changes: 264 additions & 0 deletions fast64_internal/sm64/sm64_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,40 @@
"wmotr": "LEVEL_WMOTR",
}

LEVEL_ID_NUMBERS = {
4: "bbh",
5: "ccm",
6: "castle_inside",
7: "hmc",
8: "ssl",
9: "bob",
10: "sl",
11: "wdw",
12: "jrb",
13: "thi",
14: "ttc",
15: "rr",
16: "castle_grounds",
17: "bitdw",
18: "vcutm",
19: "bitfs",
20: "sa",
21: "bits",
22: "lll",
23: "ddd",
24: "wf",
25: "ending",
26: "castle_courtyard",
27: "pss",
28: "cotmc",
29: "totwc",
30: "bowser_1",
31: "wmotr",
33: "bowser_2",
34: "bowser_3",
36: "ttm",
}

cameraTriggerNames = {
"bbh": "sCamBBH",
"bitdw": "sCamBitDW",
Expand Down Expand Up @@ -1764,6 +1798,12 @@ def __init__(self, geoAddr, level, switchDict):
("macro_yellow_coin", "Yellow Coin", "Yellow Coin"),
("macro_yellow_coin_2", "Yellow Coin 2", "Yellow Coin 2"),
]
enumVersionDefs = [
("VERSION_US", "VERSION_US", ""),
("VERSION_JP", "VERSION_JP", ""),
("VERSION_EU", "VERSION_EU", ""),
("VERSION_SH", "VERSION_SH", ""),
]

enumBehaviorMacros = [
("Custom", "Custom", ""),
Expand Down Expand Up @@ -2142,6 +2182,230 @@ def __init__(self, geoAddr, level, switchDict):
("Custom", "Custom", "Custom"),
]


# what is in specific groups and the segmented addresses
group_0_geos = [
("bubble_geo", "bubble_geo", "0x17000000"),
("purple_marble_geo", "purple_marble_geo", "0x1700001c"),
("smoke_geo", "smoke_geo", "0x17000038"),
("burn_smoke_geo", "burn_smoke_geo", "0x17000084"),
("small_water_splash_geo", "small_water_splash_geo", "0x1700009c"),
("idle_water_wave_geo", "idle_water_wave_geo", "0x17000124"),
("wave_trail_geo", "wave_trail_geo", "0x17000168"),
("sparkles_geo", "sparkles_geo", "0x170001bc"),
("water_splash_geo", "water_splash_geo", "0x17000230"),
("sparkles_animation_geo", "sparkles_animation_geo", "0x17000284"),
("mario_geo", "mario_geo", "0x17002dd4"),
]

group_1_geos = [
("yellow_sphere_geo", "yellow_sphere_geo", "0x0c000000"),
("hoot_geo", "hoot_geo", "0x0c000018"),
("yoshi_egg_geo", "yoshi_egg_geo", "0x0c0001e4"),
("thwomp_geo", "thwomp_geo", "0x0c000248"),
("bullet_bill_geo", "bullet_bill_geo", "0x0c000264"),
("heave_ho_geo", "heave_ho_geo", "0x0c00028c"),
]

group_2_geos = [
("bully_geo", "bully_geo", "0x0c000000"),
("bully_boss_geo", "bully_boss_geo", "0x0c000120"),
("blargg_geo", "blargg_geo", "0x0c000240"),
]

group_3_geos = [
("king_bobomb_geo", "king_bobomb_geo", "0x0c000000"),
("water_bomb_geo", "water_bomb_geo", "0x0c000308"),
("water_bomb_shadow_geo", "water_bomb_shadow_geo", "0x0c000328"),
]

group_4_geos = [
("clam_shell_geo", "clam_shell_geo", "0x0c000000"),
("sushi_geo", "sushi_geo", "0x0c000068"),
("unagi_geo", "unagi_geo", "0x0c00010c"),
]

group_5_geos = [
("klepto_geo", "klepto_geo", "0x0c000000"),
("eyerok_left_hand_geo", "eyerok_left_hand_geo", "0x0c0005a8"),
("eyerok_right_hand_geo", "eyerok_right_hand_geo", "0x0c0005e4"),
("pokey_head_geo", "pokey_head_geo", "0x0c000610"),
("pokey_body_part_geo", "pokey_body_part_geo", "0x0c000644"),
]

group_6_geos = [
("monty_mole_geo", "monty_mole_geo", "0x0c000000"),
("ukiki_geo", "ukiki_geo", "0x0c000110"),
("fwoosh_geo", "fwoosh_geo", "0x0c00036c"),
]

group_7_geos = [
("spindrift_geo", "spindrift_geo", "0x0c000000"),
("penguin_geo", "penguin_geo", "0x0c000104"),
("mr_blizzard_hidden_geo", "mr_blizzard_hidden_geo", "0x0c00021c"),
("mr_blizzard_geo", "mr_blizzard_geo", "0x0c000348"),
]

group_8_geos = [
("springboard_top_geo", "springboard_top_geo", "0x0c000000"),
("springboard_spring_geo", "springboard_spring_geo", "0x0c000018"),
("springboard_bottom_geo", "springboard_bottom_geo", "0x0c000030"),
("cap_switch_geo", "cap_switch_geo", "0x0c000048"),
]

group_9_geos = [
("bookend_part_geo", "bookend_part_geo", "0x0c000000"),
("bookend_geo", "bookend_geo", "0x0c0000c0"),
("haunted_chair_geo", "haunted_chair_geo", "0x0c0000d8"),
("small_key_geo", "small_key_geo", "0x0c000188"),
("mad_piano_geo", "mad_piano_geo", "0x0c0001b4"),
("boo_geo", "boo_geo", "0x0c000224"),
("haunted_cage_geo", "haunted_cage_geo", "0x0c000274"),
]

group_10_geos = [
("birds_geo", "birds_geo", "0x0c000000"),
("peach_geo", "peach_geo", "0x0c000410"),
("yoshi_geo", "yoshi_geo", "0x0c000468"),
]

group_11_geos = [
("bubba_geo", "bubba_geo", "0x0c000000"),
("wiggler_head_geo", "wiggler_head_geo", "0x0c000030"),
("enemy_lakitu_geo", "enemy_lakitu_geo", "0x0c0001bc"),
("spiny_ball_geo", "spiny_ball_geo", "0x0c000290"),
("spiny_geo", "spiny_geo", "0x0c000328"),
]

group_12_geos = [
("bowser_flames_geo", "bowser_flames_geo", "0x0d000000"),
("invisible_bowser_accessory_geo", "invisible_bowser_accessory_geo", "0x0d000090"),
("bowser_1_yellow_sphere_geo", "bowser_1_yellow_sphere_geo", "0x0d0000b0"),
("bowser_shadow_geo", "bowser_shadow_geo", "0x0d000ab8"),
("bowser_geo", "bowser_geo", "0x0d000ac4"),
("bowser2_geo", "bowser2_geo", "0x0d000b40"),
("bowser_bomb_geo", "bowser_bomb_geo", "0x0d000bbc"),
("bowser_impact_smoke_geo", "bowser_impact_smoke_geo", "0x0d000bfc"),
]

group_13_geos = [
("skeeter_geo", "skeeter_geo", "0x0d000000"),
("seaweed_geo", "seaweed_geo", "0x0d000284"),
("water_mine_geo", "water_mine_geo", "0x0d0002f4"),
("cyan_fish_geo", "cyan_fish_geo", "0x0d000324"),
("bub_geo", "bub_geo", "0x0d00038c"),
("water_ring_geo", "water_ring_geo", "0x0d000414"),
("treasure_chest_base_geo", "treasure_chest_base_geo", "0x0d000450"),
("treasure_chest_lid_geo", "treasure_chest_lid_geo", "0x0d000468"),
]

group_14_geos = [
("koopa_flag_geo", "koopa_flag_geo", "0x0d000000"),
("wooden_post_geo", "wooden_post_geo", "0x0d0000b8"),
("koopa_without_shell_geo", "koopa_without_shell_geo", "0x0d0000d0"),
("koopa_with_shell_geo", "koopa_with_shell_geo", "0x0d000214"),
("piranha_plant_geo", "piranha_plant_geo", "0x0d000358"),
("whomp_geo", "whomp_geo", "0x0d000480"),
("metallic_ball_geo", "metallic_ball_geo", "0x0d0005d0"),
("chain_chomp_geo", "chain_chomp_geo", "0x0d0005ec"),
]

group_15_geos = [
("lakitu_geo", "lakitu_geo", "0x0d000000"),
("toad_geo", "toad_geo", "0x0d0003e4"),
("mips_geo", "mips_geo", "0x0d000448"),
("boo_castle_geo", "boo_castle_geo", "0x0d0005b0"),
]

group_16_geos = [
("moneybag_geo", "moneybag_geo", "0x0d0000f0"),
("mr_i_geo", "mr_i_geo", "0x0d000000"),
("mr_i_iris_geo", "mr_i_iris_geo", "0x0d00001c"),
]

group_17_geos = [
("swoop_geo", "swoop_geo", "0x0d0000dc"),
("snufit_geo", "snufit_geo", "0x0d0001a0"),
("dorrie_geo", "dorrie_geo", "0x0d000230"),
("scuttlebug_geo", "scuttlebug_geo", "0x0d000394"),
]

common_0_geos = [
("blue_coin_switch_geo", "blue_coin_switch_geo", "0x0f000000"),
("test_platform_geo", "test_platform_geo", "0x0f000020"),
("dAmpGeo", "amp_geo", "0x0f000028"),
("cannon_base_geo", "cannon_base_geo", "0x0f0001a8"),
("cannon_barrel_geo", "cannon_barrel_geo", "0x0f0001c0"),
("chuckya_geo", "chuckya_geo", "0x0f0001d8"),
("purple_switch_geo", "purple_switch_geo", "0x0f0004cc"),
("checkerboard_platform_geo", "checkerboard_platform_geo", "0x0f0004e4"),
("heart_geo", "heart_geo", "0x0f0004fc"),
("flyguy_geo", "flyguy_geo", "0x0f000518"),
("breakable_box_geo", "breakable_box_geo", "0x0f0005d0"),
("breakable_box_small_geo", "breakable_box_small_geo", "0x0f000610"),
("bowling_ball_geo", "bowling_ball_geo", "0x0f000640"),
("bowling_ball_track_geo", "bowling_ball_track_geo", "0x0f00066c"),
("exclamation_box_geo", "exclamation_box_geo", "0x0f000694"),
("goomba_geo", "goomba_geo", "0x0f0006e4"),
("black_bobomb_geo", "black_bobomb_geo", "0x0f0007b8"),
("bobomb_buddy_geo", "bobomb_buddy_geo", "0x0f0008f4"),
("metal_box_geo", "metal_box_geo", "0x0f000a30"),
("exclamation_box_outline_geo", "exclamation_box_outline_geo", "0x0f000a58"),
("koopa_shell_geo", "koopa_shell_geo", "0x0f000ab0"),
("koopa_shell2_geo", "koopa_shell2_geo", "0x0f000adc"),
("koopa_shell3_geo", "koopa_shell3_geo", "0x0f000b08"),
]

common_1_geos = [
("mist_geo", "mist_geo", "0x16000000"),
("white_puff_geo", "white_puff_geo", "0x16000020"),
("explosion_geo", "explosion_geo", "0x16000040"),
("butterfly_geo", "butterfly_geo", "0x160000a8"),
("yellow_coin_geo", "yellow_coin_geo", "0x1600013c"),
("yellow_coin_no_shadow_geo", "yellow_coin_no_shadow_geo", "0x160001a0"),
("blue_coin_geo", "blue_coin_geo", "0x16000200"),
("blue_coin_no_shadow_geo", "blue_coin_no_shadow_geo", "0x16000264"),
("red_coin_geo", "red_coin_geo", "0x160002c4"),
("red_coin_no_shadow_geo", "red_coin_no_shadow_geo", "0x16000328"),
("warp_pipe_geo", "warp_pipe_geo", "0x16000388"),
("castle_door_geo", "castle_door_geo", "0x160003a8"),
("cabin_door_geo", "cabin_door_geo", "0x1600043c"),
("wooden_door_geo", "wooden_door_geo", "0x160004d0"),
("wooden_door2_geo", "wooden_door2_geo", "0x16000564"),
("metal_door_geo", "metal_door_geo", "0x160005f8"),
("hazy_maze_door_geo", "hazy_maze_door_geo", "0x1600068c"),
("haunted_door_geo", "haunted_door_geo", "0x16000720"),
("castle_door_0_star_geo", "castle_door_0_star_geo", "0x160007b4"),
("castle_door_1_star_geo", "castle_door_1_star_geo", "0x16000868"),
("castle_door_3_stars_geo", "castle_door_3_stars_geo", "0x1600091c"),
("key_door_geo", "key_door_geo", "0x160009d0"),
("bowser_key_geo", "bowser_key_geo", "0x16000a84"),
("bowser_key_cutscene_geo", "bowser_key_cutscene_geo", "0x16000ab0"),
("red_flame_shadow_geo", "red_flame_shadow_geo", "0x16000b10"),
("red_flame_geo", "red_flame_geo", "0x16000b2c"),
("blue_flame_geo", "blue_flame_geo", "0x16000b8c"),
("fish_shadow_geo", "fish_shadow_geo", "0x16000bec"),
("fish_geo", "fish_geo", "0x16000c44"),
("leaves_geo", "leaves_geo", "0x16000c8c"),
("marios_cap_geo", "marios_cap_geo", "0x16000ca4"),
("marios_metal_cap_geo", "marios_metal_cap_geo", "0x16000cf0"),
("marios_wing_cap_geo", "marios_wing_cap_geo", "0x16000d3c"),
("marios_winged_metal_cap_geo", "marios_winged_metal_cap_geo", "0x16000da8"),
("number_geo", "number_geo", "0x16000e14"),
("mushroom_1up_geo", "mushroom_1up_geo", "0x16000e84"),
("star_geo", "star_geo", "0x16000ea0"),
("dirt_animation_geo", "dirt_animation_geo", "0x16000ed4"),
("cartoon_star_geo", "cartoon_star_geo", "0x16000f24"),
("transparent_star_geo", "transparent_star_geo", "0x16000f6c"),
("white_particle_geo", "white_particle_geo", "0x16000f98"),
("wooden_signpost_geo", "wooden_signpost_geo", "0x16000fb4"),
("bubbly_tree_geo", "bubbly_tree_geo", "0x16000fe8"),
("spiky_tree_geo", "spiky_tree_geo", "0x16001000"),
("snow_tree_geo", "snow_tree_geo", "0x16001018"),
("spiky_tree1_geo", "spiky_tree1_geo", "0x16001030"),
("palm_tree_geo", "palm_tree_geo", "0x16001048"),
]

T = TypeVar("T")
DictOrVal = T | dict[T] | None
ListOrVal = T | list[T] | None
Expand Down
1 change: 1 addition & 0 deletions fast64_internal/sm64/sm64_geolayout_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self, deform, theme):
"StartRenderArea": BoneNodeProperties(True, "THEME13"), # 0x20
"Ignore": BoneNodeProperties(False, "THEME08"), # Used for rigging
"SwitchOption": BoneNodeProperties(False, "THEME11"),
"CustomNonAnimated": BoneNodeProperties(False, "THEME11"),
}

boneLayers = {"anim": 0, "other": 1, "meta": 2, "visual": 3}
Expand Down
Loading