kopia lustrzana https://github.com/vilemduha/blendercam
Added levels for all panels
rodzic
e3a7a401a0
commit
e749a7b6e6
|
@ -47,6 +47,9 @@ from cam.ui_panels.movement import *
|
|||
from cam.ui_panels.feedrate import *
|
||||
from cam.ui_panels.optimisation import *
|
||||
from cam.ui_panels.area import *
|
||||
from cam.ui_panels.gcode import *
|
||||
from cam.ui_panels.pack import *
|
||||
from cam.ui_panels.slice import *
|
||||
|
||||
|
||||
class CAM_UL_orientations(UIList):
|
||||
|
@ -60,89 +63,6 @@ class CAM_UL_orientations(UIList):
|
|||
|
||||
|
||||
|
||||
class CAM_GCODE_Panel(CAMButtonsPanel, bpy.types.Panel):
|
||||
"""CAM operation g-code options panel"""
|
||||
bl_label = "CAM g-code options "
|
||||
bl_idname = "WORLD_PT_CAM_GCODE"
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = bpy.context.scene
|
||||
if len(scene.cam_operations) == 0:
|
||||
layout.label(text='Add operation first')
|
||||
if len(scene.cam_operations) > 0:
|
||||
ao = scene.cam_operations[scene.cam_active_operation]
|
||||
if ao.valid:
|
||||
layout.prop(ao, 'output_header')
|
||||
|
||||
if ao.output_header:
|
||||
layout.prop(ao, 'gcode_header')
|
||||
layout.prop(ao, 'output_trailer')
|
||||
if ao.output_trailer:
|
||||
layout.prop(ao, 'gcode_trailer')
|
||||
layout.prop(ao, 'enable_dust')
|
||||
if ao.enable_dust:
|
||||
layout.prop(ao, 'gcode_start_dust_cmd')
|
||||
layout.prop(ao, 'gcode_stop_dust_cmd')
|
||||
layout.prop(ao, 'enable_hold')
|
||||
if ao.enable_hold:
|
||||
layout.prop(ao, 'gcode_start_hold_cmd')
|
||||
layout.prop(ao, 'gcode_stop_hold_cmd')
|
||||
layout.prop(ao, 'enable_mist')
|
||||
if ao.enable_mist:
|
||||
layout.prop(ao, 'gcode_start_mist_cmd')
|
||||
layout.prop(ao, 'gcode_stop_mist_cmd')
|
||||
|
||||
else:
|
||||
layout.label(text='Enable Show experimental features')
|
||||
layout.label(text='in Blender CAM Addon preferences')
|
||||
|
||||
|
||||
class CAM_PACK_Panel(CAMButtonsPanel, bpy.types.Panel):
|
||||
"""CAM material panel"""
|
||||
bl_label = "Pack curves on sheet"
|
||||
bl_idname = "WORLD_PT_CAM_PACK"
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = bpy.context.scene
|
||||
settings = scene.cam_pack
|
||||
layout.label(text='warning - algorithm is slow.')
|
||||
layout.label(text='only for curves now.')
|
||||
|
||||
layout.operator("object.cam_pack_objects")
|
||||
layout.prop(settings, 'sheet_fill_direction')
|
||||
layout.prop(settings, 'sheet_x')
|
||||
layout.prop(settings, 'sheet_y')
|
||||
layout.prop(settings, 'distance')
|
||||
layout.prop(settings, 'tolerance')
|
||||
layout.prop(settings, 'rotate')
|
||||
if settings.rotate:
|
||||
layout.prop(settings, 'rotate_angle')
|
||||
|
||||
|
||||
class CAM_SLICE_Panel(CAMButtonsPanel, bpy.types.Panel):
|
||||
"""CAM slicer panel"""
|
||||
bl_label = "Slice model to plywood sheets"
|
||||
bl_idname = "WORLD_PT_CAM_SLICE"
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = bpy.context.scene
|
||||
settings = scene.cam_slice
|
||||
|
||||
layout.operator("object.cam_slice_objects")
|
||||
layout.prop(settings, 'slice_distance')
|
||||
layout.prop(settings, 'slice_above0')
|
||||
layout.prop(settings, 'slice_3d')
|
||||
layout.prop(settings, 'indexes')
|
||||
|
||||
|
||||
# panel containing all tools
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ class CAM_AREA_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
"""CAM operation area panel"""
|
||||
bl_label = "CAM operation area "
|
||||
bl_idname = "WORLD_PT_CAM_OPERATION_AREA"
|
||||
panel_interface_level = 0
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ class CAM_CUTTER_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
"""CAM cutter panel"""
|
||||
bl_label = " "
|
||||
bl_idname = "WORLD_PT_CAM_CUTTER"
|
||||
panel_interface_level = 0
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ class CAM_FEEDRATE_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
"""CAM feedrate panel"""
|
||||
bl_label = "CAM feedrate"
|
||||
bl_idname = "WORLD_PT_CAM_FEEDRATE"
|
||||
panel_interface_level = 0
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
|
||||
import bpy
|
||||
from cam.ui_panels.buttons_panel import CAMButtonsPanel
|
||||
|
||||
|
||||
class CAM_GCODE_Panel(CAMButtonsPanel, bpy.types.Panel):
|
||||
"""CAM operation g-code options panel"""
|
||||
bl_label = "CAM g-code options "
|
||||
bl_idname = "WORLD_PT_CAM_GCODE"
|
||||
panel_interface_level = 2
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = bpy.context.scene
|
||||
if len(scene.cam_operations) == 0:
|
||||
layout.label(text='Add operation first')
|
||||
if len(scene.cam_operations) > 0:
|
||||
ao = scene.cam_operations[scene.cam_active_operation]
|
||||
if ao.valid:
|
||||
layout.prop(ao, 'output_header')
|
||||
|
||||
if ao.output_header:
|
||||
layout.prop(ao, 'gcode_header')
|
||||
layout.prop(ao, 'output_trailer')
|
||||
if ao.output_trailer:
|
||||
layout.prop(ao, 'gcode_trailer')
|
||||
layout.prop(ao, 'enable_dust')
|
||||
if ao.enable_dust:
|
||||
layout.prop(ao, 'gcode_start_dust_cmd')
|
||||
layout.prop(ao, 'gcode_stop_dust_cmd')
|
||||
layout.prop(ao, 'enable_hold')
|
||||
if ao.enable_hold:
|
||||
layout.prop(ao, 'gcode_start_hold_cmd')
|
||||
layout.prop(ao, 'gcode_stop_hold_cmd')
|
||||
layout.prop(ao, 'enable_mist')
|
||||
if ao.enable_mist:
|
||||
layout.prop(ao, 'gcode_start_mist_cmd')
|
||||
layout.prop(ao, 'gcode_stop_mist_cmd')
|
||||
|
||||
else:
|
||||
layout.label(text='Enable Show experimental features')
|
||||
layout.label(text='in Blender CAM Addon preferences')
|
||||
|
||||
|
||||
|
|
@ -28,9 +28,9 @@ class CAM_INFO_Properties(bpy.types.PropertyGroup):
|
|||
|
||||
|
||||
class CAM_INFO_Panel(CAMButtonsPanel, bpy.types.Panel):
|
||||
"""CAM info panel"""
|
||||
bl_label = "CAM info & warnings"
|
||||
bl_idname = "WORLD_PT_CAM_INFO"
|
||||
panel_interface_level = 1
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ class CAM_MACHINE_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
bl_label = " "
|
||||
bl_idname = "WORLD_PT_CAM_MACHINE"
|
||||
always_show_panel = True
|
||||
panel_interface_level = 0
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ class CAM_MATERIAL_PositionObject(bpy.types.Operator):
|
|||
bl_idname = "object.material_cam_position"
|
||||
bl_label = "position object for CAM operation"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
panel_interface_level = 0
|
||||
|
||||
def execute(self, context):
|
||||
s = bpy.context.scene
|
||||
|
|
|
@ -108,6 +108,7 @@ class CAM_MOVEMENT_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
"""CAM movement panel"""
|
||||
bl_label = "CAM movement"
|
||||
bl_idname = "WORLD_PT_CAM_MOVEMENT"
|
||||
panel_interface_level = 2
|
||||
|
||||
def draw_cut_type(self):
|
||||
self.layout.prop(self.op.movement, 'type')
|
||||
|
|
|
@ -7,6 +7,7 @@ class CAM_OPERATION_PROPERTIES_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
"""CAM operation properties panel"""
|
||||
bl_label = "CAM operation setup"
|
||||
bl_idname = "WORLD_PT_CAM_OPERATION"
|
||||
panel_interface_level = 0
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ class CAM_OPERATIONS_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
bl_label = "CAM operations"
|
||||
bl_idname = "WORLD_PT_CAM_OPERATIONS"
|
||||
always_show_panel = True
|
||||
panel_interface_level = 0
|
||||
|
||||
# Main draw function
|
||||
def draw(self, context):
|
||||
|
|
|
@ -51,6 +51,7 @@ class CAM_OPTIMISATION_Panel(CAMButtonsPanel, bpy.types.Panel):
|
|||
"""CAM optimisation panel"""
|
||||
bl_label = "CAM optimisation"
|
||||
bl_idname = "WORLD_PT_CAM_OPTIMISATION"
|
||||
panel_interface_level = 2
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
import bpy
|
||||
from cam.ui_panels.buttons_panel import CAMButtonsPanel
|
||||
|
||||
|
||||
class CAM_PACK_Panel(CAMButtonsPanel, bpy.types.Panel):
|
||||
"""CAM material panel"""
|
||||
bl_label = "Pack curves on sheet"
|
||||
bl_idname = "WORLD_PT_CAM_PACK"
|
||||
panel_interface_level = 2
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = bpy.context.scene
|
||||
settings = scene.cam_pack
|
||||
layout.label(text='warning - algorithm is slow.')
|
||||
layout.label(text='only for curves now.')
|
||||
|
||||
layout.operator("object.cam_pack_objects")
|
||||
layout.prop(settings, 'sheet_fill_direction')
|
||||
layout.prop(settings, 'sheet_x')
|
||||
layout.prop(settings, 'sheet_y')
|
||||
layout.prop(settings, 'distance')
|
||||
layout.prop(settings, 'tolerance')
|
||||
layout.prop(settings, 'rotate')
|
||||
if settings.rotate:
|
||||
layout.prop(settings, 'rotate_angle')
|
|
@ -0,0 +1,24 @@
|
|||
|
||||
import bpy
|
||||
from cam.ui_panels.buttons_panel import CAMButtonsPanel
|
||||
|
||||
|
||||
class CAM_SLICE_Panel(CAMButtonsPanel, bpy.types.Panel):
|
||||
"""CAM slicer panel"""
|
||||
bl_label = "Slice model to plywood sheets"
|
||||
bl_idname = "WORLD_PT_CAM_SLICE"
|
||||
panel_interface_level = 2
|
||||
|
||||
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
scene = bpy.context.scene
|
||||
settings = scene.cam_slice
|
||||
|
||||
layout.operator("object.cam_slice_objects")
|
||||
layout.prop(settings, 'slice_distance')
|
||||
layout.prop(settings, 'slice_above0')
|
||||
layout.prop(settings, 'slice_3d')
|
||||
layout.prop(settings, 'indexes')
|
||||
|
Ładowanie…
Reference in New Issue