Skip to content

Conversation

@Yanis002
Copy link
Collaborator

@Yanis002 Yanis002 commented Jul 1, 2025

This PR moves enum usage to the game_data module, also switches some of the enums to the ones generated from the xml data for the ones that are already present in the xml file, the other ones will be treated in another PR

There's a change in the new actor panel that I don't think will cause issues, basically I moved the generated props to .oot.XXX for both games instead of having them directly under .ootActorProperty, there's still changes needed for actors though

@Yanis002 Yanis002 added oot Has to do with the Ocarina of Time 64 side mm Has to do with the Majora's Mask side labels Jul 1, 2025
@Yanis002
Copy link
Collaborator Author

Yanis002 commented Nov 9, 2025

I noticed earlier there's an export bug I have to address

bl_options = {"REGISTER", "UNDO"}

chest_content: EnumProperty(items=game_data.z64.actors.ootEnumChestContent, default="item_heart")
chest_content: EnumProperty(items=lambda self, context: game_data.z64.get_enum("chest_content"), default=1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this work? I thought properties had to have enums which were permanently fixed. What happens if the enum was {A, B, C}, the property was set to B, and then the enum was changed to {D, E, F}? Does the property change to the default value of the new enum? If it keeps the index, what if it was previously C and the enum was changed to {D, E} (out of bounds)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

you can supply a function to the items to make it fetch the list at runtime, I think in your first example the value would be E since it saves the index (or at least I think it does? I have a small doubt now), I guess that's an issue then but idk why anyone would edit the enum, also the data parser fills the blanks, like say you remove one entry it will add a dummy placeholder to avoid breaking the enum like in your examples (actually it's filling all of the list with the placeholders then it replace them, so you'd have to shrink the length of the enum to cause any issues but same idk why anyone would do that, I never seen a case where someone edits the xml data tbh)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't mean if someone edits the XML data but if someone changes the selected game. This could be, import something from OoT, change to MM, export it, or it could be just start Blender in the default scene and change the game. I'm not really worried about correctness, but about Blender not crashing. Anyway just test it.

Copy link
Collaborator Author

@Yanis002 Yanis002 Nov 9, 2025

Choose a reason for hiding this comment

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

each game got their own enums, only the operator is common iirc so it should be fine, see get_prop_name and create_game_props (previously initOOTActorProperties) in actor/properties.py

@Yanis002
Copy link
Collaborator Author

found another tiny issue with my test blend, the fade out seq player type enum is acting strange, I have one blank item and nothing makes sense, this PR's enum and the main branch one are literally the same except for the explicit indices and even after adding the necessary stuff for the seq player it's still broken so idk, not a big deal though you just have to set the value again and that's it but yeah idk, not a big issue anyway so I think it's fine (also I don't think a lot of people will be affected by this anyway, at least I hope lol)

otherwise I fixed the surface type export issue I found the other day so I think this PR should be ready to merge 💪

Copy link
Contributor

@Reonu Reonu left a comment

Choose a reason for hiding this comment

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

exported a few different things with it, seems fine with the latest fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mm Has to do with the Majora's Mask side oot Has to do with the Ocarina of Time 64 side

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants