from bpy.types import Panel from ..infra.mixins import DrawCollectionMixin from ..registry import register_class @register_class class SlicerObjectPanel(Panel, DrawCollectionMixin): bl_label = "NodeSlicer Settings" bl_idname = f"OBJECT_PT_nodeslicer" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "object" def draw(self, context): layout = self.layout if not layout: return obj = context.object if not obj: return pg = getattr(obj, 'nodeslicer', None) if not pg: layout.label(text="Property not registered") return layout.prop(pg, "object_type", text="Object type") layout.prop(pg, "extruder", text="Extruder") layout.label(text="Modifiers:") if pg.object_type in ['ParameterModifier', 'ModelPart']: self.draw_collection(pg.modifiers, layout)