forked from vilemduha/blendercam
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from SpectralVectors/pie-menu
Pie Menu, Curve Create Name, bl_info Update
- Loading branch information
Showing
18 changed files
with
1,474 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import bpy | ||
from bpy.types import Menu | ||
|
||
|
||
class VIEW3D_MT_PIE_Area(Menu): | ||
# label is displayed at the center of the pie menu. | ||
bl_label = "∴ Operation Area ∴" | ||
|
||
def draw(self, context): | ||
scene = context.scene | ||
operation = scene.cam_operations[scene.cam_active_operation] | ||
material = operation.material | ||
|
||
layout = self.layout | ||
# layout.use_property_split = True | ||
layout.use_property_decorate = False | ||
|
||
pie = layout.menu_pie() | ||
|
||
# Left | ||
box = pie.box() | ||
column = box.column(align=True) | ||
col = column.column(align=True) | ||
row = col.row(align=True) | ||
row.prop(operation, 'use_layers') | ||
if operation.use_layers: | ||
row.prop(operation, 'stepdown') | ||
|
||
if operation.strategy in ['CUTOUT', 'POCKET', 'MEDIAL_AXIS']: | ||
row = col.row(align=True) | ||
row.label(text="") | ||
row.prop(operation, 'first_down') | ||
|
||
# Right | ||
box = pie.box() | ||
column = box.column(align=True) | ||
if operation.geometry_source in ['OBJECT', 'COLLECTION']: | ||
if operation.strategy == 'CURVE': | ||
column.label(text="Cannot Use Depth from Object Using Curves") | ||
|
||
row = column.row(align=True) | ||
row.label(text='Max Depth from') | ||
row.prop(operation, 'minz_from', text='') | ||
if operation.minz_from == 'CUSTOM': | ||
column.prop(operation, 'minz') | ||
|
||
else: | ||
column.prop(operation, 'source_image_scale_z') | ||
column.prop(operation, 'source_image_size_x') | ||
if operation.source_image_name != '': | ||
i = bpy.data.images[operation.source_image_name] | ||
if i is not None: | ||
sy = int((operation.source_image_size_x / | ||
i.size[0]) * i.size[1] * 1000000) / 1000 | ||
column.label(text='Image Size on Y Axis: ' + strInUnits(sy, 8)) | ||
column.separator() | ||
column.prop(operation, 'source_image_offset') | ||
col = column.column(align=True) | ||
col.prop(operation, 'source_image_crop', text='Crop Source Image') | ||
if operation.source_image_crop: | ||
col.prop(operation, 'source_image_crop_start_x', text='start x') | ||
col.prop(operation, 'source_image_crop_start_y', text='start y') | ||
col.prop(operation, 'source_image_crop_end_x', text='end x') | ||
col.prop(operation, 'source_image_crop_end_y', text='end y') | ||
|
||
# Bottom | ||
box = pie.box() | ||
column = box.column(align=True) | ||
if operation.strategy in ['BLOCK', 'SPIRAL', 'CIRCLES', 'PARALLEL', 'CROSS']: | ||
column.prop(operation, 'ambient_behaviour') | ||
if operation.ambient_behaviour == 'AROUND': | ||
column.prop(operation, 'ambient_radius') | ||
column.prop(operation, "ambient_cutter_restrict") | ||
|
||
if operation.strategy in ['BLOCK', 'SPIRAL', 'CIRCLES', 'PARALLEL', 'CROSS']: | ||
column.prop(operation, 'use_limit_curve') | ||
if operation.use_limit_curve: | ||
column.prop_search(operation, "limit_curve", bpy.data, "objects") | ||
|
||
# Top | ||
column = pie.column() | ||
box = column.box() | ||
box.scale_y = 2 | ||
box.scale_x = 2 | ||
box.emboss = 'NONE' | ||
box.operator( | ||
"wm.call_menu_pie", | ||
text='', | ||
icon='BACK' | ||
).name = 'VIEW3D_MT_PIE_Operation' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import bpy | ||
from bpy.types import Menu | ||
|
||
|
||
class VIEW3D_MT_PIE_Cutter(Menu): | ||
# label is displayed at the center of the pie menu. | ||
bl_label = "∴ Operation Cutter ∴" | ||
|
||
def draw(self, context): | ||
scene = context.scene | ||
operation = scene.cam_operations[scene.cam_active_operation] | ||
material = operation.material | ||
|
||
layout = self.layout | ||
# layout.use_property_split = True | ||
layout.use_property_decorate = False | ||
|
||
pie = layout.menu_pie() | ||
|
||
# Left | ||
box = pie.box() | ||
column = box.column(align=True) | ||
row = column.row(align=True) | ||
row.menu("CAM_CUTTER_MT_presets", text=bpy.types.CAM_CUTTER_MT_presets.bl_label) | ||
row.operator("render.cam_preset_cutter_add", text="", icon='ADD') | ||
row.operator("render.cam_preset_cutter_add", text="", icon='REMOVE').remove_active = True | ||
column.prop(operation, 'cutter_id') | ||
|
||
column.prop(operation, 'cutter_type') | ||
|
||
if operation.cutter_type in ['BALLCONE']: | ||
column.prop(operation, 'ball_radius') | ||
|
||
if operation.cutter_type in ['BULLNOSE']: | ||
column.prop(operation, 'bull_corner_radius') | ||
|
||
if operation.cutter_type in ['CYLCONE']: | ||
column.prop(operation, 'cylcone_diameter') | ||
|
||
if operation.cutter_type in ['VCARVE', 'BALLCONE', 'BULLNOSE', 'CYLCONE']: | ||
column.prop(operation, 'cutter_tip_angle') | ||
|
||
if operation.cutter_type in ['LASER']: | ||
column.prop(operation, 'Laser_on') | ||
column.prop(operation, 'Laser_off') | ||
column.prop(operation, 'Laser_cmd') | ||
column.prop(operation, 'Laser_delay') | ||
|
||
if operation.cutter_type in ['PLASMA']: | ||
column.prop(operation, 'Plasma_on') | ||
column.prop(operation, 'Plasma_off') | ||
column.prop(operation, 'Plasma_delay') | ||
column.prop(operation, 'Plasma_dwell') | ||
column.prop(operation, 'lead_in') | ||
column.prop(operation, 'lead_out') | ||
|
||
if operation.cutter_type in ['CUSTOM']: | ||
if operation.optimisation.use_exact: | ||
column.label( | ||
text='Warning - only Convex Shapes Are Supported. ', icon='COLOR_RED') | ||
column.label(text='If Your Custom Cutter Is Concave,') | ||
column.label(text='Switch Exact Mode Off.') | ||
column.prop_search(operation, "cutter_object_name", bpy.data, "objects") | ||
|
||
column.prop(operation, 'cutter_diameter') | ||
|
||
if operation.cutter_type not in ['LASER', 'PLASMA']: | ||
column.prop(operation, 'cutter_flutes') | ||
|
||
column.prop(operation, 'cutter_description') | ||
|
||
# Right | ||
box = pie.box() | ||
column = box.column(align=True) | ||
if operation.cutter_type in ['LASER', 'PLASMA']: | ||
return | ||
if operation.strategy in ['CUTOUT']: | ||
return | ||
|
||
if operation.cutter_type in ['BALLCONE']: | ||
engagement = round(100 * operation.dist_between_paths / operation.ball_radius, 1) | ||
else: | ||
engagement = round(100 * operation.dist_between_paths / operation.cutter_diameter, 1) | ||
|
||
column.label(text=f"Cutter Engagement: {engagement}%") | ||
|
||
if engagement > 50: | ||
column.label(text="WARNING: CUTTER ENGAGEMENT > 50%") | ||
|
||
# Bottom | ||
row = pie.row() | ||
row.label(text='') | ||
|
||
# Top | ||
column = pie.column() | ||
box = column.box() | ||
box.scale_y = 2 | ||
box.scale_x = 2 | ||
box.emboss = 'NONE' | ||
box.operator( | ||
"wm.call_menu_pie", | ||
text='', | ||
icon='BACK' | ||
).name = 'VIEW3D_MT_PIE_Operation' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import bpy | ||
from bpy.types import Menu | ||
|
||
|
||
class VIEW3D_MT_PIE_Feedrate(Menu): | ||
# label is displayed at the center of the pie menu. | ||
bl_label = "∴ Operation Feedrate ∴" | ||
|
||
def draw(self, context): | ||
scene = context.scene | ||
operation = scene.cam_operations[scene.cam_active_operation] | ||
material = operation.material | ||
|
||
layout = self.layout | ||
# layout.use_property_split = True | ||
layout.use_property_decorate = False | ||
|
||
pie = layout.menu_pie() | ||
|
||
# Left | ||
box = pie.box() | ||
column = box.column(align=True) | ||
column.prop(operation, 'feedrate') | ||
column.prop(operation, 'do_simulation_feedrate') | ||
|
||
# Right | ||
box = pie.box() | ||
column = box.column(align=True) | ||
column.prop(operation, 'plunge_feedrate') | ||
column.prop(operation, 'plunge_angle') | ||
column.prop(operation, 'spindle_rpm') | ||
|
||
# Bottom | ||
row = pie.row() | ||
row.label(text='') | ||
|
||
# Top | ||
column = pie.column() | ||
box = column.box() | ||
box.scale_y = 2 | ||
box.scale_x = 2 | ||
box.emboss = 'NONE' | ||
box.operator( | ||
"wm.call_menu_pie", | ||
text='', | ||
icon='BACK' | ||
).name = 'VIEW3D_MT_PIE_Operation' |
Oops, something went wrong.