Skip to content

Commit 9770f04

Browse files
add logging to panels.py and remove disables in interface (temporary) to help me troubleshoot
1 parent 07a96f6 commit 9770f04

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

panels.py

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,19 @@
66
"""
77

88
import time
9+
import logging
910
from bpy.types import Panel
1011
from . import export_indicators
1112

13+
# --- Setup Logger ---
14+
logger = logging.getLogger(__name__)
15+
if not logger.handlers:
16+
handler = logging.StreamHandler()
17+
formatter = logging.Formatter("%(name)s:%(levelname)s: %(message)s")
18+
handler.setFormatter(formatter)
19+
logger.addHandler(handler)
20+
logger.setLevel(logging.INFO) # Default level
21+
1222
# Main UI Panel
1323
class MESH_PT_exporter_panel(Panel):
1424
bl_label = "EasyMesh Batch Exporter"
@@ -29,8 +39,30 @@ def format_has_coordinates(self, format):
2939

3040
def draw(self, context):
3141
layout = self.layout
42+
43+
# --- Debugging Start ---
44+
logger.info("--- Drawing MESH_PT_exporter_panel ---")
45+
if not hasattr(context.scene, "mesh_exporter"):
46+
logger.error("context.scene has no 'mesh_exporter' attribute!")
47+
layout.label(text="Error: Property group not registered?")
48+
return # Stop drawing if the group isn't there
49+
3250
settings = context.scene.mesh_exporter
3351

52+
if settings is None:
53+
logger.error("context.scene.mesh_exporter is None!")
54+
layout.label(text="Error: Property group is None?")
55+
return # Stop drawing if the group is None
56+
57+
logger.info(f"Settings object: {settings}")
58+
try:
59+
# Try accessing a property directly
60+
path_value = settings.mesh_export_path
61+
logger.info(f"Value of mesh_export_path: {path_value}")
62+
except AttributeError:
63+
logger.error("Could not access settings.mesh_export_path!")
64+
# --- Debugging End ---
65+
3466
layout.use_property_split = True
3567
layout.use_property_decorate = False
3668

@@ -59,7 +91,7 @@ def draw(self, context):
5991
col = layout.column(heading="Triangulate", align=True)
6092
col.prop(settings, "mesh_export_tri")
6193
sub = col.column(align=True)
62-
sub.enabled = settings.mesh_export_tri # Enable/disable sub-option
94+
# sub.enabled = context.scene.mesh_exporter.mesh_export_tri # Enable/disable sub-option
6395
sub.prop(settings, "mesh_export_tri_method")
6496
sub.prop(settings, "mesh_export_keep_normals")
6597

@@ -100,8 +132,10 @@ class MESH_PT_exporter_panel_lod(Panel):
100132

101133
@classmethod
102134
def poll(cls, context):
103-
# Show only if the main panel exists
104-
return context.scene.mesh_export_path is not None
135+
# Show only if the main panel exists and path is set
136+
settings = context.scene.mesh_exporter
137+
# Check if the path property itself exists and is not None/empty
138+
return settings and settings.mesh_export_path is not None and settings.mesh_export_path != ""
105139

106140
def draw_header(self, context):
107141
layout = self.layout
@@ -115,7 +149,7 @@ def draw(self, context):
115149
layout.use_property_decorate = False
116150

117151
# Enable/disable based on the header checkbox
118-
layout.enabled = settings.mesh_export_lod
152+
# layout.enabled = context.scene.mesh_exporter.mesh_export_lod
119153

120154
col = layout.column(align=True)
121155
col.prop(settings, "mesh_export_lod_count")

0 commit comments

Comments
 (0)