forked from WASPMed/WASP-Med-Add-on-for-Blender-2-9
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwaspmed_print.py
91 lines (79 loc) · 3.47 KB
/
waspmed_print.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
class WASPMED_PT_print(bpy.types.Panel):
#class waspmed_scan_panel(, bpy.types.View3DPaintPanel):
bl_label = "Print"
bl_category = "Waspmed"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
#bl_options = {}
#bl_context = "objectmode"
#@classmethod
#def poll(cls, context):
# return context.mode in {'OBJECT', 'EDIT_MESH'}
@classmethod
def poll(cls, context):
try:
ob = context.object
if ob.parent is not None:
ob = ob.parent
status = ob.waspmed_prop.status
is_mesh = ob.type == 'MESH'
return status == 6 and is_mesh and not context.object.hide_viewport
except: return False
def draw(self, context):
layout = self.layout
col = layout.column(align=True)
col.label(text="Shell Thickness:")#, icon='MOD_WARP')
col.prop(context.object.waspmed_prop, "min_thickness")
col.prop(context.object.waspmed_prop, "max_thickness")
col.separator()
col.label(text="Profile:")
md = context.object.modifiers["Profile"]
row = col.row(align=True)
row.prop(md, 'falloff_type', text='')
row.prop(md, 'show_viewport', text='')
if md.falloff_type == 'CURVE':
col.template_curve_mapping(md, "map_curve")
col.separator()
col.label(text="Smooth:")#, icon='MOD_SMOOTH')
row = col.row(align=True)
#row.prop(context.object.waspmed_prop, "bool_smooth", icon='MOD_SMOOTH', text="")
row.prop(context.object.waspmed_prop, "smooth_iterations", text="Steps")
row.prop(context.object.waspmed_prop, "bool_smooth", text="", icon='MOD_SMOOTH')
col.separator()
col.label(text="Auto Crop:")#, icon='MOD_DECIM')
row = col.row(align=True)
row.prop(context.object.waspmed_prop, "trim_bottom", text="Offset")
row.prop(context.object.waspmed_prop, "bool_trim_bottom", icon='MOD_DECIM', text="")
col.separator()
box = layout.box()
col = box.column(align=True)
#col.label(text="Utils:")
#col.operator("view3d.ruler", text="Ruler", icon="ARROW_LEFTRIGHT")
if context.mode == 'OBJECT' and False:
col.separator()
col.operator("object.add_measure_plane", text="Add Measure Plane", icon='MESH_PLANE')
col.operator("object.measure_circumference", text="Measure Circumferences", icon='DRIVER_DISTANCE')
col.separator()
col.operator("screen.region_quadview", text="Toggle Quad View", icon='VIEW3D')
col.separator()
row = col.row(align=True)
row.operator("ed.undo", icon='LOOP_BACK')
row.operator("ed.redo", icon='LOOP_FORWARDS')