Skip to content

Commit

Permalink
broken state
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilaa3 committed Apr 24, 2024
1 parent b7ad65c commit ebefb42
Show file tree
Hide file tree
Showing 9 changed files with 1,265 additions and 6 deletions.
47 changes: 46 additions & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
on_update_render_settings,
)

from .gltf_extension import *

# info about add on
bl_info = {
"name": "Fast64",
Expand Down Expand Up @@ -145,6 +147,25 @@ def draw(self, context):
col.operator(SM64_AddWaterBox.bl_idname)


glTFFormatEnum = (
(
"GLB",
"glTF Binary",
"(.glb) Exports a single file, with all data packed in binary form. Most efficient and portable, but more difficult to edit later.",
),
(
"GLTF_SEPARATE",
"glTF Separate",
"(.gltf + .bin + textures) Exports multiple files, with separate JSON, binary and texture data. Easiest to edit later.",
),
(
"GLTF_EMBEDDED",
"glTF Embedded",
"(.gltf) Exports a single file, with all data packed in JSON. Less efficient than binary, but easier to edit later.",
),
)


class F3D_GlobalSettingsPanel(bpy.types.Panel):
bl_idname = "F3D_PT_global_settings"
bl_label = "F3D Global Settings"
Expand Down Expand Up @@ -200,12 +221,15 @@ def draw(self, context):
col.prop(scene, "exportHiddenGeometry")
col.prop(scene, "fullTraceback")
prop_split(col, fast64_settings, "anim_range_choice", "Anim Range")

col.separator()

col.prop(fast64_settings, "auto_pick_texture_format")
if fast64_settings.auto_pick_texture_format:
col.prop(fast64_settings, "prefer_rgba_over_ci")
col.separator()

col.label(text="Fast64 glTF Settings")
fast64_settings.glTF.draw_props(col)


class Fast64_GlobalToolsPanel(bpy.types.Panel):
Expand All @@ -228,9 +252,29 @@ def draw(self, context):
addon_updater_ops.update_notice_box_ui(self, context)


class Fast64_glTFProperties(bpy.types.PropertyGroup):
"""
Properties in scene.fast64.settings.glTF.
"""

exportFormat: bpy.props.EnumProperty(name="Format", default="GLTF_SEPARATE", items=glTFFormatEnum)
copyright: bpy.props.StringProperty(name="Copyright")
useMeshCompression: bpy.props.BoolProperty(name="Use Mesh Compression")
meshCompressionLevel: bpy.props.IntProperty(name="Mesh Compression Level", min=0, max=6)

def draw_props(self, layout: bpy.types.UILayout):
col = layout.column()
col.prop(self, "exportFormat")
col.prop(self, "copyright")
col.prop(self, "useMeshCompression")
col.prop(self, "meshCompressionLevel")


class Fast64Settings_Properties(bpy.types.PropertyGroup):
"""Settings affecting exports for all games found in scene.fast64.settings"""

glTF: bpy.props.PointerProperty(type=Fast64_glTFProperties, name="glTF Properties")

version: bpy.props.IntProperty(name="Fast64Settings_Properties Version", default=0)

anim_range_choice: bpy.props.EnumProperty(
Expand Down Expand Up @@ -385,6 +429,7 @@ def draw(self, context):


classes = (
Fast64_glTFProperties,
Fast64Settings_Properties,
Fast64RenderSettings_Properties,
Fast64_Properties,
Expand Down
Loading

0 comments on commit ebefb42

Please sign in to comment.