diff --git a/scripts/addons/cam/__init__.py b/scripts/addons/cam/__init__.py index 89fa609e..09c7decb 100644 --- a/scripts/addons/cam/__init__.py +++ b/scripts/addons/cam/__init__.py @@ -466,12 +466,12 @@ def getStrategyList(scene, context): class camOperation(bpy.types.PropertyGroup): + interface: bpy.props.PointerProperty(type=CAM_INTERFACE_Properties) material: bpy.props.PointerProperty(type=CAM_MATERIAL_Properties) info: bpy.props.PointerProperty(type=CAM_INFO_Properties) optimisation: bpy.props.PointerProperty(type=CAM_OPTIMISATION_Properties) movement: bpy.props.PointerProperty(type=CAM_MOVEMENT_Properties) - name: bpy.props.StringProperty(name="Operation Name", default="Operation", update=updateRest) filename: bpy.props.StringProperty(name="File name", default="Operation", update=updateRest) auto_export: bpy.props.BoolProperty(name="Auto export", @@ -1143,6 +1143,7 @@ def get_panels(): # convenience function for bot register and unregister functi machineSettings, CamAddonPreferences, + ui.CAM_INTERFACE_Panel, ui.CAM_CHAINS_Panel, ui.CAM_OPERATIONS_Panel, ui.CAM_INFO_Panel, @@ -1345,6 +1346,8 @@ classes = [ CamAddonPreferences, import_settings, + ui.CAM_INTERFACE_Panel, + ui.CAM_INTERFACE_Properties, ui.CAM_CHAINS_Panel, ui.CAM_OPERATIONS_Panel, ui.CAM_INFO_Properties, diff --git a/scripts/addons/cam/ui.py b/scripts/addons/cam/ui.py index 06f7110b..44f60500 100644 --- a/scripts/addons/cam/ui.py +++ b/scripts/addons/cam/ui.py @@ -35,6 +35,7 @@ from cam import gcodeimportparser, simple from cam.simple import * from cam.ui_panels.buttons_panel import CAMButtonsPanel +from cam.ui_panels.interface import * from cam.ui_panels.info import * from cam.ui_panels.operations import * from cam.ui_panels.cutter import * diff --git a/scripts/addons/cam/ui_panels/buttons_panel.py b/scripts/addons/cam/ui_panels/buttons_panel.py index bad3924c..fd648eb1 100644 --- a/scripts/addons/cam/ui_panels/buttons_panel.py +++ b/scripts/addons/cam/ui_panels/buttons_panel.py @@ -6,6 +6,7 @@ class CAMButtonsPanel: bl_region_type = 'WINDOW' bl_context = "render" always_show_panel = False + COMPAT_ENGINES = {'BLENDERCAM_RENDER'} # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here diff --git a/scripts/addons/cam/ui_panels/interface.py b/scripts/addons/cam/ui_panels/interface.py new file mode 100644 index 00000000..82da284d --- /dev/null +++ b/scripts/addons/cam/ui_panels/interface.py @@ -0,0 +1,30 @@ + +import bpy +import math +from cam.ui_panels.buttons_panel import CAMButtonsPanel +import cam.utils +import cam.constants + +class CAM_INTERFACE_Properties(bpy.types.PropertyGroup): + interface_level: bpy.props.EnumProperty( + name="Interface", + description="Choose the interface details", + items=[('0', "Basic", "Basic interface"), + ('1', "Advanced", "Advanced interface"), + ('2', "Complete", "Complete interface")], + default='0', + ) + +class CAM_INTERFACE_Panel(CAMButtonsPanel, bpy.types.Panel): + bl_label = "CAM interface" + bl_idname = "WORLD_PT_CAM_INTERFACE" + always_show_panel = True + + def draw_interface_level(self): + self.layout.prop(self.op.interface, 'interface_level') + + def draw(self, context): + self.context = context + scene = bpy.context.scene + + self.draw_interface_level() diff --git a/scripts/addons/cam/ui_panels/movement.py b/scripts/addons/cam/ui_panels/movement.py index 1fd05b09..5e73c324 100644 --- a/scripts/addons/cam/ui_panels/movement.py +++ b/scripts/addons/cam/ui_panels/movement.py @@ -109,8 +109,6 @@ class CAM_MOVEMENT_Panel(CAMButtonsPanel, bpy.types.Panel): bl_label = "CAM movement" bl_idname = "WORLD_PT_CAM_MOVEMENT" - COMPAT_ENGINES = {'BLENDERCAM_RENDER'} - def draw_cut_type(self): self.layout.prop(self.op.movement, 'type') if self.op.movement.type in ['BLOCK', 'SPIRAL', 'CIRCLES']: diff --git a/scripts/addons/cam/ui_panels/operations.py b/scripts/addons/cam/ui_panels/operations.py index 669e3ed1..82b2b926 100644 --- a/scripts/addons/cam/ui_panels/operations.py +++ b/scripts/addons/cam/ui_panels/operations.py @@ -11,15 +11,12 @@ from cam.ui_panels.buttons_panel import CAMButtonsPanel # # For each operation, generate the corresponding gcode and export the gcode file - class CAM_OPERATIONS_Panel(CAMButtonsPanel, bpy.types.Panel): """CAM operations panel""" bl_label = "CAM operations" bl_idname = "WORLD_PT_CAM_OPERATIONS" always_show_panel = True - COMPAT_ENGINES = {'BLENDERCAM_RENDER'} - # Main draw function def draw(self, context): self.draw_operations_list()