Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
ddf298b
fast64_internal/oot -> fast64_internal/z64
Yanis002 Dec 19, 2024
343da1b
remove oot prefix from files
Yanis002 Dec 19, 2024
a5511ab
add MM xml data module
Yanis002 Dec 19, 2024
debb5dc
panel renames and add game
Yanis002 Dec 19, 2024
d634ff9
more ui changes and add MM to game editor mode checks
Yanis002 Dec 19, 2024
bef6df9
implement importing scenes without custom path
Yanis002 Dec 19, 2024
8ae4982
format
Yanis002 Dec 19, 2024
66b6c87
implement scene's "general" tab ui
Yanis002 Dec 20, 2024
d2458a5
scene alt headers
Yanis002 Dec 20, 2024
3efd146
format
Yanis002 Dec 20, 2024
2d6a893
room props basics
Yanis002 Dec 20, 2024
3bd1fc0
format
Yanis002 Dec 20, 2024
da63e2e
implement room ui
Yanis002 Dec 20, 2024
33bb03d
implement actors
Yanis002 Dec 20, 2024
15e123d
fixed paths
Yanis002 Dec 20, 2024
d69d1a6
disable cutscene ui
Yanis002 Dec 20, 2024
50c3fb2
implement export to c
Yanis002 Dec 20, 2024
21fbb73
small fix
Yanis002 Dec 20, 2024
3392e47
door adjustements
Yanis002 Dec 21, 2024
28ccd1e
merge OoT and MM for scene properties (1/2)
Yanis002 Dec 21, 2024
56c13e9
merge OoT and MM for scene properties (2/2)
Yanis002 Dec 22, 2024
4051c36
merge OoT and MM for room properties (1/2)
Yanis002 Dec 22, 2024
3ca26b0
merge OoT and MM for room properties (2/2)
Yanis002 Dec 22, 2024
f1758e5
format
Yanis002 Dec 22, 2024
f640829
merge OoT and MM for actor properties (1/2)
Yanis002 Dec 22, 2024
848496b
merge OoT and MM for actor properties (2/2)
Yanis002 Dec 22, 2024
8acb13e
added macros header for mm, fixed missing prop_name getter, hide warp…
Yanis002 Dec 22, 2024
d1ebe9d
format
Yanis002 Dec 22, 2024
27edbea
missed `ootGetSceneOrRoomHeader`
Yanis002 Dec 22, 2024
9ed6a95
update collision enums
Yanis002 Dec 27, 2024
869681e
mm camera setting type enum
Yanis002 Dec 28, 2024
70f013a
fix "custom" issues
Yanis002 Dec 28, 2024
b17a8b3
implement MapDataChest import
Yanis002 Dec 28, 2024
badf507
document en_door
Yanis002 Dec 28, 2024
c5291fb
animated materials support (import and export)
Yanis002 Dec 29, 2024
b5f26a6
fixed actor issues and started actor cutscene support
Yanis002 Dec 31, 2024
f92a47b
update readme and introduce "mm features" checkbox for oot
Yanis002 Dec 31, 2024
c2cec06
add button to add a default actor cs
Yanis002 Dec 31, 2024
f04388a
actors: halfday bits and embedded actor cs
Yanis002 Jan 1, 2025
8661b4d
Merge remote-tracking branch 'upstream/main' into mm_dev
Yanis002 Jan 1, 2025
16ea747
post-merge fixes
Yanis002 Jan 1, 2025
7c72bb6
forgot something to fix
Yanis002 Jan 1, 2025
2981aeb
update cutscene parser to handle MM commands
Yanis002 Jan 5, 2025
e4fbb1c
add note about size
Yanis002 Jan 5, 2025
0e2b27e
checkpoint
Yanis002 Jan 5, 2025
a210c0c
checkpoint 2
Yanis002 Jan 5, 2025
9bcc368
checkpoint 3
Yanis002 Jan 5, 2025
883d14e
checkpoint 4
Yanis002 Jan 5, 2025
179596f
checkpoint 5
Yanis002 Jan 5, 2025
bd4bc84
move data outside oot submodule
Yanis002 Jan 5, 2025
8dae77a
use game in detailed actor props
Yanis002 Jan 5, 2025
ac9ded6
format
Yanis002 Jan 5, 2025
f3315c1
move success print
Yanis002 Jan 5, 2025
96541a6
move data outside z64
Yanis002 Jan 5, 2025
ca4d48e
Merge branch 'gamedata' into mm_dev
Yanis002 Jan 5, 2025
95b4504
fix merge oopsie
Yanis002 Jan 5, 2025
7f031fd
create z64 data folder
Yanis002 Jan 5, 2025
8c26743
merge oot and mm for xml data
Yanis002 Jan 5, 2025
e49b042
format
Yanis002 Jan 5, 2025
468d707
remove get_game_enum
Yanis002 Jan 5, 2025
fe94c9d
remove oot_data
Yanis002 Jan 5, 2025
e38bddb
remove mm_data
Yanis002 Jan 5, 2025
eda100d
fixed data not updating properly
Yanis002 Jan 5, 2025
84fac67
format
Yanis002 Jan 5, 2025
3e645e4
fix enum issues
Yanis002 Jan 7, 2025
6348e9e
format
Yanis002 Jan 7, 2025
86b25ff
get rid of GD.
Yanis002 Jan 7, 2025
53f7f17
cleanup
Yanis002 Jan 7, 2025
3038066
more fixes
Yanis002 Jan 8, 2025
66591b2
update the updater (temp)
Yanis002 Jan 8, 2025
c2f29b2
actor cutscene fixes and fix export issues
Yanis002 Jan 8, 2025
076f49f
more actor cs export fixes
Yanis002 Jan 8, 2025
5809867
remove get_game_prop_name
Yanis002 Jan 8, 2025
bd80b33
format
Yanis002 Jan 8, 2025
98ef097
remove get_cs_index_start
Yanis002 Jan 8, 2025
7d5e256
remove is_game_oot
Yanis002 Jan 8, 2025
b8277c7
implement pathway export and some fixes
Yanis002 Jan 8, 2025
9ac2043
data cleanup
Yanis002 Jan 8, 2025
d3515f1
format
Yanis002 Jan 8, 2025
b0fb457
rename getters
Yanis002 Jan 8, 2025
1cee542
fix registration oddities
Yanis002 Jan 8, 2025
d166c14
progress on cutscenes
Yanis002 Jan 8, 2025
696d46b
format
Yanis002 Jan 8, 2025
7ab487f
more progress on cutscenes + exporter fixes
Yanis002 Jan 9, 2025
da462fe
implement ui for mm cs cmds
Yanis002 Jan 9, 2025
d878905
Merge remote-tracking branch 'upstream/main' into mm_dev
Yanis002 Jan 9, 2025
bc42a13
implement cs camera export
Yanis002 Jan 10, 2025
e651c0c
progress™
Yanis002 Jan 11, 2025
d2a17f7
more cutscene export progress
Yanis002 Jan 12, 2025
8e2f7bc
missing commands
Yanis002 Jan 12, 2025
f4e52aa
fixed "give tatl" showing on oot and fixed ui order
Yanis002 Jan 12, 2025
2e48347
fixed issue where first obj entry is replaced + wrong lightsetting ar…
Yanis002 Jan 12, 2025
51f0bb7
fixed wrong values in the actor cs operator
Yanis002 Jan 12, 2025
eb6f5bc
workaround for actors for mm
Yanis002 Jan 12, 2025
cbe91a7
motion blur and transition general preview
Yanis002 Jan 12, 2025
f449cac
importer start (and update to the new classes)
Yanis002 Jan 13, 2025
7aac90b
cutscene work? idk idr it's been too long lol
Yanis002 Mar 12, 2025
2699465
fixed export issues (cs related and actor params)
Yanis002 Mar 13, 2025
2382311
specifically check for oot and not oot features
Yanis002 Mar 13, 2025
c115c1c
fix entrance actors
Yanis002 Mar 13, 2025
b9e059c
I think this should fix rotations for mm
Yanis002 Mar 14, 2025
29f35db
ok actually fix the thing
Yanis002 Mar 14, 2025
82989c0
Merge remote-tracking branch 'upstream/main' into mm_dev
Yanis002 May 5, 2025
b9630fd
Merge remote-tracking branch 'upstream/main' into mm_dev
Yanis002 May 27, 2025
d0b7fdd
fixed init issues
Yanis002 May 27, 2025
64b1f60
fixed other issues
Yanis002 May 27, 2025
4b1cc9c
random things
Yanis002 May 28, 2025
f36b679
fix actor cs index not exporting properly
Yanis002 May 28, 2025
9aadef6
format
Yanis002 May 28, 2025
a57b211
don't show array index for actor cutscenes from actors empties
Yanis002 May 28, 2025
89f2810
document chests and timer actors (cutscenes)
Yanis002 May 28, 2025
a29de82
safety check for oob indices
Yanis002 May 28, 2025
26b8c13
address some of the weirdness in actor cs index
Yanis002 May 28, 2025
1a18041
fixed bug where embedded entries would export with global check enabled
Yanis002 May 28, 2025
b485c33
revert updater change
Yanis002 May 28, 2025
4b86805
fix link imports part 1
Yanis002 May 28, 2025
cb54fa2
fix the human link flipbook
Yanis002 May 28, 2025
82a855c
fixed goron and zora eyes (relies on MM PR 1777)
Yanis002 May 28, 2025
7ba7569
Merge remote-tracking branch 'upstream/main' into mm_dev
Yanis002 May 28, 2025
5324ff8
fix oopsie
Yanis002 May 28, 2025
7e45a26
fixed custom entry missing from actor list and added actorcat_door fo…
Yanis002 May 29, 2025
84f4f7e
actor cutscene improvements
Yanis002 May 29, 2025
24a8527
show array index for embedded actor cutscenes
Yanis002 May 29, 2025
a18278d
change time speed value
Yanis002 May 29, 2025
cb3cb1b
default time speed label
Yanis002 May 29, 2025
6b4266f
actor cs import and operator improvments
Yanis002 May 29, 2025
a1eda04
format
Yanis002 Aug 8, 2025
6f490cb
fix some cs import issues
Yanis002 Aug 8, 2025
592b6cc
missed some oot checks for fog preview
Yanis002 Aug 8, 2025
678c227
missed some oot checks for fog preview 2
Yanis002 Aug 8, 2025
9d2638b
show shot end frame hint for MM
Yanis002 Sep 9, 2025
e6eff43
fixed import issues
Yanis002 Nov 2, 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ __pycache__/
fast64_updater/
.python-version
.idea

