1 # SPDX-FileCopyrightText: 2019-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
7 from bpy
.types
import (
11 from bpy
.props
import (
18 from math
import radians
20 from .enum_values
import *
23 class VIEW3D_MT_materialutilities_preferences(AddonPreferences
):
24 bl_idname
= __package__
26 new_material_name
: StringProperty(
27 name
= "New Material name",
28 description
= "What Base name pattern to use for a new created Material\n"
29 "It is appended by an automatic numeric pattern depending\n"
30 "on the number of Scene's materials containing the Base",
31 default
= "Unnamed Material",
33 override_type
: EnumProperty(
34 name
= 'Assignment method',
36 items
= mu_override_type_enums
38 fake_user
: EnumProperty(
39 name
= "Set Fake User",
40 description
= "Default option for the Set Fake User (Turn fake user on or off)",
41 items
= mu_fake_user_set_enums
,
44 fake_user_affect
: EnumProperty(
46 description
= "Which materials of objects to affect",
47 items
= mu_fake_user_affect_enums
,
50 link_to
: EnumProperty(
51 name
= "Change Material Link To",
52 description
= "Default option for the Change Material Link operator",
53 items
= mu_link_to_enums
,
56 link_to_affect
: EnumProperty(
58 description
= "Which materials of objects to affect by default with Change Material Link",
59 items
= mu_link_affect_enums
,
62 search_show_limit
: IntProperty(
63 name
= "Show 'Search' Limit",
64 description
= "How many materials should there be before the 'Search' option is shown "
65 "in the Assign Material and Select By Material menus\n"
66 "Set it to 0 to always show 'Search'",
71 set_smooth_affect
: EnumProperty(
72 name
= "Set Auto Smooth Affect",
73 description
= "Which objects to affect",
74 items
= mu_affect_enums
,
77 auto_smooth_angle
: FloatProperty(
78 name
= "Auto Smooth Angle",
79 description
= "Maximum angle between face normals that will be considered as smooth",
86 def draw(self
, context
):
88 layout
.use_property_split
= True
91 box
.label(text
= "Defaults")
94 a
.label(text
= "Assign Material")
95 a
.prop(self
, "new_material_name", icon
= "MATERIAL")
96 a
.prop(self
, "override_type", expand
= False)
99 b
.label(text
= "Set Fake User")
100 b
.row().prop(self
, "fake_user", expand
= False)
101 b
.row().prop(self
, "fake_user_affect", expand
= False)
104 c
.label(text
= "Set Link To")
105 c
.row().prop(self
, "link_to", expand
= False)
106 c
.row().prop(self
, "link_to_affect", expand
= False)
109 d
.label(text
= "Set Auto Smooth")
110 d
.row().prop(self
, "auto_smooth_angle", expand
= False)
111 d
.row().prop(self
, "set_smooth_affect", expand
= False)
114 box
.label(text
= "Miscellaneous")
117 #row = col.split(factor = 0.5)
118 box
.prop(self
, "search_show_limit", expand
= False)
121 def materialutilities_get_preferences(context
):
122 return context
.preferences
.addons
[__package__
].preferences