Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOT Link Import/Export + Flipbook Import/Export + Animation Updates/Fixes #126

Merged
merged 139 commits into from
Nov 3, 2022

Conversation

kurethedead
Copy link
Contributor

This PR allows for the importing of missing face/mouth textures, which were cases of textures animated through code. Provided an overlay, Fast64 will try to find texture arrays used for flipbook animation and read them into the material. The material will allow you to preview any texture in the flipbook. This will also export correctly, and try to override texture arrays in the provided overlay. Flipbook textures using color index will automatically use a shared palette.

Additionally, OOT skeleton and DL imports will now automatically search in assets/objects/... files that have been included in the object/actor file. Ideally the user should now be able to import skeleton -> modify -> export -> compile without having to hand edit code.
blender_wTff26AqJ5

Note this only works under specific conditions right now (texture array name must be present in the gSPSegment() call)
Notable exceptions: z_en_wf (branch between two different segment loads), z_obj_switch (2d texture array)
Note that there is current import lag (probably due to regex processing) after implementing asset including for files.
…g link_animetion.c for regex searches. Fixed some asset includes.
…ying to flipbooks, which will be incorrect for importing fast64 exports.
One import/export cycle works fine, next results in compiler errors
There's a possibility that two CI flipbooks write to the same flipbook name. Before this fix the later one would override the older one (ex. LOD), which would cause the first flipbook to use the LOD version textures with its own palette, causing issues.
@kurethedead
Copy link
Contributor Author

I've fixed the current merge conflicts with the new commits.

fast64_internal/f3d/f3d_gbi.py Outdated Show resolved Hide resolved
fast64_internal/f3d/f3d_material.py Outdated Show resolved Hide resolved
Comment on lines 3393 to 3395
self.set_k0_5,
self.set_combiner,
self.set_k0_5,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not an issue but set_k0_5 is there twice

however set_lights is missing, intentionally?
and use_global_fog?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a commit to fix the other things, but use_global_fog is a weird property in that it's sm64 specific and not technically part of the material itself.

fast64_internal/f3d/f3d_parser.py Outdated Show resolved Hide resolved
Comment on lines +739 to +741
key = self.getMaterialKey(self.materialContext)
if key in self.materialDict:
material = self.materialDict[key]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so this is where material deduplication happens?
self.materialDict[self.getMaterialKey(self.materialContext)] is not always self.materialContext?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

materialContext is just a regular blender material. Whenever a new material needs to be made, a copy is created and stored in a list. If a matching is key is detected, then the existing material in that list is used instead of creating a new copy.

fast64_internal/f3d/f3d_parser.py Outdated Show resolved Hide resolved
fast64_internal/f3d/f3d_writer.py Outdated Show resolved Hide resolved
fast64_internal/oot/oot_anim.py Show resolved Hide resolved
fast64_internal/oot/oot_anim.py Outdated Show resolved Hide resolved
Copy link
Contributor

@Zelllll Zelllll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving on the basis that this functionally works.

@Dragorn421 Dragorn421 added merge soon Will be merged in a few days at most if nothing else comes up and removed merge soon Will be merged in a few days at most if nothing else comes up labels Oct 31, 2022
@Dragorn421
Copy link
Contributor

Unexpectedly delaying this a bit to slightly improve a gEmptyList vs NULL behavior
(feel free to correct me Kure and if you want to do it later we can also merge this as is)

@krm01
Copy link
Contributor

krm01 commented Nov 3, 2022

@Dragorn421 my understanding is the gEmptyList vs NULL is only a problem for people who tried to use this branch before Kure made the change, and had existing blend files with the old behavior. That's what happened to me. I have been testing this again tonight and a clean import of the skeleton works fine.

@kurethedead
Copy link
Contributor Author

Yeah we can do it later, for now I'll just add a warning message.

@ariahiro64
Copy link

I can confirm that the issue I was having was due to an older skeleton. The skeleton itself was updated successfully so I guess only a small warning is needed and it's good to go.

@Dragorn421 Dragorn421 merged commit 31a9680 into Fast-64:main Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
oot Has to do with the Ocarina of Time 64 side
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants