-
Notifications
You must be signed in to change notification settings - Fork 0
/
material_gui.py
64 lines (54 loc) · 1.97 KB
/
material_gui.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
import bpy
from . import material_operators
from . import addon_updater_ops
class MaterialSettings(bpy.types.PropertyGroup):
NoSpec : bpy.props.BoolProperty(
name="No specular & metallic",
description="Zero out specular & metallic",
default=True
)
Additive : bpy.props.BoolProperty(
name="Additive",
description="Make it additive also!",
default=False
)
Transparent : bpy.props.BoolProperty(
name="Transparent",
description="Make it Transparent also!",
default=False
)
class ZODEUTILS_MATERIALS(bpy.types.Panel):
bl_label="Zode's utils"
bl_idname = "OBJECT_PT_ZODEUTILS_MATERIALS"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "material"
def draw(self, context):
self.layout.label(text="Goldsrc specific:")
box = self.layout.box()
box.label(text="Import materials:")
row = box.row()
row.operator("zodeutils.goldsrc_material_import", icon="SHADING_TEXTURE")
row.operator("zodeutils.goldsrc_material_import_all", icon="SHADING_TEXTURE")
self.layout.label(text="Common:")
box = self.layout.box()
box.label(text="Swap selected material to:")
box.prop(context.scene.zodeutils_material, "NoSpec")
box.prop(context.scene.zodeutils_material, "Additive")
box.prop(context.scene.zodeutils_material, "Transparent")
row = box.row()
row.operator("zodeutils.material_to_diffuse", icon="SHADING_SOLID")
row.operator("zodeutils.material_to_matcap", icon="SHADING_RENDERED")
addon_updater_ops.check_for_update_background()
if addon_updater_ops.updater.update_ready:
addon_updater_ops.update_notice_box_ui(self, context)
def register():
bpy.utils.register_class(MaterialSettings)
bpy.types.Scene.zodeutils_material = bpy.props.PointerProperty(type=MaterialSettings)
bpy.utils.register_class(ZODEUTILS_MATERIALS)
material_operators.register()
def unregister():
del bpy.types.Scene.zodeutils_material
bpy.utils.unregister_class(MaterialSettings)
bpy.utils.unregister_class(ZODEUTILS_MATERIALS)
material_operators.unregister()