-
Notifications
You must be signed in to change notification settings - Fork 2
/
pbaker_prefs.py
68 lines (56 loc) · 1.81 KB
/
pbaker_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
63
64
65
66
67
68
import bpy
from addon_utils import check
from bpy.props import (StringProperty,
BoolProperty,
FloatProperty,
EnumProperty
)
# 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()
# 2.80
if bpy.app.version_string.startswith('2.8'):
col.prop(self, "switch_to_cycles")
col.label(text="This may crash Blender 2.80 beta!", 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")