From 448de2ff1169065287a29e316b56364fe175e9fc Mon Sep 17 00:00:00 2001 From: Lila Date: Thu, 27 Jun 2024 17:43:36 +0100 Subject: [PATCH 1/5] Remove "HIDE_HEADER" option idea --- fast64_internal/f3d/f3d_material.py | 8 +- fast64_internal/f3d/flipbook.py | 7 +- fast64_internal/oot/animation/panels.py | 5 +- fast64_internal/oot/collision/panels.py | 17 +- fast64_internal/oot/collision/properties.py | 59 +++-- fast64_internal/oot/cutscene/motion/panels.py | 49 ++-- .../oot/cutscene/motion/properties.py | 17 +- fast64_internal/oot/f3d/panels.py | 28 ++- fast64_internal/oot/f3d/properties.py | 22 +- fast64_internal/oot/props_panel_main.py | 35 ++- fast64_internal/oot/skeleton/panels.py | 10 +- fast64_internal/oot/spline/panels.py | 9 +- fast64_internal/sm64/sm64_camera.py | 4 +- fast64_internal/sm64/sm64_collision.py | 22 +- fast64_internal/sm64/sm64_f3d_writer.py | 17 +- fast64_internal/sm64/sm64_geolayout_bone.py | 19 +- fast64_internal/sm64/sm64_objects.py | 210 +++++++++--------- fast64_internal/sm64/sm64_spline.py | 11 +- 18 files changed, 253 insertions(+), 296 deletions(-) diff --git a/fast64_internal/f3d/f3d_material.py b/fast64_internal/f3d/f3d_material.py index 2563aaa85..a2cb334f4 100644 --- a/fast64_internal/f3d/f3d_material.py +++ b/fast64_internal/f3d/f3d_material.py @@ -619,10 +619,10 @@ def tmemUsageUI(layout, textureProp): class F3DPanel(Panel): bl_label = "F3D Material" bl_idname = "MATERIAL_PT_F3D_Inspector" + bl_parent_id = "EEVEE_MATERIAL_PT_context_material" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" - bl_options = {"HIDE_HEADER"} def ui_prop(self, material, layout, name, setName, setProp, showCheckBox): nodes = material.node_tree.nodes @@ -1242,8 +1242,6 @@ def draw(self, context): settings = f3dMat.rdp_settings layout.prop(context.scene, "f3d_simple", text="Show Simplified UI") layout = layout.box() - titleCol = layout.column() - titleCol.box().label(text="F3D Material Inspector") presetCol = layout.column() split = presetCol.split(factor=0.33) @@ -3377,10 +3375,10 @@ def key(self): class DefaultRDPSettingsPanel(Panel): bl_label = "RDP Default Settings" bl_idname = "WORLD_PT_RDP_Default_Inspector" + bl_parent_id = "WORLD_PT_context_world" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "world" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -3389,7 +3387,6 @@ def poll(cls, context): def draw(self, context): world = context.scene.world layout = self.layout - layout.box().label(text="RDP Default Settings") layout.label(text="If a material setting is a same as a default setting, then it won't be set.") ui_geo_mode(world.rdp_defaults, world, layout, True) ui_upper_mode(world.rdp_defaults, world, layout, True) @@ -4481,7 +4478,6 @@ def mat_register(): World.menu_upper = bpy.props.BoolProperty() World.menu_lower = bpy.props.BoolProperty() World.menu_other = bpy.props.BoolProperty() - World.menu_layers = bpy.props.BoolProperty() Material.is_f3d = bpy.props.BoolProperty() Material.mat_ver = bpy.props.IntProperty(default=1) diff --git a/fast64_internal/f3d/flipbook.py b/fast64_internal/f3d/flipbook.py index 86e9f3bdb..b5c55e5f4 100644 --- a/fast64_internal/f3d/flipbook.py +++ b/fast64_internal/f3d/flipbook.py @@ -211,7 +211,6 @@ def drawFlipbookGroupProperty( checkFlipbookReference: Callable[[str], bool], drawFlipbookRequirementMessage: Callable[[bpy.types.UILayout], None], ): - layout.box().column().label(text="Flipbook Properties") if drawFlipbookRequirementMessage is not None: drawFlipbookRequirementMessage(layout) for i in range(2): @@ -275,12 +274,12 @@ def flipbookAnimHandler(dummy): class Flipbook_MaterialPanel(bpy.types.Panel): - bl_label = "Flipbook Material" + bl_label = "OOT Flipbook Properties" bl_idname = "MATERIAL_PT_Flipbook_Material_Inspector" + bl_parent_id = "EEVEE_MATERIAL_PT_context_material" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -298,7 +297,7 @@ def draw(self, context): checkFlipbookReference = None drawFlipbookRequirementMessage = None - drawFlipbookGroupProperty(col.box().column(), mat, checkFlipbookReference, drawFlipbookRequirementMessage) + drawFlipbookGroupProperty(col, mat, checkFlipbookReference, drawFlipbookRequirementMessage) def setTexNodeImage(material: bpy.types.Material, texIndex: int, flipbookIndex: int): diff --git a/fast64_internal/oot/animation/panels.py b/fast64_internal/oot/animation/panels.py index ce3e8f00e..5e5c4e79b 100644 --- a/fast64_internal/oot/animation/panels.py +++ b/fast64_internal/oot/animation/panels.py @@ -8,11 +8,11 @@ class OOT_LinkAnimPanel(Panel): bl_idname = "OOT_PT_link_anim" + bl_parent_id = "OBJECT_PT_context_object" bl_label = "OOT Link Animation Properties" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -25,8 +25,7 @@ def poll(cls, context): # called every frame def draw(self, context): - col = self.layout.box().column() - col.box().label(text="OOT Link Animation Inspector") + col = self.layout.column() linkTextureAnim: OOTLinkTextureAnimProperty = context.object.ootLinkTextureAnim linkTextureAnim.draw_props(col) col.label(text="Index 0 is for auto, flipbook starts at index 1.", icon="INFO") diff --git a/fast64_internal/oot/collision/panels.py b/fast64_internal/oot/collision/panels.py index ee98b0745..b4f535e80 100644 --- a/fast64_internal/oot/collision/panels.py +++ b/fast64_internal/oot/collision/panels.py @@ -6,43 +6,40 @@ class OOT_CameraPosPanel(Panel): - bl_label = "Camera Position Inspector" + bl_label = "OOT Camera Position Inspector" bl_idname = "OBJECT_PT_OOT_Camera_Position_Inspector" + bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): return context.scene.gameEditorMode == "OOT" and isinstance(context.object.data, Camera) def draw(self, context): - box = self.layout.box().column() + col = self.layout.column() obj = context.object - box.box().label(text="Camera Data") camPosProps: OOTCameraPositionProperty = obj.ootCameraPositionProperty - camPosProps.draw_props(box, obj) + camPosProps.draw_props(col, obj) class OOT_CollisionPanel(Panel): - bl_label = "Collision Inspector" + bl_label = "OOT Collision Inspector" bl_idname = "MATERIAL_PT_OOT_Collision_Inspector" + bl_parent_id = "EEVEE_MATERIAL_PT_context_material" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): return context.scene.gameEditorMode == "OOT" and context.material is not None def draw(self, context): - box = self.layout.box().column() - collisionProp: OOTMaterialCollisionProperty = context.material.ootCollisionProperty - collisionProp.draw_props(box) + collisionProp.draw_props(self.layout.column()) class OOT_ExportCollisionPanel(OOT_Panel): diff --git a/fast64_internal/oot/collision/properties.py b/fast64_internal/oot/collision/properties.py index 2b2373773..79eb3d0f6 100644 --- a/fast64_internal/oot/collision/properties.py +++ b/fast64_internal/oot/collision/properties.py @@ -59,8 +59,6 @@ def draw_props(self, layout: UILayout, cameraObj: Object): class OOTMaterialCollisionProperty(PropertyGroup): - expandTab: BoolProperty() - ignoreCameraCollision: BoolProperty() ignoreActorCollision: BoolProperty() ignoreProjectileCollision: BoolProperty() @@ -90,38 +88,31 @@ class OOTMaterialCollisionProperty(PropertyGroup): sound: EnumProperty(items=ootEnumCollisionSound, default="0x00") def draw_props(self, layout: UILayout): - layout.prop( - self, - "expandTab", - text="OOT Collision Properties", - icon="TRIA_DOWN" if self.expandTab else "TRIA_RIGHT", - ) - if self.expandTab: - prop_split(layout, self, "exitID", "Exit ID") - prop_split(layout, self, "cameraID", "Camera ID") - prop_split(layout, self, "echo", "Echo") - prop_split(layout, self, "lightingSetting", "Lighting") - drawEnumWithCustom(layout, self, "terrain", "Terrain", "") - drawEnumWithCustom(layout, self, "sound", "Sound", "") - - layout.prop(self, "eponaBlock", text="Blocks Epona") - layout.prop(self, "decreaseHeight", text="Decrease Height 1 Unit") - layout.prop(self, "isWallDamage", text="Is Wall Damage") - layout.prop(self, "hookshotable", text="Hookshotable") - - drawEnumWithCustom(layout, self, "floorSetting", "Floor Setting", "") - drawEnumWithCustom(layout, self, "wallSetting", "Wall Setting", "") - drawEnumWithCustom(layout, self, "floorProperty", "Floor Property", "") - - layout.prop(self, "ignoreCameraCollision", text="Ignore Camera Collision") - layout.prop(self, "ignoreActorCollision", text="Ignore Actor Collision") - layout.prop(self, "ignoreProjectileCollision", text="Ignore Projectile Collision") - prop_split(layout, self, "conveyorOption", "Conveyor Option") - if self.conveyorOption != "None": - prop_split(layout, self, "conveyorRotation", "Conveyor Rotation") - drawEnumWithCustom(layout, self, "conveyorSpeed", "Conveyor Speed", "") - if self.conveyorSpeed != "Custom": - layout.prop(self, "conveyorKeepMomentum", text="Keep Momentum") + prop_split(layout, self, "exitID", "Exit ID") + prop_split(layout, self, "cameraID", "Camera ID") + prop_split(layout, self, "echo", "Echo") + prop_split(layout, self, "lightingSetting", "Lighting") + drawEnumWithCustom(layout, self, "terrain", "Terrain", "") + drawEnumWithCustom(layout, self, "sound", "Sound", "") + + layout.prop(self, "eponaBlock", text="Blocks Epona") + layout.prop(self, "decreaseHeight", text="Decrease Height 1 Unit") + layout.prop(self, "isWallDamage", text="Is Wall Damage") + layout.prop(self, "hookshotable", text="Hookshotable") + + drawEnumWithCustom(layout, self, "floorSetting", "Floor Setting", "") + drawEnumWithCustom(layout, self, "wallSetting", "Wall Setting", "") + drawEnumWithCustom(layout, self, "floorProperty", "Floor Property", "") + + layout.prop(self, "ignoreCameraCollision", text="Ignore Camera Collision") + layout.prop(self, "ignoreActorCollision", text="Ignore Actor Collision") + layout.prop(self, "ignoreProjectileCollision", text="Ignore Projectile Collision") + prop_split(layout, self, "conveyorOption", "Conveyor Option") + if self.conveyorOption != "None": + prop_split(layout, self, "conveyorRotation", "Conveyor Rotation") + drawEnumWithCustom(layout, self, "conveyorSpeed", "Conveyor Speed", "") + if self.conveyorSpeed != "Custom": + layout.prop(self, "conveyorKeepMomentum", text="Keep Momentum") class OOTWaterBoxProperty(PropertyGroup): diff --git a/fast64_internal/oot/cutscene/motion/panels.py b/fast64_internal/oot/cutscene/motion/panels.py index a2018fed4..5cfe1e773 100644 --- a/fast64_internal/oot/cutscene/motion/panels.py +++ b/fast64_internal/oot/cutscene/motion/panels.py @@ -4,37 +4,38 @@ class OOT_CSMotionCameraShotPanel(OOT_Panel): - bl_label = "Cutscene Motion Camera Shot Controls" + bl_label = "OOT Cutscene Motion Camera Shot Controls" bl_idname = "OOT_PT_camera_shot_panel" + bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} + @classmethod + def poll(cls, context): + return context.scene.gameEditorMode == "OOT" and context.view_layer.objects.active is not None and context.view_layer.objects.active.type == "ARMATURE" def draw(self, context): obj = context.view_layer.objects.active - layout = self.layout - - if obj.type == "ARMATURE": - camShotProp: CutsceneCmdCameraShotProperty = obj.data.ootCamShotProp - camShotPointProp: CutsceneCmdCameraShotPointProperty = None - activeBone = editBone = None - - box = layout.box() - camShotProp.draw_props(box, self.bl_label) - - if obj.mode == "POSE": - box.label(text="Warning: You can't be in 'Pose' mode to edit camera bones!") - elif obj.mode == "OBJECT": - activeBone = obj.data.bones.active - if activeBone is not None: - camShotPointProp = activeBone.ootCamShotPointProp - camShotPointProp.draw_props(box) - elif obj.mode == "EDIT": - editBone = obj.data.edit_bones.active - if editBone is not None: - camShotPointProp = editBone.ootCamShotPointProp - camShotPointProp.draw_props(box) + col = self.layout.column() + + camShotProp: CutsceneCmdCameraShotProperty = obj.data.ootCamShotProp + camShotPointProp: CutsceneCmdCameraShotPointProperty = None + activeBone = editBone = None + + camShotProp.draw_props(col) + + if obj.mode == "POSE": + col.label(text="Warning: You can't be in 'Pose' mode to edit camera bones!") + elif obj.mode == "OBJECT": + activeBone = obj.data.bones.active + if activeBone is not None: + camShotPointProp = activeBone.ootCamShotPointProp + camShotPointProp.draw_props(col) + elif obj.mode == "EDIT": + editBone = obj.data.edit_bones.active + if editBone is not None: + camShotPointProp = editBone.ootCamShotPointProp + camShotPointProp.draw_props(col) classes = (OOT_CSMotionCameraShotPanel,) diff --git a/fast64_internal/oot/cutscene/motion/properties.py b/fast64_internal/oot/cutscene/motion/properties.py index d18a48282..6b903e868 100644 --- a/fast64_internal/oot/cutscene/motion/properties.py +++ b/fast64_internal/oot/cutscene/motion/properties.py @@ -156,14 +156,13 @@ def getEndFrame(self, camShotObj: Object = None): return self.shotStartFrame + max(2, sum(frame for frame in boneFrameList)) + 1 return -1 - def draw_props(self, layout: UILayout, label: str): - box = layout.box() - box.label(text=label) - split = box.split(factor=0.5) + def draw_props(self, layout: UILayout): + col = layout.column() + split = col.split(factor=0.5) split.prop(self, "shotStartFrame") split.prop(self, "shotEndFrame") - box.row().prop(self, "shotCamMode", expand=True) - box.operator(CutsceneCmdAddBone.bl_idname) + col.row().prop(self, "shotCamMode", expand=True) + col.operator(CutsceneCmdAddBone.bl_idname) class CutsceneCmdCameraShotPointProperty(PropertyGroup): @@ -223,9 +222,9 @@ def setValue(self, value, propName: str): activeObj.data.bones.active = bone def draw_props(self, layout: UILayout): - box = layout.box() - box.label(text="Bone / Key point:") - row = box.row() + col = layout.column() + col.label(text="Bone / Key point:") + row = col.row() for propName in ["shotPointFrame", "shotPointViewAngle", "shotPointRoll"]: row.prop(self, propName) diff --git a/fast64_internal/oot/f3d/panels.py b/fast64_internal/oot/f3d/panels.py index 94cb0242e..875a35a0e 100644 --- a/fast64_internal/oot/f3d/panels.py +++ b/fast64_internal/oot/f3d/panels.py @@ -13,12 +13,12 @@ class OOT_DisplayListPanel(Panel): - bl_label = "Display List Inspector" + bl_label = "OOT Display List Inspector" bl_idname = "OBJECT_PT_OOT_DL_Inspector" + bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -27,20 +27,19 @@ def poll(cls, context): ) def draw(self, context): - box = self.layout.box().column() - box.box().label(text="OOT DL Inspector") + col = self.layout.column() obj = context.object # prop_split(box, obj, "ootDrawLayer", "Draw Layer") - box.prop(obj, "ignore_render") - box.prop(obj, "ignore_collision") + col.prop(obj, "ignore_render") + col.prop(obj, "ignore_collision") if bpy.context.scene.f3d_type == "F3DEX3": - box.prop(obj, "is_occlusion_planes") + col.prop(obj, "is_occlusion_planes") if obj.is_occlusion_planes and (not obj.ignore_render or not obj.ignore_collision): - box.label(icon="INFO", text="Suggest Ignore Render & Ignore Collision.") + col.label(icon="INFO", text="Suggest Ignore Render & Ignore Collision.") if not (obj.parent is not None and isinstance(obj.parent.data, Armature)): - actorScaleBox = box.box().column() + actorScaleBox = col.box().column() prop_split(actorScaleBox, obj, "ootActorScale", "Actor Scale") actorScaleBox.label(text="This applies to actor exports only.", icon="INFO") @@ -49,12 +48,12 @@ def draw(self, context): class OOT_MaterialPanel(Panel): - bl_label = "OOT Material" + bl_label = "OOT Dynamic Material Properties" bl_idname = "MATERIAL_PT_OOT_Material_Inspector" + bl_parent_id = "EEVEE_MATERIAL_PT_context_material" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -78,16 +77,15 @@ def draw(self, context): drawLayer = mat.f3d_mat.draw_layer.oot dynMatProps: OOTDynamicMaterialProperty = mat.ootMaterial - dynMatProps.draw_props(col.box().column(), mat, drawLayer) + dynMatProps.draw_props(col, mat, drawLayer) class OOT_DrawLayersPanel(Panel): - bl_label = "OOT Draw Layers" + bl_label = "OOT Default Render Modes" bl_idname = "WORLD_PT_OOT_Draw_Layers_Panel" + bl_parent_id = "EEVEE_MATERIAL_PT_context_material" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" - bl_context = "world" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): diff --git a/fast64_internal/oot/f3d/properties.py b/fast64_internal/oot/f3d/properties.py index 747674608..99e61b8e8 100644 --- a/fast64_internal/oot/f3d/properties.py +++ b/fast64_internal/oot/f3d/properties.py @@ -137,7 +137,7 @@ def draw_props(self, layout: UILayout, mat: Object, drawLayer: str): return suffix = "(" + drawLayerSuffix[drawLayer] + ")" - layout.box().column().label(text="OOT Dynamic Material Properties " + suffix) + layout.label(text=drawLayerSuffix[drawLayer] + " Draw Layer", icon="INFO") layout.label(text="See gSPSegment calls in z_scene_table.c.") layout.label(text="Based off draw config index in gSceneTable.") dynMatLayerProp: OOTDynamicMaterialDrawLayerProperty = getattr(self, drawLayer.lower()) @@ -148,7 +148,6 @@ def draw_props(self, layout: UILayout, mat: Object, drawLayer: str): class OOTDefaultRenderModesProperty(PropertyGroup): - expandTab: BoolProperty() opaqueCycle1: StringProperty(default="G_RM_AA_ZB_OPA_SURF") opaqueCycle2: StringProperty(default="G_RM_AA_ZB_OPA_SURF2") transparentCycle1: StringProperty(default="G_RM_AA_ZB_XLU_SURF") @@ -158,19 +157,12 @@ class OOTDefaultRenderModesProperty(PropertyGroup): def draw_props(self, layout: UILayout): inputGroup = layout.column() - inputGroup.prop( - self, - "expandTab", - text="Default Render Modes", - icon="TRIA_DOWN" if self.expandTab else "TRIA_RIGHT", - ) - if self.expandTab: - prop_split(inputGroup, self, "opaqueCycle1", "Opaque Cycle 1") - prop_split(inputGroup, self, "opaqueCycle2", "Opaque Cycle 2") - prop_split(inputGroup, self, "transparentCycle1", "Transparent Cycle 1") - prop_split(inputGroup, self, "transparentCycle2", "Transparent Cycle 2") - prop_split(inputGroup, self, "overlayCycle1", "Overlay Cycle 1") - prop_split(inputGroup, self, "overlayCycle2", "Overlay Cycle 2") + prop_split(inputGroup, self, "opaqueCycle1", "Opaque Cycle 1") + prop_split(inputGroup, self, "opaqueCycle2", "Opaque Cycle 2") + prop_split(inputGroup, self, "transparentCycle1", "Transparent Cycle 1") + prop_split(inputGroup, self, "transparentCycle2", "Transparent Cycle 2") + prop_split(inputGroup, self, "overlayCycle1", "Overlay Cycle 1") + prop_split(inputGroup, self, "overlayCycle2", "Overlay Cycle 2") oot_dl_writer_classes = ( diff --git a/fast64_internal/oot/props_panel_main.py b/fast64_internal/oot/props_panel_main.py index 11fdb9900..888b91f67 100644 --- a/fast64_internal/oot/props_panel_main.py +++ b/fast64_internal/oot/props_panel_main.py @@ -108,12 +108,12 @@ def execute(self, context): class OOTObjectPanel(bpy.types.Panel): - bl_label = "Object Inspector" + bl_label = "OOT Object Inspector" bl_idname = "OBJECT_PT_OOT_Object_Inspector" + bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -121,11 +121,10 @@ def poll(cls, context): def draw(self, context): prop_split(self.layout, context.scene, "gameEditorMode", "Game") - box = self.layout.box() - box.box().label(text="OOT Object Inspector") + col = self.layout.column() obj = context.object objName = obj.name - prop_split(box, obj, "ootEmptyType", "Object Type") + prop_split(col, obj, "ootEmptyType", "Object Type") sceneObj = getSceneObj(obj) roomObj = getRoomObj(obj) @@ -135,40 +134,40 @@ def draw(self, context): if obj.ootEmptyType == "Actor": actorProp: OOTActorProperty = obj.ootActorProperty - actorProp.draw_props(box, altRoomProp, objName) + actorProp.draw_props(col, altRoomProp, objName) elif obj.ootEmptyType == "Transition Actor": transActorProp: OOTTransitionActorProperty = obj.ootTransitionActorProperty - transActorProp.draw_props(box, altSceneProp, roomObj, objName) + transActorProp.draw_props(col, altSceneProp, roomObj, objName) elif obj.ootEmptyType == "Water Box": waterBoxProps: OOTWaterBoxProperty = obj.ootWaterBoxProperty - waterBoxProps.draw_props(box) + waterBoxProps.draw_props(col) elif obj.ootEmptyType == "Scene": - drawSceneHeader(box, obj) + drawSceneHeader(col, obj) elif obj.ootEmptyType == "Room": roomProp: OOTRoomHeaderProperty = obj.ootRoomHeader - roomProp.draw_props(box, None, None, objName) + roomProp.draw_props(col, None, None, objName) if obj.ootRoomHeader.menuTab == "Alternate": roomAltProp: OOTAlternateRoomHeaderProperty = obj.ootAlternateRoomHeaders - roomAltProp.draw_props(box, objName) + roomAltProp.draw_props(col, objName) elif obj.ootEmptyType == "Entrance": entranceProp: OOTEntranceProperty = obj.ootEntranceProperty - entranceProp.draw_props(box, obj, altSceneProp, objName) + entranceProp.draw_props(col, obj, altSceneProp, objName) elif obj.ootEmptyType == "Cull Group": cullGroupProp: OOTCullGroupProperty = obj.ootCullGroupProperty - cullGroupProp.draw_props(box) + cullGroupProp.draw_props(col) elif obj.ootEmptyType == "LOD": - drawLODProperty(box, obj) + drawLODProperty(col, obj) elif obj.ootEmptyType == "Cutscene": csProp: OOTCutsceneProperty = obj.ootCutsceneProperty - csProp.draw_props(box, obj) + csProp.draw_props(col, obj) elif obj.ootEmptyType in [ "CS Actor Cue List", @@ -178,15 +177,15 @@ def draw(self, context): ]: labelPrefix = "Player" if "Player" in obj.ootEmptyType else "Actor" actorCueListProp: CutsceneCmdActorCueListProperty = obj.ootCSMotionProperty.actorCueListProp - actorCueListProp.draw_props(box, obj.ootEmptyType == f"CS {labelPrefix} Cue Preview", labelPrefix, obj.name) + actorCueListProp.draw_props(col, obj.ootEmptyType == f"CS {labelPrefix} Cue Preview", labelPrefix, obj.name) elif obj.ootEmptyType in ["CS Actor Cue", "CS Player Cue", "CS Dummy Cue"]: labelPrefix = "Player" if obj.parent.ootEmptyType == "CS Player Cue List" else "Actor" actorCueProp: CutsceneCmdActorCueProperty = obj.ootCSMotionProperty.actorCueProp - actorCueProp.draw_props(box, labelPrefix, obj.ootEmptyType == "CS Dummy Cue", obj.name) + actorCueProp.draw_props(col, labelPrefix, obj.ootEmptyType == "CS Dummy Cue", obj.name) elif obj.ootEmptyType == "None": - box.label(text="Geometry can be parented to this.") + col.label(text="Geometry can be parented to this.") class OOT_ObjectProperties(bpy.types.PropertyGroup): diff --git a/fast64_internal/oot/skeleton/panels.py b/fast64_internal/oot/skeleton/panels.py index f598e7b2e..37aabfe28 100644 --- a/fast64_internal/oot/skeleton/panels.py +++ b/fast64_internal/oot/skeleton/panels.py @@ -8,11 +8,11 @@ class OOT_SkeletonPanel(Panel): bl_idname = "OOT_PT_skeleton" + bl_parent_id = "OBJECT_PT_context_object" bl_label = "OOT Skeleton Properties" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -25,8 +25,7 @@ def poll(cls, context): # called every frame def draw(self, context): - col = self.layout.box().column() - col.box().label(text="OOT Skeleton Inspector") + col = self.layout.column() prop_split(col, context.object, "ootDrawLayer", "Draw Layer") context.object.ootSkeleton.draw_props(col) @@ -35,11 +34,11 @@ def draw(self, context): class OOT_BonePanel(Panel): bl_idname = "OOT_PT_bone" + bl_parent_id = "BONE_PT_context_bone" bl_label = "OOT Bone Properties" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "bone" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -47,8 +46,7 @@ def poll(cls, context): # called every frame def draw(self, context): - col = self.layout.box().column() - col.box().label(text="OOT Bone Inspector") + col = self.layout.column() context.bone.ootBone.draw_props(col) diff --git a/fast64_internal/oot/spline/panels.py b/fast64_internal/oot/spline/panels.py index e899b3075..70c263bcc 100644 --- a/fast64_internal/oot/spline/panels.py +++ b/fast64_internal/oot/spline/panels.py @@ -9,10 +9,10 @@ class OOTSplinePanel(Panel): bl_label = "Spline Inspector" bl_idname = "OBJECT_PT_OOT_Spline_Inspector" + bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -21,16 +21,15 @@ def poll(cls, context): ) def draw(self, context): - box = self.layout.box().column() - box.box().label(text="OOT Spline Inspector") + col = self.layout.column() curve = context.object.data if curve.splines[0].type != "NURBS": - box.label(text="Only NURBS curves are compatible.") + col.label(text="Only NURBS curves are compatible.") else: sceneObj = getSceneObj(context.object) altSceneProp = sceneObj.ootAlternateSceneHeaders if sceneObj is not None else None splineProp: OOTSplineProperty = context.object.ootSplineProperty - splineProp.draw_props(box, altSceneProp, context.object.name) + splineProp.draw_props(col, altSceneProp, context.object.name) oot_spline_panel_classes = (OOTSplinePanel,) diff --git a/fast64_internal/sm64/sm64_camera.py b/fast64_internal/sm64/sm64_camera.py index 2fdab9f0f..a0f56d5bb 100644 --- a/fast64_internal/sm64/sm64_camera.py +++ b/fast64_internal/sm64/sm64_camera.py @@ -43,12 +43,12 @@ class CameraSettingsPanel(bpy.types.Panel): - bl_label = "Camera Settings" + bl_label = "SM64 Camera Settings" bl_idname = "Camera_Inspector" + bl_parent_id = "DATA_PT_context_camera" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "data" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): diff --git a/fast64_internal/sm64/sm64_collision.py b/fast64_internal/sm64/sm64_collision.py index b79e1aedf..6d6a7ad5b 100644 --- a/fast64_internal/sm64/sm64_collision.py +++ b/fast64_internal/sm64/sm64_collision.py @@ -196,12 +196,12 @@ def to_binary(self): class SM64CollisionPanel(bpy.types.Panel): - bl_label = "Collision Inspector" + bl_label = "SM64 Collision Inspector" bl_idname = "MATERIAL_PT_SM64_Collision_Inspector" + bl_parent_id = "EEVEE_MATERIAL_PT_context_material" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -215,32 +215,32 @@ def paramInfo(self, layout): box.label(text="Second byte is a rotation value.") def draw(self, context): - box = self.layout.box() + col = self.layout.column() # box.label(text = 'Collision Inspector') material = context.material if not material.collision_all_options: - prop_split(box, material, "collision_type_simple", "SM64 Collision Type") + prop_split(col, material, "collision_type_simple", "SM64 Collision Type") if material.collision_type_simple == "Custom": - prop_split(box, material, "collision_custom", "Collision Value") + prop_split(col, material, "collision_custom", "Collision Value") # if material.collision_type_simple in specialSurfaces: # prop_split(box, material, 'collision_param', 'Parameter') # self.paramInfo(box) else: - prop_split(box, material, "collision_type", "SM64 Collision Type All") + prop_split(col, material, "collision_type", "SM64 Collision Type All") if material.collision_type == "Custom": - prop_split(box, material, "collision_custom", "Collision Value") + prop_split(col, material, "collision_custom", "Collision Value") # if material.collision_type in specialSurfaces: # prop_split(box, material, 'collision_param', 'Parameter') # self.paramInfo(box) - split = box.split(factor=0.5) + split = col.split(factor=0.5) split.label(text="") split.prop(material, "collision_all_options") - box.prop(material, "use_collision_param") + col.prop(material, "use_collision_param") if material.use_collision_param: - prop_split(box, material, "collision_param", "Parameter") - self.paramInfo(box) + prop_split(col, material, "collision_param", "Parameter") + self.paramInfo(col) # infoBox = box.box() # infoBox.label(text = \ diff --git a/fast64_internal/sm64/sm64_f3d_writer.py b/fast64_internal/sm64/sm64_f3d_writer.py index 059e40815..c4c2d8d25 100644 --- a/fast64_internal/sm64/sm64_f3d_writer.py +++ b/fast64_internal/sm64/sm64_f3d_writer.py @@ -860,10 +860,10 @@ def draw(self, context): class SM64_DrawLayersPanel(bpy.types.Panel): bl_label = "SM64 Draw Layers" bl_idname = "WORLD_PT_SM64_Draw_Layers_Panel" + bl_parent_id = "WORLD_PT_context_world" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "world" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -874,18 +874,13 @@ def draw(self, context): layout = self.layout inputGroup = layout.column() - inputGroup.prop( - world, "menu_layers", text="Draw Layers", icon="TRIA_DOWN" if world.menu_layers else "TRIA_RIGHT" - ) - if world.menu_layers: - for i in range(8): - drawLayerUI(inputGroup, i, world) + for i in range(8): + drawLayerUI(inputGroup, i, world) def drawLayerUI(layout, drawLayer, world): - box = layout.box() - box.label(text="Layer " + str(drawLayer)) - row = box.row() + layout.label(text="Layer " + str(drawLayer)) + row = layout.row() row.prop(world, "draw_layer_" + str(drawLayer) + "_cycle_1", text="") row.prop(world, "draw_layer_" + str(drawLayer) + "_cycle_2", text="") @@ -893,10 +888,10 @@ def drawLayerUI(layout, drawLayer, world): class SM64_MaterialPanel(bpy.types.Panel): bl_label = "SM64 Material" bl_idname = "MATERIAL_PT_SM64_Material_Inspector" + bl_parent_id = "EEVEE_MATERIAL_PT_context_material" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): diff --git a/fast64_internal/sm64/sm64_geolayout_bone.py b/fast64_internal/sm64/sm64_geolayout_bone.py index 20c7f1ddc..39c227bd0 100644 --- a/fast64_internal/sm64/sm64_geolayout_bone.py +++ b/fast64_internal/sm64/sm64_geolayout_bone.py @@ -82,7 +82,6 @@ def drawGeoInfo(panel: Panel, bone: Bone): - panel.layout.box().label(text="Geolayout Inspector") if bone is None: panel.layout.label(text="Edit geolayout properties in Pose mode.") return @@ -158,10 +157,10 @@ def drawGeoInfo(panel: Panel, bone: Bone): class GeolayoutBonePanel(Panel): bl_label = "Geolayout Inspector" bl_idname = "BONE_PT_SM64_Geolayout_Inspector" + bl_parent_id = "BONE_PT_context_bone" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "bone" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -172,12 +171,12 @@ def draw(self, context): class GeolayoutArmaturePanel(Panel): - bl_label = "Geolayout Armature Inspector" + bl_label = "SM64 Geolayout Armature Inspector" bl_idname = "OBJECT_PT_SM64_Armature_Geolayout_Inspector" + bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -189,8 +188,7 @@ def poll(cls, context): def draw(self, context): obj = context.object - col = self.layout.column().box() - col.box().label(text="Armature Geolayout Inspector") + col = self.layout.column() col.prop(obj, "use_render_area") if obj.use_render_area: @@ -206,12 +204,12 @@ def drawLayerWarningBox(layout, prop, data): class GeolayoutObjectPanel(Panel): - bl_label = "Object Geolayout Inspector" - bl_idname = "OBJECT_PT_SM64_Object_Geolayout_Inspector" + bl_label = "SM64 Object Geolayout" + bl_idname = "OBJECT_PT_SM64_Geolayout" + bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -223,8 +221,7 @@ def poll(cls, context): def draw(self, context): obj = context.object - col = self.layout.column().box() - col.box().label(text="Object Geolayout Inspector") + col = self.layout.column() prop_split(col, obj, "geo_cmd_static", "Geolayout Command") drawLayerWarningBox(col, obj, "draw_layer_static") diff --git a/fast64_internal/sm64/sm64_objects.py b/fast64_internal/sm64/sm64_objects.py index 83591a7e9..b41776f91 100644 --- a/fast64_internal/sm64/sm64_objects.py +++ b/fast64_internal/sm64/sm64_objects.py @@ -1084,12 +1084,12 @@ def invoke(self, context, event): class SM64ObjectPanel(bpy.types.Panel): - bl_label = "Object Inspector" + bl_label = "SM64 Object Inspector" bl_idname = "OBJECT_PT_SM64_Object_Inspector" + bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -1187,114 +1187,112 @@ def draw_behavior_params(self, obj: bpy.types.Object, parent_box: bpy.types.UILa def draw(self, context): prop_split(self.layout, context.scene, "gameEditorMode", "Game") - box = self.layout.box().column() - column = self.layout.box().column() # added just for puppycam trigger importing - box.box().label(text="SM64 Object Inspector") + col = self.layout.column() obj = context.object - prop_split(box, obj, "sm64_obj_type", "Object Type") + prop_split(col, obj, "sm64_obj_type", "Object Type") if obj.sm64_obj_type == "Object": - prop_split(box, obj, "sm64_model_enum", "Model") + prop_split(col, obj, "sm64_model_enum", "Model") if obj.sm64_model_enum == "Custom": - prop_split(box, obj, "sm64_obj_model", "Model ID") - box.operator(SearchModelIDEnumOperator.bl_idname, icon="VIEWZOOM") - box.box().label(text="Model IDs defined in include/model_ids.h.") - prop_split(box, obj, "sm64_behaviour_enum", "Behaviour") + prop_split(col, obj, "sm64_obj_model", "Model ID") + col.operator(SearchModelIDEnumOperator.bl_idname, icon="VIEWZOOM") + col.box().label(text="Model IDs defined in include/model_ids.h.") + prop_split(col, obj, "sm64_behaviour_enum", "Behaviour") if obj.sm64_behaviour_enum == "Custom": - prop_split(box, obj, "sm64_obj_behaviour", "Behaviour Name") - box.operator(SearchBehaviourEnumOperator.bl_idname, icon="VIEWZOOM") - behaviourLabel = box.box() + prop_split(col, obj, "sm64_obj_behaviour", "Behaviour Name") + col.operator(SearchBehaviourEnumOperator.bl_idname, icon="VIEWZOOM") + behaviourLabel = col.box() behaviourLabel.label(text="Behaviours defined in include/behaviour_data.h.") behaviourLabel.label(text="Actual contents in data/behaviour_data.c.") - self.draw_behavior_params(obj, box) - self.draw_acts(obj, box) + self.draw_behavior_params(obj, col) + self.draw_acts(obj, col) elif obj.sm64_obj_type == "Macro": - prop_split(box, obj, "sm64_macro_enum", "Preset") + prop_split(col, obj, "sm64_macro_enum", "Preset") if obj.sm64_macro_enum == "Custom": - prop_split(box, obj, "sm64_obj_preset", "Preset Name") - box.operator(SearchMacroEnumOperator.bl_idname, icon="VIEWZOOM") - box.box().label(text="Macro presets defined in include/macro_preset_names.h.") - box.prop(obj, "sm64_obj_set_bparam", text="Set Behaviour Parameter") + prop_split(col, obj, "sm64_obj_preset", "Preset Name") + col.operator(SearchMacroEnumOperator.bl_idname, icon="VIEWZOOM") + col.box().label(text="Macro presets defined in include/macro_preset_names.h.") + col.prop(obj, "sm64_obj_set_bparam", text="Set Behaviour Parameter") if obj.sm64_obj_set_bparam: - self.draw_behavior_params(obj, box) + self.draw_behavior_params(obj, col) elif obj.sm64_obj_type == "Special": - prop_split(box, obj, "sm64_special_enum", "Preset") + prop_split(col, obj, "sm64_special_enum", "Preset") if obj.sm64_special_enum == "Custom": - prop_split(box, obj, "sm64_obj_preset", "Preset Name") - box.operator(SearchSpecialEnumOperator.bl_idname, icon="VIEWZOOM") - box.box().label(text="Special presets defined in include/special_preset_names.h.") - box.prop(obj, "sm64_obj_set_yaw", text="Set Yaw") + prop_split(col, obj, "sm64_obj_preset", "Preset Name") + col.operator(SearchSpecialEnumOperator.bl_idname, icon="VIEWZOOM") + col.box().label(text="Special presets defined in include/special_preset_names.h.") + col.prop(obj, "sm64_obj_set_yaw", text="Set Yaw") if obj.sm64_obj_set_yaw: - box.prop(obj, "sm64_obj_set_bparam", text="Set Behaviour Parameter") + col.prop(obj, "sm64_obj_set_bparam", text="Set Behaviour Parameter") if obj.sm64_obj_set_bparam: - self.draw_behavior_params(obj, box) + self.draw_behavior_params(obj, col) elif obj.sm64_obj_type == "Mario Start": - prop_split(box, obj, "sm64_obj_mario_start_area", "Area") + prop_split(col, obj, "sm64_obj_mario_start_area", "Area") elif obj.sm64_obj_type == "Trajectory": 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(col, obj, "whirpool_index", "Index") + prop_split(col, obj, "whirpool_condition", "Condition") + prop_split(col, obj, "whirpool_strength", "Strength") pass - elif obj.sm64_obj_type == "Water Box": - prop_split(box, obj, "waterBoxType", "Water Box Type") - box.box().label(text="Water box area defined by top face of box shaped empty.") - box.box().label(text="No rotation allowed.") + elif obj.sm64_obj_type == "Water col": + prop_split(col, obj, "watercolType", "Water col Type") + col.box().label(text="Water col area defined by top face of col shaped empty.") + col.box().label(text="No rotation allowed.") elif obj.sm64_obj_type == "Level Root": levelObj = obj.fast64.sm64.level if obj.useBackgroundColor: - prop_split(box, obj, "backgroundColor", "Background Color") - box.prop(obj, "useBackgroundColor") + prop_split(col, obj, "backgroundColor", "Background Color") + col.prop(obj, "useBackgroundColor") else: - # prop_split(box, obj, 'backgroundID', 'Background ID') - prop_split(box, obj, "background", "Background") + # prop_split(col, obj, 'backgroundID', 'Background ID') + prop_split(col, obj, "background", "Background") if obj.background == "CUSTOM": - prop_split(box, levelObj, "backgroundID", "Custom ID") - prop_split(box, levelObj, "backgroundSegment", "Custom Background Segment") - segmentExportBox = box.box() - segmentExportBox.label( + prop_split(col, levelObj, "backgroundID", "Custom ID") + prop_split(col, levelObj, "backgroundSegment", "Custom Background Segment") + segmentExportcol = col.box() + segmentExportcol.label( text=f"Exported Segment: _{levelObj.backgroundSegment}_{context.scene.compressionFormat}SegmentRomStart" ) - box.prop(obj, "useBackgroundColor") - # box.box().label(text = 'Background IDs defined in include/geo_commands.h.') - box.prop(obj, "actSelectorIgnore") - box.prop(obj, "setAsStartLevel") - grid = box.grid_flow(columns=2) + col.prop(obj, "useBackgroundColor") + # col.box().label(text = 'Background IDs defined in include/geo_commands.h.') + col.prop(obj, "actSelectorIgnore") + col.prop(obj, "setAsStartLevel") + grid = col.grid_flow(columns=2) obj.fast64.sm64.segment_loads.draw(grid) - prop_split(box, obj, "acousticReach", "Acoustic Reach") - obj.starGetCutscenes.draw(box) + prop_split(col, obj, "acousticReach", "Acoustic Reach") + obj.starGetCutscenes.draw(col) elif obj.sm64_obj_type == "Area Root": # Code that used to be in area inspector - prop_split(box, obj, "areaIndex", "Area Index") - box.prop(obj, "noMusic", text="Disable Music") + prop_split(col, obj, "areaIndex", "Area Index") + col.prop(obj, "noMusic", text="Disable Music") if not obj.noMusic: - prop_split(box, obj, "music_preset", "Music Preset") - prop_split(box, obj, "musicSeqEnum", "Music Sequence") + prop_split(col, obj, "music_preset", "Music Preset") + prop_split(col, obj, "musicSeqEnum", "Music Sequence") if obj.musicSeqEnum == "Custom": - prop_split(box, obj, "music_seq", "") + prop_split(col, obj, "music_seq", "") - prop_split(box, obj, "terrainEnum", "Terrain") + prop_split(col, obj, "terrainEnum", "Terrain") if obj.terrainEnum == "Custom": - prop_split(box, obj, "terrain_type", "") - prop_split(box, obj, "envOption", "Environment Type") + prop_split(col, obj, "terrain_type", "") + prop_split(col, obj, "envOption", "Environment Type") if obj.envOption == "Custom": - prop_split(box, obj, "envType", "") - prop_split(box, obj, "camOption", "Camera Type") + prop_split(col, obj, "envType", "") + prop_split(col, obj, "camOption", "Camera Type") if obj.camOption == "Custom": - prop_split(box, obj, "camType", "") - camBox = box.box() + prop_split(col, obj, "camType", "") + camBox = col.box() camBox.label(text="Warning: Camera modes can be overriden by area specific camera code.") camBox.label(text="Check the switch statment in camera_course_processing() in src/game/camera.c.") - fogBox = box.box() + fogBox = col.box() fogInfoBox = fogBox.box() fogInfoBox.label(text="Warning: Fog only applies to materials that:") fogInfoBox.label(text="- use fog") @@ -1303,28 +1301,28 @@ def draw(self, context): prop_split(fogBox, obj, "area_fog_position", "Area Fog Position") if obj.areaIndex == 1 or obj.areaIndex == 2 or obj.areaIndex == 3: - prop_split(box, obj, "echoLevel", "Echo Level") + prop_split(col, obj, "echoLevel", "Echo Level") if obj.areaIndex == 1 or obj.areaIndex == 2 or obj.areaIndex == 3 or obj.areaIndex == 4: - box.prop(obj, "zoomOutOnPause") + col.prop(obj, "zoomOutOnPause") - box.prop(obj.fast64.sm64.area, "disable_background") + col.prop(obj.fast64.sm64.area, "disable_background") - areaLayout = box.box() + areaLayout = col.box() areaLayout.enabled = not obj.fast64.sm64.area.disable_background areaLayout.prop(obj, "areaOverrideBG") if obj.areaOverrideBG: prop_split(areaLayout, obj, "areaBGColor", "Background Color") - box.prop(obj, "showStartDialog") + col.prop(obj, "showStartDialog") if obj.showStartDialog: - prop_split(box, obj, "startDialog", "Start Dialog") - dialogBox = box.box() + prop_split(col, obj, "startDialog", "Start Dialog") + dialogBox = col.box() dialogBox.label(text="See text/us/dialogs.h for values.") dialogBox.label(text="See load_level_init_text() in src/game/level_update.c for conditions.") - box.prop(obj, "enableRoomSwitch") + col.prop(obj, "enableRoomSwitch") if obj.enableRoomSwitch: - infoBox = box.box() + infoBox = col.box() infoBox.label( text="Every child hierarchy of the area root will be treated as its own room (except for the first one.)" ) @@ -1332,65 +1330,65 @@ def draw(self, context): text='You can use empties with the "None" type as empty geolayout nodes to group related geometry under.' ) infoBox.label(text="Children will ordered alphabetically, with the first child being always visible.") - box.prop(obj, "useDefaultScreenRect") + col.prop(obj, "useDefaultScreenRect") if not obj.useDefaultScreenRect: - prop_split(box, obj, "screenPos", "Screen Position") - prop_split(box, obj, "screenSize", "Screen Size") + prop_split(col, obj, "screenPos", "Screen Position") + prop_split(col, obj, "screenSize", "Screen Size") - prop_split(box, obj, "clipPlanes", "Clip Planes") + prop_split(col, obj, "clipPlanes", "Clip Planes") - box.label(text="Warp Nodes") - box.operator(AddWarpNode.bl_idname).option = len(obj.warpNodes) + col.label(text="Warp Nodes") + col.operator(AddWarpNode.bl_idname).option = len(obj.warpNodes) for i in range(len(obj.warpNodes)): - drawWarpNodeProperty(box, obj.warpNodes[i], i) + drawWarpNodeProperty(col, obj.warpNodes[i], i) elif obj.sm64_obj_type == "Camera Volume": - prop_split(box, obj, "cameraVolumeFunction", "Camera Function") - box.prop(obj, "cameraVolumeGlobal") - box.box().label(text="Only vertical axis rotation allowed.") + prop_split(col, obj, "cameraVolumeFunction", "Camera Function") + col.prop(obj, "cameraVolumeGlobal") + col.box().label(text="Only vertical axis rotation allowed.") elif obj.sm64_obj_type == "Puppycam Volume": puppycamProp = obj.puppycamProp - prop_split(column, puppycamProp, "puppycamVolumeFunction", "Puppycam Function") - column.prop(puppycamProp, "puppycamVolumePermaswap") - column.prop(puppycamProp, "puppycamUseFlags") + prop_split(col, puppycamProp, "puppycamVolumeFunction", "Puppycam Function") + col.prop(puppycamProp, "puppycamVolumePermaswap") + col.prop(puppycamProp, "puppycamUseFlags") - column.prop(puppycamProp, "puppycamUseEmptiesForPos") + col.prop(puppycamProp, "puppycamUseEmptiesForPos") if puppycamProp.puppycamUseEmptiesForPos: - column.label(text="Fixed Camera Position (Optional)") - column.prop_search(puppycamProp, "puppycamCamPos", bpy.data, "objects", text="") + col.label(text="Fixed Camera Position (Optional)") + col.prop_search(puppycamProp, "puppycamCamPos", bpy.data, "objects", text="") - column.label(text="Fixed Camera Focus (Optional)") - column.prop_search(puppycamProp, "puppycamCamFocus", bpy.data, "objects", text="") + col.label(text="Fixed Camera Focus (Optional)") + col.prop_search(puppycamProp, "puppycamCamFocus", bpy.data, "objects", text="") else: - column.label(text="Fixed Camera Position (Optional)") - column.prop(puppycamProp, "puppycamCamera") + col.label(text="Fixed Camera Position (Optional)") + col.prop(puppycamProp, "puppycamCamera") if puppycamProp.puppycamCamera is not None: - column.box().label(text="FOV not exported, only for preview camera.") - prop_split(column, puppycamProp, "puppycamFOV", "Camera FOV") - column.operator("mesh.puppycam_setup_camera", text="Setup Camera", icon="VIEW_CAMERA") + col.box().label(text="FOV not exported, only for preview camera.") + prop_split(col, puppycamProp, "puppycamFOV", "Camera FOV") + col.operator("mesh.puppycam_setup_camera", text="Setup Camera", icon="VIEW_CAMERA") if puppycamProp.puppycamUseFlags: for i, flagSet in enumerate(enumPuppycamFlags): - column.prop(puppycamProp, flagSet[0]) + col.prop(puppycamProp, flagSet[0]) else: - prop_split(column, puppycamProp, "puppycamMode", "Camera Mode") + prop_split(col, puppycamProp, "puppycamMode", "Camera Mode") if puppycamProp.puppycamMode == "Custom": - prop_split(column, puppycamProp, "puppycamType", "") + prop_split(col, puppycamProp, "puppycamType", "") - column.box().label(text="No rotation allowed.") + col.box().label(text="No rotation allowed.") elif obj.sm64_obj_type == "Switch": - prop_split(box, obj, "switchFunc", "Function") - prop_split(box, obj, "switchParam", "Parameter") - box.box().label(text="Children will ordered alphabetically.") + prop_split(col, obj, "switchFunc", "Function") + prop_split(col, obj, "switchParam", "Parameter") + col.box().label(text="Children will ordered alphabetically.") elif obj.sm64_obj_type in inlineGeoLayoutObjects: - self.draw_inline_obj(box, obj) + self.draw_inline_obj(col, obj) elif obj.sm64_obj_type == "None": - box.box().label(text="This can be used as an empty transform node in a geolayout hierarchy.") + col.box().label(text="This can be used as an empty transform node in a geolayout hierarchy.") def draw_acts(self, obj, layout): layout.label(text="Acts") diff --git a/fast64_internal/sm64/sm64_spline.py b/fast64_internal/sm64/sm64_spline.py index 334edd7f3..a77aeb4f2 100644 --- a/fast64_internal/sm64/sm64_spline.py +++ b/fast64_internal/sm64/sm64_spline.py @@ -121,10 +121,10 @@ def execute(self, context): class SM64SplinePanel(bpy.types.Panel): bl_label = "Spline Inspector" bl_idname = "OBJECT_PT_SM64_Spline_Inspector" + bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -133,18 +133,17 @@ def poll(cls, context): ) def draw(self, context): - box = self.layout.box() - box.box().label(text="SM64 Spline Inspector") + col = self.layout.column() curve = context.object.data if curve.splines[0].type != "NURBS": - box.label(text="Only NURBS curves are compatible.") + col.label(text="Only NURBS curves are compatible.") else: - prop_split(box, curve, "sm64_spline_type", "Spline Type") + prop_split(col, curve, "sm64_spline_type", "Spline Type") if curve.sm64_spline_type == "Cutscene" or curve.sm64_spline_type == "Vector": pointIndex = 0 for point in curve.splines.active.points: if point.select: - prop_split(box.box(), point, "radius", "Point " + str(pointIndex) + " Speed") + prop_split(col.box(), point, "radius", "Point " + str(pointIndex) + " Speed") pointIndex += 1 From d4d43f84823861f09fdaf895b52f43d51efb61c0 Mon Sep 17 00:00:00 2001 From: Lila Date: Mon, 26 May 2025 16:52:24 +0100 Subject: [PATCH 2/5] Clean up SM64 a bit --- fast64_internal/f3d/f3d_material.py | 26 +++++++------------ fast64_internal/oot/cutscene/motion/panels.py | 7 ++++- fast64_internal/sm64/__init__.py | 26 +++++++++++++++++++ fast64_internal/sm64/sm64_collision.py | 8 ++---- fast64_internal/sm64/sm64_f3d_writer.py | 24 +++++++---------- 5 files changed, 54 insertions(+), 37 deletions(-) diff --git a/fast64_internal/f3d/f3d_material.py b/fast64_internal/f3d/f3d_material.py index a2cb334f4..4f0613f34 100644 --- a/fast64_internal/f3d/f3d_material.py +++ b/fast64_internal/f3d/f3d_material.py @@ -618,8 +618,8 @@ def tmemUsageUI(layout, textureProp): # cycle type = 1 cycle class F3DPanel(Panel): bl_label = "F3D Material" - bl_idname = "MATERIAL_PT_F3D_Inspector" bl_parent_id = "EEVEE_MATERIAL_PT_context_material" + bl_idname = "MATERIAL_PT_F3D_Inspector" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" @@ -941,7 +941,11 @@ def ui_misc(self, f3dMat: "F3DMaterialProperty", inputCol: UILayout, showCheckBo if f3dMat.set_attroffs_z: prop_split(inputGroup.row(), f3dMat, "attroffs_z", "Z Attr Offset") - if f3dMat.rdp_settings.using_fog: + if ( + f3dMat.rdp_settings.g_fog + or does_blender_use_color(f3dMat.rdp_settings, "G_BL_CLR_FOG") + or does_blender_use_alpha(f3dMat.rdp_settings, "G_BL_A_FOG") + ): if showCheckBox or f3dMat.set_fog: inputGroup = inputCol.column() if showCheckBox: @@ -1241,7 +1245,6 @@ def draw(self, context): f3dMat = material.f3d_mat settings = f3dMat.rdp_settings layout.prop(context.scene, "f3d_simple", text="Show Simplified UI") - layout = layout.box() presetCol = layout.column() split = presetCol.split(factor=0.33) @@ -1281,14 +1284,7 @@ def ui_tileScroll(tex, name, layout): row.prop(tex.tile_scroll, "interval", text="Interval:") -def ui_procAnimVecEnum(material, procAnimVec, layout, name, vecType, useDropdown, useTex0, useTex1): - layout = layout.box() - box = layout.column() - if useDropdown: - layout.prop(procAnimVec, "menu", text=name, icon="TRIA_DOWN" if procAnimVec.menu else "TRIA_RIGHT") - else: - layout.box().label(text=name) - +def ui_procAnimVecEnum(material, procAnimVec, layout, vecType, useDropdown, useTex0, useTex1): if not useDropdown or procAnimVec.menu: box = layout.column() combinedOption = None @@ -1311,8 +1307,6 @@ def ui_procAnimVecEnum(material, procAnimVec, layout, name, vecType, useDropdown pass if useTex0 or useTex1: - layout.box().label(text="SM64 SetTileSize Texture Scroll") - if useTex0: ui_tileScroll(material.tex0, "Texture 0 Speed", layout) @@ -1352,8 +1346,8 @@ def ui_procAnimField(procAnimField, layout, name): split2.prop(procAnimField, "noiseAmplitude") -def ui_procAnim(material, layout, useTex0, useTex1, title, useDropdown): - ui_procAnimVecEnum(material.f3d_mat, material.f3d_mat.UVanim0, layout, title, "UV", useDropdown, useTex0, useTex1) +def ui_procAnim(material, layout, useTex0, useTex1, useDropdown): + ui_procAnimVecEnum(material.f3d_mat, material.f3d_mat.UVanim0, layout, "UV", useDropdown, useTex0, useTex1) def update_node_values(self, context, update_preset): @@ -3375,7 +3369,6 @@ def key(self): class DefaultRDPSettingsPanel(Panel): bl_label = "RDP Default Settings" bl_idname = "WORLD_PT_RDP_Default_Inspector" - bl_parent_id = "WORLD_PT_context_world" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "world" @@ -3387,6 +3380,7 @@ def poll(cls, context): def draw(self, context): world = context.scene.world layout = self.layout + layout.box().label(text="RDP Default Settings") layout.label(text="If a material setting is a same as a default setting, then it won't be set.") ui_geo_mode(world.rdp_defaults, world, layout, True) ui_upper_mode(world.rdp_defaults, world, layout, True) diff --git a/fast64_internal/oot/cutscene/motion/panels.py b/fast64_internal/oot/cutscene/motion/panels.py index 5cfe1e773..697cc7a35 100644 --- a/fast64_internal/oot/cutscene/motion/panels.py +++ b/fast64_internal/oot/cutscene/motion/panels.py @@ -13,7 +13,12 @@ class OOT_CSMotionCameraShotPanel(OOT_Panel): @classmethod def poll(cls, context): - return context.scene.gameEditorMode == "OOT" and context.view_layer.objects.active is not None and context.view_layer.objects.active.type == "ARMATURE" + return ( + context.scene.gameEditorMode == "OOT" + and context.view_layer.objects.active is not None + and context.view_layer.objects.active.type == "ARMATURE" + ) + def draw(self, context): obj = context.view_layer.objects.active col = self.layout.column() diff --git a/fast64_internal/sm64/__init__.py b/fast64_internal/sm64/__init__.py index 20daf5589..7260ef686 100644 --- a/fast64_internal/sm64/__init__.py +++ b/fast64_internal/sm64/__init__.py @@ -1,3 +1,6 @@ +from bpy.utils import register_class, unregister_class +from bpy.types import Panel + from .settings import ( settings_props_register, settings_props_unregister, @@ -90,7 +93,28 @@ ) +class SM64_MaterialPanel(Panel): + bl_label = "SM64 Material" + bl_idname = "MATERIAL_PT_SM64_Material_Inspector" + bl_parent_id = "EEVEE_MATERIAL_PT_context_material" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "material" + + @classmethod + def poll(cls, context): + return context.material is not None and context.material.is_f3d and context.scene.gameEditorMode == "SM64" + + def draw(self, context): + pass + + +panels = (SM64_MaterialPanel,) + + def sm64_panel_register(): + for panel in panels: + register_class(panel) settings_panels_register() tools_panels_register() sm64_col_panel_register() @@ -107,6 +131,8 @@ def sm64_panel_register(): def sm64_panel_unregister(): + for panel in panels: + unregister_class(panel) settings_panels_unregister() tools_panels_unregister() sm64_col_panel_unregister() diff --git a/fast64_internal/sm64/sm64_collision.py b/fast64_internal/sm64/sm64_collision.py index 6d6a7ad5b..e59f20ae4 100644 --- a/fast64_internal/sm64/sm64_collision.py +++ b/fast64_internal/sm64/sm64_collision.py @@ -196,17 +196,13 @@ def to_binary(self): class SM64CollisionPanel(bpy.types.Panel): - bl_label = "SM64 Collision Inspector" + bl_label = "Collision" bl_idname = "MATERIAL_PT_SM64_Collision_Inspector" - bl_parent_id = "EEVEE_MATERIAL_PT_context_material" + bl_parent_id = "MATERIAL_PT_SM64_Material_Inspector" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" - @classmethod - def poll(cls, context): - return context.scene.gameEditorMode == "SM64" and context.material is not None - def paramInfo(self, layout): box = layout.box() box.label(text="Parameter is two bytes.") diff --git a/fast64_internal/sm64/sm64_f3d_writer.py b/fast64_internal/sm64/sm64_f3d_writer.py index c4c2d8d25..b196f328c 100644 --- a/fast64_internal/sm64/sm64_f3d_writer.py +++ b/fast64_internal/sm64/sm64_f3d_writer.py @@ -885,31 +885,27 @@ def drawLayerUI(layout, drawLayer, world): row.prop(world, "draw_layer_" + str(drawLayer) + "_cycle_2", text="") -class SM64_MaterialPanel(bpy.types.Panel): - bl_label = "SM64 Material" - bl_idname = "MATERIAL_PT_SM64_Material_Inspector" - bl_parent_id = "EEVEE_MATERIAL_PT_context_material" +class SM64_ScrollPanel(bpy.types.Panel): + bl_label = "Scrolling" + bl_idname = "MATERIAL_PT_SM64_Scroll" + bl_parent_id = "MATERIAL_PT_SM64_Material_Inspector" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" @classmethod def poll(cls, context): - return context.material is not None and context.material.is_f3d and context.scene.gameEditorMode == "SM64" + use_dict = all_combiner_uses(context.material.f3d_mat) + return use_dict["Texture 0"] or use_dict["Texture 1"] def draw(self, context): - layout = self.layout + col = self.layout.column() material = context.material - col = layout.column() - - if material.mat_ver > 3: - f3dMat = material.f3d_mat - else: - f3dMat = material + f3dMat = material.f3d_mat useDict = all_combiner_uses(f3dMat) if useDict["Texture"]: - ui_procAnim(material, col, useDict["Texture 0"], useDict["Texture 1"], "SM64 UV Texture Scroll", False) + ui_procAnim(material, col, useDict["Texture 0"], useDict["Texture 1"], False) sm64_dl_writer_classes = ( @@ -919,7 +915,7 @@ def draw(self, context): ) sm64_dl_writer_panel_classes = ( - SM64_MaterialPanel, + SM64_ScrollPanel, SM64_DrawLayersPanel, SM64_ExportDLPanel, ExportTexRectDrawPanel, From 3ac79ecea47491c6f1f85e44bf29fac09363f993 Mon Sep 17 00:00:00 2001 From: Lila Date: Mon, 26 May 2025 17:16:53 +0100 Subject: [PATCH 3/5] more cleaning --- fast64_internal/f3d/f3d_material.py | 5 +-- fast64_internal/oot/__init__.py | 44 ++++++++++++++++++- fast64_internal/oot/animation/panels.py | 13 +----- fast64_internal/oot/cutscene/motion/panels.py | 12 +---- .../oot/cutscene/motion/properties.py | 2 +- fast64_internal/oot/props_panel_main.py | 5 +-- fast64_internal/oot/skeleton/panels.py | 13 +----- fast64_internal/sm64/__init__.py | 8 ++-- fast64_internal/sm64/sm64_geolayout_bone.py | 4 +- fast64_internal/sm64/sm64_objects.py | 7 ++- 10 files changed, 62 insertions(+), 51 deletions(-) diff --git a/fast64_internal/f3d/f3d_material.py b/fast64_internal/f3d/f3d_material.py index 1a40d6243..e95725a05 100644 --- a/fast64_internal/f3d/f3d_material.py +++ b/fast64_internal/f3d/f3d_material.py @@ -1462,11 +1462,11 @@ def draw(self, context): class F3DMeshPanel(Panel): bl_label = "F3D Mesh Inspector" + bl_parent_id = "OBJECT_PT_context_object" bl_idname = "F3D_PT_Mesh_Inspector" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - bl_options = {"HIDE_HEADER"} @classmethod def poll(cls, context): @@ -1474,8 +1474,7 @@ def poll(cls, context): def draw(self, context): new_gbi = not get_F3D_GBI().F3D_OLD_GBI - col = self.layout.box().column() - col.box().label(text=self.bl_label, icon="MESH_DATA") + col = self.layout.column() row = col.row() row.enabled = new_gbi row.prop(context.object, "use_f3d_culling") diff --git a/fast64_internal/oot/__init__.py b/fast64_internal/oot/__init__.py index e688445ac..3e58bc799 100644 --- a/fast64_internal/oot/__init__.py +++ b/fast64_internal/oot/__init__.py @@ -1,4 +1,5 @@ import bpy +from bpy.types import Panel from pathlib import Path from bpy.utils import register_class, unregister_class @@ -138,10 +139,47 @@ def is_globalh_present(self): ) +class OOT_MaterialPanel(Panel): + bl_label = "OOT Material" + bl_idname = "MATERIAL_PT_OOT_Material_Inspector" + bl_parent_id = "EEVEE_MATERIAL_PT_context_material" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "material" + + @classmethod + def poll(cls, context): + return context.material is not None and context.material.is_f3d and context.scene.gameEditorMode == "OOT" + + def draw(self, context): + pass + + +class OOT_ArmaturePanel(Panel): + bl_label = "OOT Armature" + bl_idname = "ARMATURE_PT_OOT_Inspector" + bl_parent_id = "OBJECT_PT_context_object" + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "object" + + @classmethod + def poll(cls, context): + return ( + context.object is not None and context.object.type == "ARMATURE" and context.scene.gameEditorMode == "OOT" + ) + + def draw(self, context): + pass + + +panels = (OOT_MaterialPanel, OOT_ArmaturePanel) oot_classes = (OOT_Properties,) def oot_panel_register(): + for cls in panels: + register_class(cls) oot_operator_panel_register() cutscene_panels_register() scene_panels_register() @@ -151,9 +189,12 @@ def oot_panel_register(): spline_panels_register() anim_panels_register() skeleton_panels_register() + csMotion_panels_register() def oot_panel_unregister(): + for cls in reversed(panels): + unregister_class(cls) oot_operator_panel_unregister() cutscene_panels_unregister() collision_panels_unregister() @@ -163,6 +204,7 @@ def oot_panel_unregister(): f3d_panels_unregister() anim_panels_unregister() skeleton_panels_unregister() + csMotion_panels_unregister() def oot_register(registerPanels): @@ -190,7 +232,6 @@ def oot_register(registerPanels): csMotion_ops_register() csMotion_props_register() - csMotion_panels_register() csMotion_preview_register() cutscene_preview_register() @@ -229,7 +270,6 @@ def oot_unregister(unregisterPanels): cutscene_preview_unregister() csMotion_preview_unregister() - csMotion_panels_unregister() csMotion_props_unregister() csMotion_ops_unregister() diff --git a/fast64_internal/oot/animation/panels.py b/fast64_internal/oot/animation/panels.py index 5e5c4e79b..257660dfa 100644 --- a/fast64_internal/oot/animation/panels.py +++ b/fast64_internal/oot/animation/panels.py @@ -8,21 +8,12 @@ class OOT_LinkAnimPanel(Panel): bl_idname = "OOT_PT_link_anim" - bl_parent_id = "OBJECT_PT_context_object" - bl_label = "OOT Link Animation Properties" + bl_parent_id = "ARMATURE_PT_OOT_Inspector" + bl_label = "Link Animation Properties" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - @classmethod - def poll(cls, context): - return ( - context.scene.gameEditorMode == "OOT" - and hasattr(context, "object") - and context.object is not None - and isinstance(context.object.data, Armature) - ) - # called every frame def draw(self, context): col = self.layout.column() diff --git a/fast64_internal/oot/cutscene/motion/panels.py b/fast64_internal/oot/cutscene/motion/panels.py index 697cc7a35..69957e36c 100644 --- a/fast64_internal/oot/cutscene/motion/panels.py +++ b/fast64_internal/oot/cutscene/motion/panels.py @@ -4,21 +4,13 @@ class OOT_CSMotionCameraShotPanel(OOT_Panel): - bl_label = "OOT Cutscene Motion Camera Shot Controls" + bl_label = "Cutscene Motion Camera Shot Controls" bl_idname = "OOT_PT_camera_shot_panel" - bl_parent_id = "OBJECT_PT_context_object" + bl_parent_id = "ARMATURE_PT_OOT_Inspector" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - @classmethod - def poll(cls, context): - return ( - context.scene.gameEditorMode == "OOT" - and context.view_layer.objects.active is not None - and context.view_layer.objects.active.type == "ARMATURE" - ) - def draw(self, context): obj = context.view_layer.objects.active col = self.layout.column() diff --git a/fast64_internal/oot/cutscene/motion/properties.py b/fast64_internal/oot/cutscene/motion/properties.py index 5f0b6fd88..c5fc8bdec 100644 --- a/fast64_internal/oot/cutscene/motion/properties.py +++ b/fast64_internal/oot/cutscene/motion/properties.py @@ -229,7 +229,7 @@ def draw_props(self, layout: UILayout): for propName in ["shotPointFrame", "shotPointViewAngle", "shotPointRoll"]: row.prop(self, propName) - row = box.row() + row = col.row() row.operator(CutsceneCmdMoveBone.bl_idname, text="Move Up", icon="TRIA_UP").direction = "UP" row.operator(CutsceneCmdMoveBone.bl_idname, text="Move Down", icon="TRIA_DOWN").direction = "DOWN" diff --git a/fast64_internal/oot/props_panel_main.py b/fast64_internal/oot/props_panel_main.py index a98fda90f..709c58421 100644 --- a/fast64_internal/oot/props_panel_main.py +++ b/fast64_internal/oot/props_panel_main.py @@ -108,7 +108,7 @@ def execute(self, context): class OOTObjectPanel(bpy.types.Panel): - bl_label = "OOT Object Inspector" + bl_label = "OOT Empty Inspector" bl_idname = "OBJECT_PT_OOT_Object_Inspector" bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" @@ -120,7 +120,6 @@ def poll(cls, context): return context.scene.gameEditorMode == "OOT" and (context.object is not None and context.object.type == "EMPTY") def draw(self, context): - prop_split(self.layout, context.scene, "gameEditorMode", "Game") col = self.layout.column() obj = context.object objName = obj.name @@ -134,7 +133,7 @@ def draw(self, context): if obj.ootEmptyType == "Actor": actorProp: OOTActorProperty = obj.ootActorProperty - actorProp.draw_props(box, altRoomProp, obj) + actorProp.draw_props(col, altRoomProp, obj) elif obj.ootEmptyType == "Transition Actor": transActorProp: OOTTransitionActorProperty = obj.ootTransitionActorProperty diff --git a/fast64_internal/oot/skeleton/panels.py b/fast64_internal/oot/skeleton/panels.py index 37aabfe28..ef3e9799a 100644 --- a/fast64_internal/oot/skeleton/panels.py +++ b/fast64_internal/oot/skeleton/panels.py @@ -8,21 +8,12 @@ class OOT_SkeletonPanel(Panel): bl_idname = "OOT_PT_skeleton" - bl_parent_id = "OBJECT_PT_context_object" - bl_label = "OOT Skeleton Properties" + bl_parent_id = "ARMATURE_PT_OOT_Inspector" + bl_label = "Skeleton Properties" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "object" - @classmethod - def poll(cls, context): - return ( - context.scene.gameEditorMode == "OOT" - and hasattr(context, "object") - and context.object is not None - and isinstance(context.object.data, Armature) - ) - # called every frame def draw(self, context): col = self.layout.column() diff --git a/fast64_internal/sm64/__init__.py b/fast64_internal/sm64/__init__.py index 4f66effab..7de9deb22 100644 --- a/fast64_internal/sm64/__init__.py +++ b/fast64_internal/sm64/__init__.py @@ -114,8 +114,8 @@ def draw(self, context): def sm64_panel_register(): - for panel in panels: - register_class(panel) + for cls in panels: + register_class(cls) settings_panels_register() tools_panels_register() sm64_col_panel_register() @@ -131,8 +131,8 @@ def sm64_panel_register(): def sm64_panel_unregister(): - for panel in panels: - unregister_class(panel) + for cls in panels: + unregister_class(cls) settings_panels_unregister() tools_panels_unregister() sm64_col_panel_unregister() diff --git a/fast64_internal/sm64/sm64_geolayout_bone.py b/fast64_internal/sm64/sm64_geolayout_bone.py index 3caed69ad..de282e1c6 100644 --- a/fast64_internal/sm64/sm64_geolayout_bone.py +++ b/fast64_internal/sm64/sm64_geolayout_bone.py @@ -167,7 +167,7 @@ def drawGeoInfo(panel: Panel, bone: Bone): class GeolayoutBonePanel(Panel): - bl_label = "Geolayout Inspector" + bl_label = "SM64 Bone Inspector" bl_idname = "BONE_PT_SM64_Geolayout_Inspector" bl_parent_id = "BONE_PT_context_bone" bl_space_type = "PROPERTIES" @@ -183,7 +183,7 @@ def draw(self, context): class GeolayoutArmaturePanel(Panel): - bl_label = "SM64 Geolayout Armature Inspector" + bl_label = "SM64 Armature Inspector" bl_idname = "OBJECT_PT_SM64_Armature_Geolayout_Inspector" bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" diff --git a/fast64_internal/sm64/sm64_objects.py b/fast64_internal/sm64/sm64_objects.py index 6ec4ce6a6..66d0d92a9 100644 --- a/fast64_internal/sm64/sm64_objects.py +++ b/fast64_internal/sm64/sm64_objects.py @@ -1070,7 +1070,7 @@ def invoke(self, context, event): class SM64ObjectPanel(bpy.types.Panel): - bl_label = "SM64 Object Inspector" + bl_label = "SM64 Empty Inspector" bl_idname = "OBJECT_PT_SM64_Object_Inspector" bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES" @@ -1172,12 +1172,11 @@ def draw_behavior_params(self, obj: bpy.types.Object, parent_box: bpy.types.UILa parent_box.separator() def draw(self, context): - prop_split(self.layout, context.scene, "gameEditorMode", "Game") col = self.layout.column() obj = context.object props = obj.fast64.sm64 - prop_split(box, obj, "sm64_obj_type", "Object Type") + prop_split(col, obj, "sm64_obj_type", "Object Type") if obj.sm64_obj_type == "Object": prop_split(col, obj, "sm64_model_enum", "Model") if obj.sm64_model_enum == "Custom": @@ -1385,7 +1384,7 @@ def draw(self, context): self.draw_inline_obj(col, obj) elif obj.sm64_obj_type == "None": - col.box().label(text="This can be used as an empty transform node in a geolayout hierarchy.") + multilineLabel(col, "This can be used as an empty transform\nnode in a geolayout hierarchy.", icon="INFO") def draw_acts(self, obj, layout): layout.label(text="Acts") From 85495fbdae84445ff0fab7f4341d96beb8fdfb64 Mon Sep 17 00:00:00 2001 From: Lila Date: Mon, 26 May 2025 17:25:02 +0100 Subject: [PATCH 4/5] some more oot work --- fast64_internal/f3d/f3d_material.py | 1 + fast64_internal/f3d/flipbook.py | 4 ++-- fast64_internal/oot/__init__.py | 2 +- fast64_internal/oot/collision/panels.py | 4 ++-- fast64_internal/oot/f3d/panels.py | 13 +++++++------ 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/fast64_internal/f3d/f3d_material.py b/fast64_internal/f3d/f3d_material.py index e95725a05..bf0a43ba9 100644 --- a/fast64_internal/f3d/f3d_material.py +++ b/fast64_internal/f3d/f3d_material.py @@ -3880,6 +3880,7 @@ def draw_rdp_world_defaults(layout: UILayout, scene: Scene): class DefaultRDPSettingsPanel(Panel): bl_label = "RDP Default Settings" bl_idname = "WORLD_PT_RDP_Default_Inspector" + bl_parent_id = "WORLD_PT_context_world" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "world" diff --git a/fast64_internal/f3d/flipbook.py b/fast64_internal/f3d/flipbook.py index b5c55e5f4..928b1e3af 100644 --- a/fast64_internal/f3d/flipbook.py +++ b/fast64_internal/f3d/flipbook.py @@ -274,9 +274,9 @@ def flipbookAnimHandler(dummy): class Flipbook_MaterialPanel(bpy.types.Panel): - bl_label = "OOT Flipbook Properties" + bl_label = "Flipbook Properties" bl_idname = "MATERIAL_PT_Flipbook_Material_Inspector" - bl_parent_id = "EEVEE_MATERIAL_PT_context_material" + bl_parent_id = "MATERIAL_PT_OOT_Material_Inspector" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" diff --git a/fast64_internal/oot/__init__.py b/fast64_internal/oot/__init__.py index 3e58bc799..c757f8ced 100644 --- a/fast64_internal/oot/__init__.py +++ b/fast64_internal/oot/__init__.py @@ -140,7 +140,7 @@ def is_globalh_present(self): class OOT_MaterialPanel(Panel): - bl_label = "OOT Material" + bl_label = "OOT Material Inspector" bl_idname = "MATERIAL_PT_OOT_Material_Inspector" bl_parent_id = "EEVEE_MATERIAL_PT_context_material" bl_space_type = "PROPERTIES" diff --git a/fast64_internal/oot/collision/panels.py b/fast64_internal/oot/collision/panels.py index b4f535e80..9500f16cf 100644 --- a/fast64_internal/oot/collision/panels.py +++ b/fast64_internal/oot/collision/panels.py @@ -26,9 +26,9 @@ def draw(self, context): class OOT_CollisionPanel(Panel): - bl_label = "OOT Collision Inspector" + bl_label = "Collision" bl_idname = "MATERIAL_PT_OOT_Collision_Inspector" - bl_parent_id = "EEVEE_MATERIAL_PT_context_material" + bl_parent_id = "MATERIAL_PT_OOT_Material_Inspector" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" diff --git a/fast64_internal/oot/f3d/panels.py b/fast64_internal/oot/f3d/panels.py index 903ef4db7..1dbdafe7a 100644 --- a/fast64_internal/oot/f3d/panels.py +++ b/fast64_internal/oot/f3d/panels.py @@ -47,10 +47,10 @@ def draw(self, context): # box.prop(obj.ootDynamicTransform, "billboard") -class OOT_MaterialPanel(Panel): - bl_label = "OOT Dynamic Material Properties" - bl_idname = "MATERIAL_PT_OOT_Material_Inspector" - bl_parent_id = "EEVEE_MATERIAL_PT_context_material" +class OOT_DynamicPropertiesPanel(Panel): + bl_label = "Dynamic Properties" + bl_idname = "MATERIAL_PT_OOT_Dynamic_Properties" + bl_parent_id = "MATERIAL_PT_OOT_Material_Inspector" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "material" @@ -83,9 +83,10 @@ def draw(self, context): class OOT_DrawLayersPanel(Panel): bl_label = "OOT Default Render Modes" bl_idname = "WORLD_PT_OOT_Draw_Layers_Panel" - bl_parent_id = "EEVEE_MATERIAL_PT_context_material" + bl_parent_id = "WORLD_PT_context_world" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" + bl_context = "world" @classmethod def poll(cls, context): @@ -118,7 +119,7 @@ def draw(self, context): oot_dl_writer_panel_classes = ( OOT_DisplayListPanel, - OOT_MaterialPanel, + OOT_DynamicPropertiesPanel, OOT_DrawLayersPanel, OOT_ExportDLPanel, ) From 0e01fa55ebe16e67a587ac4e8218d018123e197c Mon Sep 17 00:00:00 2001 From: Lila Date: Mon, 26 May 2025 17:28:37 +0100 Subject: [PATCH 5/5] Update sm64_geolayout_bone.py --- fast64_internal/sm64/sm64_geolayout_bone.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fast64_internal/sm64/sm64_geolayout_bone.py b/fast64_internal/sm64/sm64_geolayout_bone.py index de282e1c6..35294833c 100644 --- a/fast64_internal/sm64/sm64_geolayout_bone.py +++ b/fast64_internal/sm64/sm64_geolayout_bone.py @@ -216,7 +216,7 @@ def drawLayerWarningBox(layout, prop, data): class GeolayoutObjectPanel(Panel): - bl_label = "SM64 Object Geolayout" + bl_label = "SM64 Geolayout" bl_idname = "OBJECT_PT_SM64_Geolayout" bl_parent_id = "OBJECT_PT_context_object" bl_space_type = "PROPERTIES"