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] Detailed Actor Panel (Actors, Transition Actors, Entrance Actors) #242

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
12773c2
parsed parameters for actor data
Yanis002 Jul 14, 2023
a0b683f
removed paramsByType
Yanis002 Jul 14, 2023
a5df013
main logic
Yanis002 Jul 14, 2023
9219ee8
fixed issues and export
Yanis002 Jul 15, 2023
178adb5
operators
Yanis002 Jul 16, 2023
dab82b9
black
Yanis002 Jul 16, 2023
d5c0a2a
fixes, transition actor list
Yanis002 Jul 16, 2023
a1b6fb6
upgrade logic
Yanis002 Jul 16, 2023
5b83f9d
Merge remote-tracking branch 'upstream/main' into detailed_actor_pane…
Yanis002 Jul 22, 2023
303179d
fixes
Yanis002 Jul 24, 2023
3f43932
black
Yanis002 Jul 24, 2023
acfe361
Merge remote-tracking branch 'upstream/main' into detailed_actor_pane…
Yanis002 Jan 5, 2024
cbc39e7
review
Yanis002 Jan 5, 2024
f9151cc
Merge remote-tracking branch 'upstream/main' into detailed_actor_pane…
Yanis002 Jan 7, 2024
5467963
review
Yanis002 Jan 7, 2024
1cbfdde
Merge remote-tracking branch 'upstream/main' into detailed_actor_pane…
Yanis002 Apr 18, 2024
ea5c464
fixed export issues
Yanis002 Apr 19, 2024
b02a5cc
Merge remote-tracking branch 'upstream/main' into detailed_actor_pane…
Yanis002 Jun 1, 2024
59385f3
Merge remote-tracking branch 'upstream/main' into detailed_actor_pane…
Yanis002 Jul 26, 2024
e2d0bc4
format
Yanis002 Jul 26, 2024
501b2fb
kure's review part 1
Yanis002 Aug 4, 2024
a13eb52
fixed upgrade issues (custom not handled yet)
Yanis002 Aug 5, 2024
af47db7
snake case-ify functions, tiny xml docs/fixes, completed upgrade stuff
Yanis002 Aug 5, 2024
ceacd6e
add custom values for enums
Yanis002 Aug 7, 2024
ca7a0bb
added custom values for string props
Yanis002 Aug 7, 2024
ae30076
small fix and default to custom in upgrade
Yanis002 Aug 8, 2024
9c52996
fixed custom values not working
Yanis002 Aug 13, 2024
67dd0b8
Merge remote-tracking branch 'upstream/main' into detailed_actor_pane…
Yanis002 Aug 13, 2024
51def8a
Merge remote-tracking branch 'upstream/main' into detailed_actor_pane…
Yanis002 Dec 1, 2024
6536886
fixed issues related to custom value for Chest/Navi Msg
Yanis002 Dec 1, 2024
b8524e1
fixed issue where 'get_param_value' can return None in some cases
Yanis002 Dec 1, 2024
026e5f8
latest review from kure
Yanis002 Dec 1, 2024
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
2 changes: 2 additions & 0 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
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.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 @@ -403,6 +404,7 @@ def register():
register_class(ExampleAddonPreferences)
addon_updater_ops.register(bl_info)

initOOTActorProperties()
utility_anim_register()
mat_register()
render_engine_register()
Expand Down
73 changes: 59 additions & 14 deletions fast64_internal/oot/actor/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,82 @@
from ..oot_constants import ootData


class OOT_SearchChestContentEnumOperator(Operator):
bl_idname = "object.oot_search_chest_content_enum_operator"
bl_label = "Select Chest Content"
bl_property = "chest_content"
bl_options = {"REGISTER", "UNDO"}

chest_content: EnumProperty(items=ootData.actorData.ootEnumChestContent, default="item_heart")
obj_name: StringProperty()
prop_name: StringProperty()

def execute(self, context):
setattr(bpy.data.objects[self.obj_name].ootActorProperty, self.prop_name, self.chest_content)
context.region.tag_redraw()
self.report({"INFO"}, f"Selected: {self.chest_content}")
return {"FINISHED"}

def invoke(self, context, event):
context.window_manager.invoke_search_popup(self)
return {"RUNNING_MODAL"}


class OOT_SearchNaviMsgIDEnumOperator(Operator):
bl_idname = "object.oot_search_navi_msg_id_enum_operator"
bl_label = "Select Message ID"
bl_property = "navi_msg_id"
bl_options = {"REGISTER", "UNDO"}

navi_msg_id: EnumProperty(items=ootData.actorData.ootEnumNaviMessageData, default="msg_00")
obj_name: StringProperty()
prop_name: StringProperty()

def execute(self, context):
setattr(bpy.data.objects[self.obj_name].ootActorProperty, self.prop_name, self.navi_msg_id)
context.region.tag_redraw()
self.report({"INFO"}, f"Selected: {self.navi_msg_id}")
return {"FINISHED"}

def invoke(self, context, event):
context.window_manager.invoke_search_popup(self)
return {"RUNNING_MODAL"}


class OOT_SearchActorIDEnumOperator(Operator):
bl_idname = "object.oot_search_actor_id_enum_operator"
bl_label = "Select Actor ID"
bl_property = "actorID"
bl_property = "actor_id"
bl_options = {"REGISTER", "UNDO"}

actorID: EnumProperty(items=ootData.actorData.ootEnumActorID, default="ACTOR_PLAYER")
actorUser: StringProperty(default="Actor")
objName: StringProperty()
actor_id: EnumProperty(items=lambda self, context: ootData.actorData.getItems(self.actor_user))
actor_user: StringProperty(default="Actor")
obj_name: StringProperty()

def execute(self, context):
obj = bpy.data.objects[self.objName]
if self.actorUser == "Transition Actor":
obj.ootTransitionActorProperty.actor.actorID = self.actorID
elif self.actorUser == "Actor":
obj.ootActorProperty.actorID = self.actorID
elif self.actorUser == "Entrance":
obj.ootEntranceProperty.actor.actorID = self.actorID
obj = bpy.data.objects[self.obj_name]

if self.actor_user == "Transition Actor":
obj.ootTransitionActorProperty.actor.actor_id = self.actor_id
elif self.actor_user == "Actor":
obj.ootActorProperty.actor_id = self.actor_id
else:
raise PluginError("Invalid actor user for search: " + str(self.actorUser))
raise PluginError("Invalid actor user for search: " + str(self.actor_user))

context.region.tag_redraw()
self.report({"INFO"}, "Selected: " + self.actorID)
self.report({"INFO"}, f"Selected: {self.actor_id}")
return {"FINISHED"}

def invoke(self, context, event):
context.window_manager.invoke_search_popup(self)
return {"RUNNING_MODAL"}


classes = (OOT_SearchActorIDEnumOperator,)
classes = (
OOT_SearchActorIDEnumOperator,
OOT_SearchChestContentEnumOperator,
OOT_SearchNaviMsgIDEnumOperator,
)


def actor_ops_register():
Expand Down
Loading
Loading