-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.py
More file actions
79 lines (68 loc) · 2.79 KB
/
ui.py
File metadata and controls
79 lines (68 loc) · 2.79 KB
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
# ui.py
import bpy
from . import dependencies
class BF2M_PT_Panel(bpy.types.Panel):
"""The main UI Panel for the Batch Font To Mesh addon."""
bl_label = "Batch Font To Mesh"
bl_idname = "BF2M_PT_main_panel"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Tool"
def draw(self, context):
layout = self.layout
if not dependencies.are_dependencies_installed():
box = layout.box()
box.label(text="Dependencies Missing!", icon="ERROR")
box.label(text="Freetype-py failed to install.")
box.label(text="Check Blender's System Console for errors.")
return
props = context.scene.bf2m_props
# ==== Input & Status ====
box = layout.box()
box.label(text="1. Font Input", icon="FILE_FONT")
box.prop(props, "font_path")
box.operator("bf2m.prepare")
box = layout.box()
row = box.row()
row.label(text="Status:", icon=props.status_icon)
row.label(text=props.status_text)
if props.is_prepared:
box = layout.box()
box.label(text="Live Preview Options", icon="TEXT")
box.prop(props, "preview_all_glyphs")
# The Grid Width property only shows up if the toggle is on.
if props.preview_all_glyphs:
box.prop(props, "preview_grid_width")
# ==== Live-Tweak Sections ====
box = layout.box()
box.label(text="2. Live Tweaking", icon="SETTINGS")
box.prop(props, "material_base")
box.prop(props, "material_bevel")
box.label(text="Text Geometry")
box.prop(props, "char_size")
box.prop(props, "char_extrude")
bevel_box = box.box()
bevel_box.label(text="Bevel")
bevel_box.prop(props, "bevel_depth")
bevel_box.prop(props, "bevel_resolution")
box.label(text="Transforms")
box.prop(props, "translation")
box.prop(props, "rotation")
box.label(text="Post-Processing Options")
post_proc_box = box.box()
col = post_proc_box.column()
row = col.row()
row.prop(props, "bevel_mode_sharp")
row.prop(props, "bevel_mode_vgroup")
row = col.row()
row.prop(props, "bevel_mode_material")
row.prop(props, "bevel_mode_vcolor")
doubles_row = post_proc_box.row()
doubles_row.prop(props, "remove_doubles")
if props.remove_doubles:
doubles_row.prop(props, "merge_distance")
box = layout.box()
box.label(text="3. Final Generation", icon="MOD_MESHDEFORM")
row = box.row()
row.scale_y = 1.5
row.operator("bf2m.generate")