1049 Commits
Author SHA1 Message Date
Lila f7f7a057cf [Codebase] Fix setOrigin AGAIN (#588)
* [Codebase] Fix setOrigin AGAIN

transform_apply was not neeeded, typehint was missing and offset was being affected by obj.location, we actually just zero it out now before applying the world matrix.
also removed the temp_override cause transform already does that.

* Update utility.py

* Update utility.py

* add doc string, use the original matrix as a base and apply the inverted original to the mesh (im stupid)

add doc string instead of a comment mentioning the behavior

* black

* another tryy
2025-10-16 13:44:20 +01:00
Lila b6457888d2 [Codebase] Restore original functionality to setOrigin (#575)
* [Codebase] Restore original functionality to setOrigin

the remade version of set origin was not equivalent to the previous one, breaking SM64.
we were applying -target_loc instead of the offset between target loc and the original location

* uhh comment was still :true:, sorry
2025-09-03 20:43:36 +01:00
Graham Harper c76f317c94 Fix README link for Ocarina of Time to point to z64 folder (#577) 2025-08-29 02:08:14 +02:00
Lila 17a6155f5c [SM64] Custom level script and special commands and improvements to custom geo commands (#457)
* implement prop

* first iter of custom cmd exporting

* let rovert fly

* Update sm64_objects.py

* Update sm64_objects.py

* Update sm64_objects.py

* upgrade existing custom geo into new custom type

* Hack for geo because

* [SM64] Add depth arg and remove comma from existing cmds

* [SM64] add depth arg to level and collision objects

* change unused depth to _depth and add my stashed changes.. oops

* some code clean up and ui improvement

* Allow custom geo to have children

* command preset system (WIP)

allows you to create presets for your repo.
missing auto updates to presets

* detect changes via a hash

* fix last remaining bugs

* fix preset edit preview

* add draw layers

* basic example macro

* boolean support and fixes

* world's most over enginered way to handle numbers

* bugs and visual fixes

* make color serializable

* dont use PRESET_EDIT if presumably there is no edit data

* use degrees

* inital support for bones

* dont require transform to be inherented, fixes bone using scale arg

* remove sys, last few bits of code tomorrow

* move custom args into a folder

* lock

* typing fixes

* use dict for exports

* early binary support

* Missing dl ext and animated

* dl ext impl

* make is animatable work

* update updateBone to suit my new needs

* finish upgrade code

* dl ext now dl cmd, example macros for dl cmds

* SM64_CustomArgProperties

* enum property support to really hammer in the scope creep

* Nice move by SpongeBob! This match is just about over.

checked for mesh, removed one indent, changed Special to Collision

* some fixes to the ops

* make binary more flexiable by introducing eval expressions

Now behavior that would require a macro can be written in an eval statement, this is peak over engineering. It's also present in c under a toggle because SCALE GEO CMD COMPATABILITY!!!

* make hard defined int types for binary

* one last fix

* allow color quant for background node compat, fix enum ops

* impl last translate/rotate name in custom

* undo export color

* fix area root UI

* fix commas

* add order, fix up a couple of nits

* lila did a stupid

* fix transforms

* conventional rotation in macros is not scaled to s16

* let eval run on tuples

* implement generators

* add cast_integer

* Update properties.py

* round to conventional for scale

* document collection operator base more, fix bug with scale rounding

also add copy_on_add

* undo repo settings ver change since there has been no breaking changes

* remove unused

* implement top level level script commands

* make clean color into tuple, run eval on lists

* update base displaylist node

* little thing i noticed missing

* unnecessary names removed

* Fix transforms in level

* fix parameter

* show animatable toggle in presets

* More control of the level script section

* copy enum example

* over engineered description code

* update preset instead of changing to NONE

* fix number updates

* typo

* fix crash

* VERY IMPORTANT FIX

* link to docs

* add comment about updating existing animation pr ops

* fix animation command checks
2025-08-21 22:00:20 +01:00
Lila 8853a484fd [SM64] Animations Rewrite/Rework (#467)
* [SM64] Animations Rewrite/Rework

* [SM64] Animations Rewrite/Rework

* Remove animation docs from README until I write new ones in fast64_docs

* remove accidental exports

* merge conflicts?

* Fix level export includes dups

* Fixed comment adjust function

* change table properties to only have elements

* Update properties.py

* Rename

* bounds check

* keep default action name consistent with blender

* as_posix fix and clean up

* designated is include in repo settings, include in tooltip

* Fix empty text files

* fix peach's address

* Some attempts at tasteful comments

Verbose documentation like docstrings is.. not my strong suite

* allow str, use path in f3d writer

* better valid filename func

* fix things!

* review and a personal nit

* Add docs link
2025-08-21 21:39:33 +01:00
Lila 5877a949ab [F3D] Fix node creation in 4.5 (#566)
* [F3D] Fix node creation in 4.5

* port over changes from libdragon pr
2025-08-15 22:38:22 -04:00
Lila c3f7ea4067 [F3D + SM64] Dedup mesh names, fixes repeated final revert DLs (#565)
[F3D + SM64] Dedup mesh names, fixes repeated final revert dls
2025-08-15 22:36:36 -04:00
Lila f138921e49 [SM64] Implement someone level template styled bounds (#513)
* [SM64] Implement someone level template styled bounding boxes

* parent to level instead

I forgot fast64 keeps the offset from the level instead of from the area
2025-08-15 14:19:38 -04:00
Lila 3a7fcc232e [SM64] Add lighting engine presets (#531)
* [SM64] Add lighting engine presets

* remove preset dir function
2025-08-15 14:18:41 -04:00
Lila aff23e0ef5 [SM64] Bring more props to combined and merge level enums (#512)
There is only one level enum (which I took the time to organize), binary will simply error out with Custom (tho it is not fully out of the possibility to support custom levels in binary in the future), upgrade code added.
Dl and animation now share props with combined, animation rework actually uses these but for now both just redraw the prop to keep the ui the same.
Imports and address converter left untouched besides enum change, these should not be per scene.
Convert to str in getPathAndLevel to avoid issues with posix paths -> abspath

Alternatively, should this be just a pr for level enums?
Closes #498
2025-08-15 14:17:25 -04:00
AnoliahandLila 6dd14a0d8b [SM64] Rework actor load exports for level scripts (#564)
* seg 8 loading for yay0 and geo segments

* update replaceScriptLoads to add new script loads if missing

* change grid layout

* add global write/don't write toggle for actor loads and 'None' option for individual segment loads

* reappend any JUMP_LINK commands that do not contain 'script_func_global'

* formatting lol

* some code quality changes

* move write actor loads to the correct place, clean up the UI a little

(grid wasn´t even being used properly aha)

* replace yay0 or mio0 equivelent commands to current compression method

---------

Co-authored-by: Lila <[email protected]>
2025-08-15 14:12:09 -04:00
Lila a53681e8da [SM64] Smarter and standardized includes (#449)
* [SM64] Smarter includes

Added new functions, write_includes and update_actor_includes.

write_includes is a smarter version of writeIfNotFound specifically for includes and externs, it removes comments prior to searching (but doesn't remove comments from the actual file of course) and allows whitespace (where possible, a path including whitespace won´t be found when searching for a file with no whitespace), futhermore it adds a trailing newline to the file instead of adding a leading newline for each include, the logic that finds the `#endif` of .h files is also improved like the logic to find includes and externs (whitespace is tolerated, comments are ignored) but it also allows no endif for files that use the GCC `#pragma once` macro

update_actor_includes standardizes group and level includes into one place for ease of editing, one of the major differences is that level exports no longer use the full path (levels/actor/my_file.c would instead be /actor/my_file.c) this should allow level header type actors to actually update headers on custom non decomp levels but that is not done here

* find_includes_and_externs

* as_posix

* New versatile write_or_delete_if_found function

* Ok I lied, seperate out comment map func, use string IO

* more type hints!

* seperate comment start end adjust into function

* Fix level export includes dups

* Fixed comment adjust function

* as_posix fix and clean up

* Fix empty text files

* Some attempts at tasteful comments

Verbose documentation like docstrings is.. not my strong suite

* allow str, use path in f3d writer

* header footer doc string

* Update sm64_utility.py
2025-08-15 14:03:18 -04:00
Lila 8687eda4d7 [SM64] Fix mesh instancing, regression from #423 (#559)
* [SM64] Fix mesh instancing, regression from #423

* better name
2025-08-15 13:29:45 -04:00
Dragorn421 58564cfc45 Remove legacy & unused f3d_render_engine (#570) 2025-08-13 14:06:45 +01:00
Lila f9b1b3cd1e [SM64] Add material slot sorting to armatures (#572) 2025-08-13 14:06:12 +01:00
YanisandYanis002 c24e20a47e [OoT] Add default camera when creating the scene (#563)
add default camera when creating the scene + create scene at 0;0;0

Co-authored-by: Yanis002 <[email protected]>
2025-08-05 10:04:14 +02:00
Lila 5b23359d3a Try to do append load post on register and remove it on unregister (#568) 2025-08-05 10:03:59 +02:00
Yanis 2db7eaa8ea [OoT] Fix cutscene export issues (#569)
fix extra cs export issues
2025-08-05 10:03:43 +02:00
YanisandYanis002 b51495a21f [OoT] Fix scene command issues (#562)
* fix scene commands

* display entrance actors as cones when importing

---------

Co-authored-by: Yanis002 <[email protected]>
2025-08-05 10:03:20 +02:00
Dragorn421 21059ce59a Fix Link import/export (#552)
* Fix Link import/export (wip)

* fix z64player.h / player.h

* fix importing Link pre-new-assets ?

* remove hardcoded player limb enum

* removeComments on flipbook import data (fixes importing child link)
2025-08-05 10:02:59 +02:00
Dragorn421 83b7657748 Fixup 565 normal import (#571) 2025-08-05 10:02:31 +02:00
Sauraen 518ce006fb Update packed normals implementation to match F3DEX3 beta (#567)
* Initial implementation

* blacked
2025-08-02 18:45:11 +01:00
Yanis b77720fca7 [OOT/MM] Misc changes for MM (#555)
* gamedata update on load and game change

* cs index stuff

* gameeditormode and update panels

* format

* add versions

* comment MM game editor mode to avoid confusing users
2025-06-29 20:22:23 +01:00
Yanis f84d179de5 [OOT/MM] Remove "oot" prefix from some enums and switch to them (#553)
remove "oot" prefix from some enums and switch to them
2025-06-22 21:24:42 +02:00
Yanis 2c87745bb7 Create Game Data and move fast64_internal/oot/data (#541)
* move oot.data to fast64_internal.data and introduce game_data (+ related changes)

* fix issues

* format

* remove useless "Game" attribute

* review
2025-06-20 13:56:12 +02:00
Lila 89fde3f525 [SM64] Make switch material override stackable and apply layer reverts (#544)
* [SM64] Make switch material override stackable and apply layer reverts

* fix override mat + layer adapt, improve hashing method

* fix override mat + layer adapt, improve hashing method

* make non dl nodes have the correct layer

* account for layer override in reverts

* some final details

* fix bleed issue

* fix bad reverts in option 0

* make bleed support checking for reverts
2025-06-18 11:21:54 +02:00
Yanis fa3eff11bc [OOT/MM] Rename OoT to Z64 and remove the OoT prefix from the files (#540)
* `fast64_internal/oot` -> `fast64_internal/z64`

* remove oot prefix (and delete `oot_spline.py`)

* remove another useless file

* load issues
2025-06-15 18:46:36 +02:00
YanisandDragorn421 d7b1ae878f [OoT] Fix the importers (#547)
* fix cutscene import

* account for committed assets

* add enums, add misc tools and fix few things

* fix matrix regex and fix get_include_data file path order

* fix collision import

* format

* fix camera and crawlspace import

* fixed waterbox import

* fixed exit lists

* fixed paths

* misc fixes

* fix lights

* misc fixes and moved utility funcs to global utility module

* fixed room parsing and mesh imports

* fixed actors and misc issues

* fix more issues (it works! or should work)

* fixed transition actors

* fix cutscenes

* note about CS_CMD_UNIMPLEMENTED_16

* camera roll is signed now

* fixed import issues with the older way

* fix fast64 imports + some improvements

* add comment about ignore_tlut

* fix skeletons

* fix animations

* fixed dl importer

* remove useless comment

* fixed lights

* review and "fixed" matrix issues

* review 2

* fix jabu imports

Co-authored-by: Dragorn421 <[email protected]>

* review 3

* review 4

* camroll thing

* format

* remove useless code

* "fixed" collision props regression

---------

Co-authored-by: Dragorn421 <[email protected]>
2025-06-15 12:06:11 +02:00
YanisandDragorn421 7d710783f4 [OoT] Exporter Cleanup (#533)
* remove old exporter files

* move anim/skeleton exporters to the exporter folder

* reimplement collision and cutscene exporter

* black

* fix small issues

* remove cs insert feature

* tweaks

* review

Co-authored-by: Dragorn421 <[email protected]>

---------

Co-authored-by: Dragorn421 <[email protected]>
2025-06-14 15:55:47 +02:00
Dragorn421 c4376de2e9 Cleanup: deselectAllObjects() and selectSingleObject() (#538) 2025-06-14 15:33:51 +02:00
Dragorn421 d6bb836aa3 Cleanup: setOrigin() (#537) 2025-06-14 15:33:33 +02:00
Dragorn421 6365e7af0b Bump bl_info version to v2.4.0 (#542) 2025-06-14 15:04:49 +02:00
Dragorn421 e95bd6f895 Fix export of custom conveyorSpeed (#550)
* Fix export of custom conveyorSpeed

* black
2025-06-10 06:58:13 +02:00
Dragorn421 f637ed8813 [OoT] Fix includes for z64 prefix removal (#549)
* [OoT] Fix includes for z64 prefix removal

* review
2025-06-06 06:32:38 +02:00
Yanis fa62e1343b [OoT] Fix animation exporter expecting an object name with custom paths (#546)
fix animation exporter expecting an object name with custom paths
2025-06-01 02:10:42 +02:00
Yanis a80a05bce5 [OoT] Fixed object being added to the duplicated room object (#543)
* fixed object auto-add adding to the duplicated room object

* don't trust sorting by names
2025-05-30 10:43:48 +02:00
Lila c6b678256d [F3D Bleed] Fix switch option doing an extra reset (#534) 2025-05-29 09:55:58 +02:00
Dragorn421 d536ebf745 [OoT] Fix player flipbooks export (#536) 2025-05-28 20:27:55 +02:00
Dragorn421andYanis d705b7a853 [OoT] Add move cutscene bone operator (#530)
* [OoT] Add move cutscene bone operator

* fixup

* No longer sort bones by name for computing the camera shot preview (which was different from what the exporter did anyway)

* Update fast64_internal/oot/cutscene/motion/properties.py

Co-authored-by: Yanis <[email protected]>

---------

Co-authored-by: Yanis <[email protected]>
2025-05-25 18:07:32 +02:00
YanisandDragorn421 985f4c48e1 [OoT] Scene/Cutscene Export Fixes (#528)
* cutscene fixes

* add missing includes in cs exporter

* use CS_FLOAT

* don't use cs_float for actor cues and use it for the unused values

* review

---------

Co-authored-by: Dragorn421 <[email protected]>
2025-05-24 10:20:38 +02:00
LilaandDragorn421 f221e640d3 [SM64/F3D] Use WriteDifferingAndRevert for bleed (#461)
* [SM64/F3D] Use WriteDifferingAndRevert for bleed

Write all logic remains unaffected, obviously.

A new dict was added to map each mode cmd to its default.
For the actual bleed part, we fIrst need to add geo mode reverts of the last material to the geo mode of the current material, since the current material may not set them now. For othermodes we do something different, get all reverts and add any that doesn´t get set again by the current material ignoring bleeding.
For the geo mode revert, we keep track of one geo mode command for set and clear, updating it as we go. For othermodes we keep track of all of the command types and then revert them using the new dict.

* remove this

* scut sabotage

* Port over #462

We cannot just assume that othermodeh or othermodel are always setting the same bits, so instead we write the diff of the current cmd to the one already in the reset dict, this means that if a materials sets rendermode and another sets alpha compare (for example) it will still revert the rendermode because those bits will be carried over in the reset dict

* make write different optional, as it can lead to bigger dls

* clean up sm64 repo settings

* im gonna have to rework a bunch of othermode stuff i actually dispise fast64 so much

* RendermodeBlender class

* Update f3d_bleed.py

* i just want to be done with this

* [Repo Settings] Only set if different

Fixes lag at start up from draw layers being set unnecessarily.
Some clean up that I already did in #461

* Update utility.py

* is_rendermode_cmd to def

* fix rendermode

* return RendermodeBlender instead of temp list

* instead of using a revert, set when no render mode

* make rendermode command hashable, check for default

* pick appropriate geo cmd, make geo cmds use sets

makes dls just a bit cleaner and makes ex1 work correctly

* implement render mode reset fix

* Update f3d_bleed.py

* undo dumb change

* respect write method

* only revert as needed, i feel like a god

* make switchs work super well

* fix setting rendermode

* remove repeated resets in switch options and add options for reverts in bones

* use last_mat by default

* comment out occlusion plane code to show bleed indep

* functions already work

* fix load othermodes

these work more like write diffs, so we do that

* someone forgot

* fix prev node issue

* create our own pipe syncs

* Update f3d_bleed.py

* fix disgusting broken late night code

* Revert "fix disgusting broken late night code"

This reverts commit 9ece1511595678a551fae02f906a998fbde1ffba.

* Update sm64_geolayout_classes.py

* something is wrong but i cant figure it out

* dont remove lighting

* fix DPSetRenderMode

* fix write all rendermode

* fix this bug once and for all

* write all get_flags impl

* get_flags

* forgot to do diff in reverts in write all

* add back prim depth, accidentally removed

* comments (not ready)

* not a union

* not a tuple

Co-authored-by: Dragorn421 <[email protected]>

* proper formatting

Co-authored-by: Dragorn421 <[email protected]>

* use load sync

* oopsie dasie

* use pipe syncs again

---------

Co-authored-by: Dragorn421 <[email protected]>
2025-05-23 19:48:29 +01:00
Yanis 552bdb797c [OoT] Add basic title cards support (#525)
* add basic title card support

* review

* add z64path.h

* remove added includes in favor of another PR
2025-05-23 07:39:46 +02:00
Lila 66d38da91a [F3D] Fix for blender 4.4 (#529)
[F3D] Fix blender 4.4
2025-05-23 06:35:31 +01:00
Yanis 8336f42009 [OoT] Add missing versions to oot_versions_items and add overlay support for quick import (#482)
* add missing versions and improve quick import

* remove debug print

* add ignore cs stop preview setting

* lilaa's suggestion + added ique-cn

* throw a warning when trying to import a cutscene which already exists in the data
2025-05-20 20:34:23 +02:00
Yanis 88c304138a [OoT] Remove global.h, macros.h and z64.h in the exported includes (#518)
* fix exporting using obsolete headers

* old behavior for legacy version

* check for z64.h instead of specific version

* z64.h -> global.h
2025-05-20 20:33:50 +02:00
Yanis cebdd146e1 [OoT] Fixed collision export (#507)
* fixed collision export

* fixed include oddities

* fix compile issues

* support for older decomp headers

* z64.h -> global.h
2025-05-20 20:31:21 +02:00
Yanis 5445d2ebe1 [OoT] Move collection operators/functions from oot_utility.py (#486)
move collection stuff to its own file
2025-05-20 20:30:59 +02:00
Yanis 236c34a964 [OoT] Add a toggle for the new actor panel (#505)
* add toggle for new actor panel

* fix custom issue
2025-05-20 20:30:29 +02:00
Lila 49080393c7 [F3D] Fix cycle 2 NOOP identifier (#521) 2025-05-20 16:47:15 +01:00
LilaandDragorn421 515a14ccb5 [F3D] Use set for image and pal dependencies (#522)
* [F3D] Use set for image and pal dependencies

Prevents duplicates, causing the behavior seen in this issue https://discord.com/channels/874816709855440926/1373127651283439636

* use set in default_factory

Co-authored-by: Dragorn421 <[email protected]>

---------

Co-authored-by: Dragorn421 <[email protected]>
2025-05-20 16:47:01 +01:00