-
-
Notifications
You must be signed in to change notification settings - Fork 17
/
panel.py
112 lines (88 loc) · 3.83 KB
/
panel.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import bpy
class Anton_PT_Panel(bpy.types.Panel):
bl_idname = 'ANTON_PT_panel'
bl_label = 'anton'
bl_category = 'anton'
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
def draw(self, context):
layout = self.layout
scene = context.scene
row = layout.row()
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, 'workspace_path')
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, "number_of_forces")
rowsub.operator('anton.forceupdate', icon='ADD')
for item in scene.forceprop:
row = layout.row()
row.label(text=' ')
row.prop(item, 'magnitude')
scene.forced_magnitudes['FORCE_{}'.format(item.name)] = item.magnitude
row.operator('anton.directionupdate', icon='EMPTY_ARROWS').force_id = 'FORCE_{}'.format(item.name)
col = layout.column()
col.operator('anton.define', text='Define')
row = layout.row()
row.label(text=" ")
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, 'material')
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, "res")
row = layout.row(align=True)
row.prop(scene.anton, "mode", icon='NONE', expand=True,
slider=True, toggle=False, icon_only=False, event=False,
full_event=False, emboss=True)
if scene.anton.mode == 'WIREFRAME':
row.prop(scene.anton, "wireframe_thickness")
row.prop(scene.anton, "wireframe_gridsize")
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, "volumina_ratio")
rowsub.prop(scene.anton, "penalty_exponent")
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, "fixed_threshold")
rowsub.prop(scene.anton, "forced_threshold")
rowsub = layout.row(align=True)
rowsub.alignment = 'CENTER'
rowsub.prop(scene.anton, "include_forced")
rowsub.prop(scene.anton, "include_fixed")
if scene.anton.include_fixed or scene.anton.include_forced:
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, 'nds_density')
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, 'number_of_iterations')
rowsub = layout.row(align=True)
rowsub.alignment = 'CENTER'
rowsub.prop(scene.anton, "advanced_params")
if scene.anton.advanced_params:
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, "objective_threshold")
rowsub.prop(scene.anton, "step_limit")
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, "fraction_to_keep")
rowsub.prop(scene.anton, "cg_tolerance")
rowsub.prop(scene.anton, "active_threshold")
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, "cg_max_iterations")
rowsub.prop(scene.anton, "boundary_smoothing_iters")
rowsub.prop(scene.anton, "smoothing_iters")
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, "minimum_density")
rowsub.prop(scene.anton, "minimum_stiffness")
rowsub = layout.row(align=True)
rowsub.alignment = 'CENTER'
rowsub.prop(scene.anton, "exclude_fixed_cells")
rowsub = layout.row(align=True)
rowsub.operator('anton.process')
row = layout.row()
row.label(text=" ")
rowsub = layout.row(align=True)
rowsub.prop(scene.anton, "density_out")
rowsub.prop(scene.anton, 'viz_iteration')
rowsub = layout.row(align=True)
rowsub.operator('anton.visualize')
row = layout.row()
row.label(text=" ")
row = layout.row(align=True)
row.alignment = 'RIGHT'
row.label(text="Made with")
row.label(icon='FUND')