-
Notifications
You must be signed in to change notification settings - Fork 13
/
import_options.py
132 lines (92 loc) · 4 KB
/
import_options.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# TODO: remove class
class ImportOptions:
defaults = {}
defaults["remove_doubles"] = True
remove_doubles = defaults["remove_doubles"]
defaults["recalculate_normals"] = False
recalculate_normals = defaults["recalculate_normals"]
defaults["merge_distance"] = 0.05
merge_distance = defaults["merge_distance"]
defaults["triangulate"] = False
triangulate = defaults["triangulate"]
defaults["meta_bfc"] = True
meta_bfc = defaults["meta_bfc"]
defaults["meta_group"] = True
meta_group = defaults["meta_group"]
defaults["meta_print_write"] = False
meta_print_write = defaults["meta_print_write"]
defaults["meta_step"] = False
meta_step = defaults["meta_step"]
defaults["meta_step_groups"] = False
meta_step_groups = defaults["meta_step_groups"]
defaults["meta_clear"] = False
meta_clear = defaults["meta_clear"]
defaults["meta_pause"] = False
meta_pause = defaults["meta_pause"]
defaults["meta_save"] = False
meta_save = defaults["meta_save"]
defaults["meta_texmap"] = True
meta_texmap = defaults["meta_texmap"]
defaults["display_logo"] = False
display_logo = defaults["display_logo"]
# cast items as list or "EnumProperty(..., default='logo3'): not found in enum members" and a messed up menu
chosen_logo_choices = list(((logo, logo, logo) for logo in ["logo", "logo2", "logo3", "logo4", "logo5", "high-contrast"]))
defaults["chosen_logo"] = 2
chosen_logo = defaults["chosen_logo"]
@staticmethod
def chosen_logo_value():
return ImportOptions.chosen_logo_choices[ImportOptions.chosen_logo][0]
defaults["shade_smooth"] = True
shade_smooth = defaults["shade_smooth"]
defaults["make_gaps"] = True
make_gaps = defaults["make_gaps"]
defaults["gap_scale"] = 0.997
gap_scale = defaults["gap_scale"]
defaults["no_studs"] = False
no_studs = defaults["no_studs"]
defaults["set_end_frame"] = True
set_end_frame = defaults["set_end_frame"]
defaults["starting_step_frame"] = 1
starting_step_frame = defaults["starting_step_frame"]
defaults["frames_per_step"] = 3
frames_per_step = defaults["frames_per_step"]
defaults["set_timeline_markers"] = False
set_timeline_markers = defaults["set_timeline_markers"]
smooth_type_choices = (
("edge_split", "Edge split", "Use an edge split modifier"),
("auto_smooth", "Auto smooth", "Use auto smooth"),
("bmesh_split", "bmesh smooth", "Split while processing bmesh"),
)
defaults["smooth_type"] = 0
smooth_type = defaults["smooth_type"]
@staticmethod
def smooth_type_value():
return ImportOptions.smooth_type_choices[ImportOptions.smooth_type][0]
defaults["import_edges"] = False
import_edges = defaults["import_edges"]
defaults["bevel_edges"] = False
bevel_edges = defaults["bevel_edges"]
defaults["bevel_weight"] = 0.03
bevel_weight = defaults["bevel_weight"]
defaults["bevel_width"] = 0.3
bevel_width = defaults["bevel_width"]
defaults["bevel_segments"] = 4
bevel_segments = defaults["bevel_segments"]
defaults["use_freestyle_edges"] = False
use_freestyle_edges = defaults["use_freestyle_edges"]
defaults["import_scale"] = 0.02
import_scale = defaults["import_scale"]
defaults["parent_to_empty"] = False # True False
parent_to_empty = defaults["parent_to_empty"]
defaults["treat_shortcut_as_model"] = False # TODO: if true parent to empty at median of group
treat_shortcut_as_model = defaults["treat_shortcut_as_model"]
scale_strategy_choices = (
("mesh", "Scale mesh", "Apply import scaling to mesh. Recommended for rendering"),
("object", "Scale object", "Apply import scaling to object. Recommended for part editing"),
)
defaults["scale_strategy"] = 1
defaults["scale_strategy"] = 0
scale_strategy = defaults["scale_strategy"]
@staticmethod
def scale_strategy_value():
return ImportOptions.scale_strategy_choices[ImportOptions.scale_strategy][0]