From 60e6ee2634ada5803c973f3fa3144c7c3743ec58 Mon Sep 17 00:00:00 2001 From: Lila Date: Wed, 16 Oct 2024 15:24:58 +0100 Subject: [PATCH] Update __init__.py --- __init__.py | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/__init__.py b/__init__.py index 2f47941e..df6a4650 100644 --- a/__init__.py +++ b/__init__.py @@ -4,7 +4,7 @@ from . import addon_updater_ops -from .fast64_internal.utility import prop_split +from .fast64_internal.utility import prop_split, multilineLabel, draw_and_check_tab from .fast64_internal.repo_settings import ( draw_repo_settings, @@ -72,6 +72,36 @@ ) +class F3D_GlobalSettingsPanel(bpy.types.Panel): + bl_idname = "F3D_PT_global_settings" + bl_label = "F3D Global Settings" + bl_space_type = "VIEW_3D" + bl_region_type = "UI" + bl_category = "Fast64" + + @classmethod + def poll(cls, context): + return True + + # called every frame + def draw(self, context): + col = self.layout.column() + col.scale_y = 1.1 # extra padding + prop_split(col, context.scene, "f3d_type", "F3D Microcode") + col.prop(context.scene, "saveTextures") + col.prop(context.scene, "f3d_simple", text="Simple Material UI") + col.prop(context.scene, "exportInlineF3D", text="Bleed and Inline Material Exports") + if context.scene.exportInlineF3D: + multilineLabel( + col.box(), + "While inlining, all meshes will be restored to world default values.\n You can configure these values in the world properties tab.", + icon="INFO", + ) + col.prop(context.scene, "ignoreTextureRestrictions") + if context.scene.ignoreTextureRestrictions: + col.box().label(text="Width/height must be < 1024. Must be png format.") + + class Fast64_GlobalSettingsPanel(bpy.types.Panel): bl_idname = "FAST64_PT_global_settings" bl_label = "Fast64 Global Settings" @@ -298,7 +328,9 @@ def draw(self, context): Fast64_Properties, Fast64_BoneProperties, Fast64_ObjectProperties, + F3D_GlobalSettingsPanel, Fast64_GlobalSettingsPanel, + Fast64_GlobalToolsPanel, UpgradeF3DMaterialsDialog, ) @@ -444,7 +476,10 @@ def register(): # called on add-on disabling def unregister(): utility_anim_unregister() - f3d_unregister(True) + op_largetexture_unregister() + flipbook_unregister() + f3d_writer_unregister() + f3d_parser_unregister() sm64_unregister(True) oot_unregister(True) mk64_unregister(True)