# temp? just exporting my stuff in my fast64 clone because reasons
export/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ We have a Discord server for support as well as development [here](https://disco

### Links to Docs / Guides for Each Game
1. [ Super Mario 64 ](/fast64_internal/sm64/README.md)
2. [ Ocarina Of Time ](/fast64_internal/oot/README.md)
2. [ Ocarina Of Time and Majora's Mask ](/fast64_internal/z64/README.md)

### Installation
Download the repository as a zip file. In Blender, go to Edit -> Preferences -> Add-Ons and click the "Install" button to install the plugin from the zip file. Find the Fast64 addon in the addon list and enable it. If it does not show up, go to Edit -> Preferences -> Save&Load and make sure 'Auto Run Python Scripts' is enabled.
Expand Down
65 changes: 36 additions & 29 deletions __init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import bpy
from .fast64_internal.game_data import game_data

from bpy.utils import register_class, unregister_class
from bpy.path import abspath

Expand All @@ -19,10 +21,10 @@
from .fast64_internal.sm64.sm64_geolayout_bone import SM64_BoneProperties
from .fast64_internal.sm64.sm64_objects import SM64_ObjectProperties

from .fast64_internal.oot import OOT_Properties, oot_register, oot_unregister
from .fast64_internal.oot.oot_constants import oot_world_defaults
from .fast64_internal.oot.props_panel_main import OOT_ObjectProperties
from .fast64_internal.oot.actor.properties import initOOTActorProperties
from .fast64_internal.z64 import OOT_Properties, oot_register, oot_unregister, z64_register_on_enable
from .fast64_internal.z64.constants import oot_world_defaults
from .fast64_internal.z64.props_panel_main import OOT_ObjectProperties
from .fast64_internal.z64.utility import getObjectList
from .fast64_internal.utility_anim import utility_anim_register, utility_anim_unregister, ArmatureApplyWithMeshOperator

from .fast64_internal.mk64 import MK64_Properties, mk64_register, mk64_unregister
Expand Down Expand Up @@ -59,7 +61,7 @@
# info about add on
bl_info = {
"name": "Fast64",
"version": (2, 3, 0),
"version": (2, 3, 1),
"author": "kurethedead",
"location": "3DView",
"description": "Plugin for exporting F3D display lists and other game data related to Nintendo 64 games.",
Expand All @@ -70,6 +72,7 @@
gameEditorEnum = (
("SM64", "SM64", "Super Mario 64", 0),
("OOT", "OOT", "Ocarina Of Time", 1),
("MM", "MM", "Majora's Mask", 4),
("MK64", "MK64", "Mario Kart 64", 3),
("Homebrew", "Homebrew", "Homebrew", 2),
)
Expand Down Expand Up @@ -241,6 +244,9 @@ class Fast64_Properties(bpy.types.PropertyGroup):
settings: bpy.props.PointerProperty(type=Fast64Settings_Properties, name="Fast64 Settings")
renderSettings: bpy.props.PointerProperty(type=Fast64RenderSettings_Properties, name="Fast64 Render Settings")

def get_addon_version(self):
return bl_info["version"]


class Fast64_BoneProperties(bpy.types.PropertyGroup):
"""
Expand Down Expand Up @@ -299,24 +305,6 @@ def execute(self, context: "bpy.types.Context"):
return {"FINISHED"}


# def updateGameEditor(scene, context):
# if scene.currentGameEditorMode == 'SM64':
# sm64_panel_unregister()
# elif scene.currentGameEditorMode == 'Z64':
# oot_panel_unregister()
# else:
# raise PluginError("Unhandled game editor mode " + str(scene.currentGameEditorMode))
#
# if scene.gameEditorMode == 'SM64':
# sm64_panel_register()
# elif scene.gameEditorMode == 'Z64':
# oot_panel_register()
# else:
# raise PluginError("Unhandled game editor mode " + str(scene.gameEditorMode))
#
# scene.currentGameEditorMode = scene.gameEditorMode


class ExampleAddonPreferences(bpy.types.AddonPreferences, addon_updater_ops.AddonUpdaterPreferences):
bl_idname = __package__

Expand Down Expand Up @@ -371,6 +359,8 @@ def upgrade_scene_props_node():

@bpy.app.handlers.persistent
def after_load(_a, _b):
game_data.update(bpy.context.scene.gameEditorMode)

settings = bpy.context.scene.fast64.settings
if any(mat.is_f3d for mat in bpy.data.materials):
check_or_ask_color_management(bpy.context)
Expand All @@ -396,7 +386,7 @@ def set_game_defaults(scene: bpy.types.Scene, set_ucode=True):
elif scene.gameEditorMode == "MK64":
f3d_type = "F3DEX"
world_defaults = mk64_world_defaults
elif scene.gameEditorMode == "OOT":
elif scene.gameEditorMode in {"OOT", "MM"}:
f3d_type = "F3DEX2/LX2"
world_defaults = oot_world_defaults
elif scene.gameEditorMode == "MK64":
Expand All @@ -406,13 +396,25 @@ def set_game_defaults(scene: bpy.types.Scene, set_ucode=True):
world_defaults = {} # This will set some pretty bad defaults, but trust the user
if set_ucode:
scene.f3d_type = f3d_type
if scene.world is not None:
if scene.world is not None and world_defaults is not None:
scene.world.rdp_defaults.from_dict(world_defaults)


def gameEditorUpdate(scene: bpy.types.Scene, _context):
game_data.update(scene.gameEditorMode)
set_game_defaults(scene)

# reset `currentCutsceneIndex` when switching games
if scene.gameEditorMode in {"OOT", "MM"}:
for scene_obj in bpy.data.objects:
scene_obj.ootAlternateSceneHeaders.currentCutsceneIndex = game_data.z64.cs_index_start

if scene_obj.type == "EMPTY" and scene_obj.ootEmptyType == "Scene":
room_obj_list = getObjectList(scene_obj.children_recursive, "EMPTY", "Room")

for room_obj in room_obj_list:
room_obj.ootAlternateRoomHeaders.currentCutsceneIndex = game_data.z64.cs_index_start


# called on add-on enabling
# register operators and panels here
Expand All @@ -435,17 +437,19 @@ def register():
register_class(ExampleAddonPreferences)
addon_updater_ops.register(bl_info)

initOOTActorProperties()
utility_anim_register()
mat_register()
render_engine_register()
bsdf_conv_register()
sm64_register(True)
oot_register(True)
oot_register(True, True)
mk64_register(True)

repo_settings_operators_register()

for cls in z64_register_on_enable:
register_class(cls)

for cls in classes:
register_class(cls)

Expand Down Expand Up @@ -488,7 +492,7 @@ def unregister():
f3d_writer_unregister()
f3d_parser_unregister()
sm64_unregister(True)
oot_unregister(True)
oot_unregister(True, True)
mk64_unregister(True)
mat_unregister()
bsdf_conv_unregister()
Expand All @@ -508,7 +512,10 @@ def unregister():

repo_settings_operators_unregister()

for cls in classes:
for cls in reversed(classes):
unregister_class(cls)

for cls in reversed(z64_register_on_enable):
unregister_class(cls)

bpy.app.handlers.load_post.remove(after_load)
Expand Down
5 changes: 0 additions & 5 deletions fast64_internal/__init__.py

This file was deleted.

2 changes: 2 additions & 0 deletions fast64_internal/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .z64.data import Z64_Data
from .z64.object_data import Z64_ObjectData
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from os import path
from dataclasses import dataclass
from .oot_getters import getXMLRoot
from .oot_data import OoT_BaseElement
from pathlib import Path
from .common import Z64_BaseElement, get_xml_root


@dataclass
class OoT_ParameterElement:
class Z64_ParameterElement:
type: str # bool, enum, type, property, etc...
index: int
mask: int
Expand All @@ -18,50 +18,50 @@ class OoT_ParameterElement:


@dataclass
class OoT_ListElement:
class Z64_ListElement:
key: str
name: str
value: int


@dataclass
class OoT_ActorElement(OoT_BaseElement):
class Z64_ActorElement(Z64_BaseElement):
category: str
tiedObjects: list[str]
params: list[OoT_ParameterElement]
params: list[Z64_ParameterElement]


class OoT_ActorData:
class Z64_ActorData:
"""Everything related to OoT Actors"""

def __init__(self):
def __init__(self, game: str):
# Path to the ``ActorList.xml`` file
actorXML = path.dirname(path.abspath(__file__)) + "/xml/ActorList.xml"
actorRoot = getXMLRoot(actorXML)
xml_path = Path(f"{path.dirname(path.abspath(__file__))}/xml/{game.lower()}_actor_list.xml")
actor_root = get_xml_root(xml_path.resolve())

# general actor list
self.actorList: list[OoT_ActorElement] = []
self.actorList: list[Z64_ActorElement] = []

# list elements
self.chestItems: list[OoT_ListElement] = []
self.collectibleItems: list[OoT_ListElement] = []
self.messageItems: list[OoT_ListElement] = []
self.chestItems: list[Z64_ListElement] = []
self.collectibleItems: list[Z64_ListElement] = []
self.messageItems: list[Z64_ListElement] = []

listNameToList = {
"Chest Content": self.chestItems,
"Collectibles": self.collectibleItems,
"Elf_Msg Message ID": self.messageItems,
}

for elem in actorRoot.iterfind("List"):
for elem in actor_root.iterfind("List"):
listName = elem.get("Name")
if listName is not None:
for item in elem:
listNameToList[listName].append(
OoT_ListElement(item.get("Key"), item.get("Name"), int(item.get("Value"), base=16))
Z64_ListElement(item.get("Key"), item.get("Name"), int(item.get("Value"), base=16))
)

for actor in actorRoot.iterfind("Actor"):
for actor in actor_root.iterfind("Actor"):
tiedObjects = []
objKey = actor.get("ObjectKey")
actorName = f"{actor.attrib['Name']} - {actor.attrib['ID'].removeprefix('ACTOR_')}"
Expand All @@ -70,7 +70,7 @@ def __init__(self):
tiedObjects = objKey.split(",")

# parameters
params: list[OoT_ParameterElement] = []
params: list[Z64_ParameterElement] = []
for elem in actor:
elemType = elem.tag
if elemType != "Notes":
Expand All @@ -91,7 +91,7 @@ def __init__(self):
defaultName = f"{elem.get('Type')} {elemType}"
valueRange = elem.get("ValueRange")
params.append(
OoT_ParameterElement(
Z64_ParameterElement(
elemType,
int(elem.get("Index", "1")),
int(elem.get("Mask", "0xFFFF"), base=16),
Expand All @@ -105,7 +105,7 @@ def __init__(self):
)

self.actorList.append(
OoT_ActorElement(
Z64_ActorElement(
actor.attrib["ID"],
actor.attrib["Key"],
actorName,
Expand All @@ -129,7 +129,7 @@ def __init__(self):

# list of tuples used by Blender's enum properties

lastIndex = max(1, *(actor.index for actor in self.actorList))
lastIndex = max(1, *(actor.index for actor in self.actorList)) + 1
self.ootEnumActorID = [("None", f"{i} (Deleted from the XML)", "None") for i in range(lastIndex)]
self.ootEnumActorID.insert(0, ("Custom", "Custom Actor", "Custom"))

Expand All @@ -142,7 +142,7 @@ def __init__(self):

i = 1
for actor in self.actorList:
self.ootEnumActorID[actor.index] = (actor.id, actor.name, actor.id)
self.ootEnumActorID[actor.index + 1] = (actor.id, actor.name, actor.id)
if actor.category == "ACTORCAT_DOOR":
self.ootEnumTransitionActorID[i] = (actor.id, actor.name, actor.id)
i += 1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
from xml.etree.ElementTree import parse as parseXML, Element
from dataclasses import dataclass


def getXMLRoot(xmlPath: str) -> Element:
@dataclass
class Z64_BaseElement:
id: str
key: str
name: str
index: int


def get_xml_root(xmlPath: str) -> Element:
"""Parse an XML file and return its root element"""
try:
return parseXML(xmlPath).getroot()
Expand Down
Loading