-
Notifications
You must be signed in to change notification settings - Fork 100
[SM64] fix Whirlpool Object export for decomp/ultrasm64 #456
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ | |
| enumLevelNames, | ||
| enumModelIDs, | ||
| enumMacrosNames, | ||
| enumWhirlpoolConditions, | ||
| enumSpecialsNames, | ||
| enumBehaviourPresets, | ||
| enumBehaviorMacros, | ||
|
|
@@ -136,7 +137,7 @@ | |
| ("ENVFX_SNOW_BLIZZARD", "Blizzard", "Unused"), | ||
| ("ENVFX_FLOWERS", "Flowers", "Unused"), | ||
| ("ENVFX_LAVA_BUBBLES", "Lava Bubbles", "Used in LLL, BitFS, Bowser 2"), | ||
| ("ENVFX_WHIRLPOOL_BUBBLES", "Whirpool Bubbles", "Used in DDD where whirpool is"), | ||
| ("ENVFX_WHIRLPOOL_BUBBLES", "Whirlpool Bubbles", "Used in DDD where whirlpool is"), | ||
| ("ENVFX_JETSTREAM_BUBBLES", "Jetstream Bubbles", "Used in JRB, DDD where jetstream is"), | ||
| ] | ||
|
|
||
|
|
@@ -341,7 +342,7 @@ def to_c(self): | |
| ) | ||
|
|
||
|
|
||
| class SM64_Whirpool: | ||
| class SM64_Whirlpool: | ||
| def __init__(self, index, condition, strength, position): | ||
| self.index = index | ||
| self.condition = condition | ||
|
|
@@ -351,7 +352,7 @@ def __init__(self, index, condition, strength, position): | |
|
|
||
| def to_c(self): | ||
| return ( | ||
| "WHIRPOOL(" | ||
| "WHIRLPOOL(" | ||
| + str(self.index) | ||
| + ", " | ||
| + str(self.condition) | ||
|
|
@@ -852,10 +853,9 @@ def process_sm64_objects(obj, area, rootMatrix, transformMatrix, specialsOnly): | |
| area.mario_start = mario_start | ||
| elif obj.sm64_obj_type == "Trajectory": | ||
| pass | ||
| elif obj.sm64_obj_type == "Whirpool": | ||
| area.objects.append( | ||
| SM64_Whirpool(obj.whirlpool_index, obj.whirpool_condition, obj.whirpool_strength, translation) | ||
| ) | ||
| elif obj.sm64_obj_type == "Whirlpool": | ||
| condition = obj.sm64_whirlpool_enum if obj.sm64_whirlpool_enum != "Custom" else obj.sm64_obj_preset | ||
| area.objects.append(SM64_Whirlpool(obj.whirlpool_index, condition, obj.whirlpool_strength, translation)) | ||
| elif obj.sm64_obj_type == "Camera Volume": | ||
| checkIdentityRotation(obj, rotation.to_quaternion(), True) | ||
| if obj.cameraVolumeGlobal: | ||
|
|
@@ -1222,9 +1222,13 @@ def draw(self, context): | |
| pass | ||
|
|
||
| elif obj.sm64_obj_type == "Whirlpool": | ||
| prop_split(box, obj, "whirpool_index", "Index") | ||
| prop_split(box, obj, "whirpool_condition", "Condition") | ||
| prop_split(box, obj, "whirpool_strength", "Strength") | ||
| prop_split(box, obj, "sm64_whirlpool_enum", "Condition") | ||
| if obj.sm64_whirlpool_enum == "Custom": | ||
| prop_split(box, obj, "sm64_obj_preset", "Condition Name") | ||
| box.box().label(text="Whirlpool conditions defined in include/level_commands.h.") | ||
| prop_split(box, obj, "whirlpool_index", "Index") | ||
| prop_split(box, obj, "whirlpool_strength", "Strength") | ||
| box.box().label(text="Negative strength pushs, positive strength pulls.") | ||
| pass | ||
|
|
||
| elif obj.sm64_obj_type == "Water Box": | ||
|
|
@@ -2878,9 +2882,10 @@ def sm64_obj_register(): | |
|
|
||
| bpy.types.Object.sm64_obj_mario_start_area = bpy.props.StringProperty(name="Area", default="0x01") | ||
|
|
||
| bpy.types.Object.whirpool_index = bpy.props.StringProperty(name="Index", default="0") | ||
| bpy.types.Object.whirpool_condition = bpy.props.StringProperty(name="Condition", default="3") | ||
| bpy.types.Object.whirpool_strength = bpy.props.StringProperty(name="Strength", default="-30") | ||
| bpy.types.Object.whirlpool_index = bpy.props.StringProperty(name="Index", default="0") | ||
| bpy.types.Object.sm64_whirlpool_enum = bpy.props.EnumProperty(name="Condition", items=enumWhirlpoolConditions) | ||
| bpy.types.Object.whirlpool_strength = bpy.props.StringProperty(name="Strength", default="20") | ||
|
Comment on lines
+2885
to
+2887
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New props should be in their respective property groups, in this case these properties would be in ̶S̶M̶6̶4̶_̶G̶a̶m̶e̶O̶b̶j̶e̶c̶t̶P̶r̶o̶p̶e̶r̶t̶i̶e̶s̶ actually maybe it should be a prop group in SM64_ObjectProperties? techinically whirlpools are objects lol
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @s4Ys369 could you please make this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't look into this in months, so out of my depth. I should just revert the changes and fix the existing typos to restore functionality.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll pr that change to your branch once I'm done reviewing scut's geolayout opt pr if you'd like |
||
|
|
||
| bpy.types.Object.waterBoxType = bpy.props.EnumProperty( | ||
| name="Water Box Type", items=enumWaterBoxType, default="Water" | ||
| ) | ||
|
|
@@ -3016,6 +3021,7 @@ def sm64_obj_unregister(): | |
| del bpy.types.Object.sm64_macro_enum | ||
| del bpy.types.Object.sm64_special_enum | ||
| del bpy.types.Object.sm64_behaviour_enum | ||
| del bpy.types.Object.sm64_whirlpool_enum | ||
|
|
||
| # del bpy.types.Object.sm64_model | ||
| # del bpy.types.Object.sm64_macro | ||
|
|
@@ -3027,9 +3033,8 @@ def sm64_obj_unregister(): | |
| del bpy.types.Object.sm64_obj_preset | ||
| del bpy.types.Object.sm64_obj_behaviour | ||
|
|
||
| del bpy.types.Object.whirpool_index | ||
| del bpy.types.Object.whirpool_condition | ||
| del bpy.types.Object.whirpool_strength | ||
| del bpy.types.Object.whirlpool_index | ||
| del bpy.types.Object.whirlpool_strength | ||
|
|
||
| del bpy.types.Object.waterBoxType | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.