Skip to content

Commit

Permalink
Objects can now have their own data
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilaa3 committed Apr 24, 2024
1 parent b722315 commit b3d0735
Show file tree
Hide file tree
Showing 8 changed files with 361 additions and 321 deletions.
24 changes: 12 additions & 12 deletions fast64_internal/sm64/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
)

from .animation import (
sm64_anim_panel_register,
sm64_anim_panel_unregister,
sm64_anim_properties_register,
sm64_anim_properties_unregister,
sm64_anim_operator_register,
sm64_anim_operator_unregister,
anim_panel_register,
anim_panel_unregister,
anim_props_register,
anim_props_unregister,
anim_operator_register,
anim_operator_unregister,
)

from .tools import tools_panels_register, tools_panels_unregister, tools_operators_register, tools_operators_unregister
Expand All @@ -102,7 +102,7 @@ def sm64_panel_register():
sm64_spline_panel_register()
sm64_dl_writer_panel_register()
sm64_dl_parser_panel_register()
sm64_anim_panel_register()
anim_panel_register()


def sm64_panel_unregister():
Expand All @@ -118,11 +118,13 @@ def sm64_panel_unregister():
sm64_spline_panel_unregister()
sm64_dl_writer_panel_unregister()
sm64_dl_parser_panel_unregister()
sm64_anim_panel_unregister()
anim_panel_unregister()


def sm64_register(register_panels: bool):
tools_operators_register()
anim_props_register()
anim_operator_register()
sm64_col_register()
sm64_bone_register()
sm64_cam_register()
Expand All @@ -133,8 +135,6 @@ def sm64_register(register_panels: bool):
sm64_spline_register()
sm64_dl_writer_register()
sm64_dl_parser_register()
sm64_anim_properties_register()
sm64_anim_operator_register()
settings_props_register()

if register_panels:
Expand All @@ -143,6 +143,8 @@ def sm64_register(register_panels: bool):

def sm64_unregister(unregister_panels: bool):
tools_operators_unregister()
anim_props_unregister()
anim_operator_unregister()
sm64_col_unregister()
sm64_bone_unregister()
sm64_cam_unregister()
Expand All @@ -153,8 +155,6 @@ def sm64_unregister(unregister_panels: bool):
sm64_spline_unregister()
sm64_dl_writer_unregister()
sm64_dl_parser_unregister()
sm64_anim_properties_unregister()
sm64_anim_operator_unregister()
settings_props_unregister()

if unregister_panels:
Expand Down
12 changes: 6 additions & 6 deletions fast64_internal/sm64/animation/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from .operators import (
sm64_anim_operator_register,
sm64_anim_operator_unregister,
anim_operator_register,
anim_operator_unregister,
)
from .properties import (
sm64_anim_properties_register,
sm64_anim_properties_unregister,
anim_props_register,
anim_props_unregister,
)
from .panels import (
sm64_anim_panel_register,
sm64_anim_panel_unregister,
anim_panel_register,
anim_panel_unregister,
)
10 changes: 6 additions & 4 deletions fast64_internal/sm64/animation/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,14 @@ def to_props(self, action, actor_name: str, remove_name_footer: bool = True, use
main_header = self.headers[0]

if not self.action_name:
if isinstance(main_header.reference, str):
self.action_name = main_header.reference
if remove_name_footer:
self.action_name = self.action_name.lstrip("anim_")
if main_header.file_name:
self.action_name = main_header.file_name.rstrip(".c").rstrip(".inc")
elif isinstance(main_header.reference, int):
self.action_name = hex(main_header.reference)
if remove_name_footer:
index = self.action_name.find("anim_")
if index != -1:
self.action_name = self.action_name[index + 5 :]
action.name = self.action_name

action_props.indices_table, action_props.indices_address = (
Expand Down
Loading

0 comments on commit b3d0735

Please sign in to comment.