Implemented Interface Level

pull/248/head
migo101 2023-06-13 19:51:15 +02:00
rodzic e72639c0bd
commit e3a7a401a0
5 zmienionych plików z 16 dodań i 12 usunięć

Wyświetl plik

@ -51,6 +51,8 @@ from shapely import geometry as sgeometry
from cam.ui import *
bl_info = {
"name": "CAM - gcode generation tools",
"author": "Vilem Novak",
@ -67,7 +69,6 @@ import cam.constants
was_hidden_dict = {}
def updateMachine(self, context):
print('update machine ')
utils.addMachineAreaObject()
@ -466,7 +467,6 @@ 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)
@ -1467,6 +1467,7 @@ def register():
s.cam_slice = bpy.props.PointerProperty(type=SliceObjectsSettings)
bpy.types.Scene.interface = bpy.props.PointerProperty(type=CAM_INTERFACE_Properties)
def unregister():
for p in classes:

Wyświetl plik

@ -18,7 +18,10 @@ class CAMButtonsPanel:
return True
op = cls.active_operation()
if op and op.valid:
return True
if hasattr(cls, 'panel_interface_level'):
return cls.panel_interface_level <= int(context.scene.interface.level)
else:
return True
return False
@classmethod

Wyświetl plik

@ -36,6 +36,7 @@ class CAM_CHAINS_Panel(CAMButtonsPanel, bpy.types.Panel):
"""CAM chains panel"""
bl_label = "CAM chains"
bl_idname = "WORLD_PT_CAM_CHAINS"
panel_interface_level = 1
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}

Wyświetl plik

@ -6,25 +6,23 @@ import cam.utils
import cam.constants
class CAM_INTERFACE_Properties(bpy.types.PropertyGroup):
interface_level: bpy.props.EnumProperty(
level: bpy.props.EnumProperty(
name="Interface",
description="Choose the interface details",
items=[('0', "Basic", "Basic interface"),
('1', "Advanced", "Advanced interface"),
('2', "Complete", "Complete interface")],
description="Choose visible options",
items=[('0', "Basic", "Only show essential options"),
('1', "Advanced", "Show advanced options"),
('2', "Complete", "Show all options")],
default='0',
)
class CAM_INTERFACE_Panel(CAMButtonsPanel, bpy.types.Panel):
bl_label = "CAM interface"
bl_label = "Interface"
bl_idname = "WORLD_PT_CAM_INTERFACE"
always_show_panel = True
def draw_interface_level(self):
self.layout.prop(self.op.interface, 'interface_level')
self.layout.prop(self.context.scene.interface, 'level', text='')
def draw(self, context):
self.context = context
scene = bpy.context.scene
self.draw_interface_level()

Wyświetl plik

@ -6,6 +6,7 @@ class CAM_MACHINE_Panel(CAMButtonsPanel, bpy.types.Panel):
"""CAM machine panel"""
bl_label = " "
bl_idname = "WORLD_PT_CAM_MACHINE"
always_show_panel = True
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}