-
Notifications
You must be signed in to change notification settings - Fork 30
/
prefs.py
62 lines (50 loc) · 1.63 KB
/
prefs.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
import bpy
from bpy.props import BoolProperty, EnumProperty, FloatProperty, StringProperty
from addon_utils import check
# Addon prefs
class PBAKER_prefs(bpy.types.AddonPreferences):
bl_idname = __package__
switch_to_cycles: BoolProperty(
name="Bake in Eevee/Workbench (temporarily switch to Cycles)",
default=False
)
mat_id_algorithm: EnumProperty(
name="Material ID Colors by",
items=(
('HUE', 'Slot/Hue', ''),
('NAME', 'Material Name', ''),
),
default='HUE'
)
mat_id_saturation: FloatProperty(
name="Saturation",
default=1.0,
min=0.0,
max=1.0
)
mat_id_value: FloatProperty(
name="Value",
default=1.0,
min=0.0,
max=1.0
)
# use_node_wrangler : BoolProperty(
# name="Node Wrangler for Texture Setup",
# default=False
# )
def draw(self, context):
layout = self.layout
col = layout.column()
col.prop(self, "switch_to_cycles")
col.label(text="This may crash Blender!", icon='ERROR')
col.separator()
col.prop(self, "mat_id_algorithm")
if self.mat_id_algorithm == 'HUE':
col.prop(self, "mat_id_saturation")
col.prop(self, "mat_id_value")
elif self.mat_id_algorithm == 'NAME':
self.layout.label(
text="Duplicate colors are possible!", icon='ERROR')
# # Node Wrangler for Texture Setup
# if check("node_wrangler"):
# col.prop(self, "use_node_wrangler")