1 # SPDX-License-Identifier: GPL-2.0-or-later
5 from bpy
.types
import (
9 from bpy
.props
import (
16 from math
import radians
18 from .enum_values
import *
21 class VIEW3D_MT_materialutilities_preferences(AddonPreferences
):
22 bl_idname
= __package__
24 new_material_name
: StringProperty(
25 name
= "New Material name",
26 description
= "What Base name pattern to use for a new created Material\n"
27 "It is appended by an automatic numeric pattern depending\n"
28 "on the number of Scene's materials containing the Base",
29 default
= "Unnamed Material",
31 override_type
: EnumProperty(
32 name
= 'Assignment method',
34 items
= mu_override_type_enums
36 fake_user
: EnumProperty(
37 name
= "Set Fake User",
38 description
= "Default option for the Set Fake User (Turn fake user on or off)",
39 items
= mu_fake_user_set_enums
,
42 fake_user_affect
: EnumProperty(
44 description
= "Which materials of objects to affect",
45 items
= mu_fake_user_affect_enums
,
48 link_to
: EnumProperty(
49 name
= "Change Material Link To",
50 description
= "Default option for the Change Material Link operator",
51 items
= mu_link_to_enums
,
54 link_to_affect
: EnumProperty(
56 description
= "Which materials of objects to affect by default with Change Material Link",
57 items
= mu_link_affect_enums
,
60 search_show_limit
: IntProperty(
61 name
= "Show 'Search' Limit",
62 description
= "How many materials should there be before the 'Search' option is shown "
63 "in the Assign Material and Select By Material menus\n"
64 "Set it to 0 to always show 'Search'",
69 set_smooth_affect
: EnumProperty(
70 name
= "Set Auto Smooth Affect",
71 description
= "Which objects to affect",
72 items
= mu_affect_enums
,
75 auto_smooth_angle
: FloatProperty(
76 name
= "Auto Smooth Angle",
77 description
= "Maximum angle between face normals that will be considered as smooth",
84 def draw(self
, context
):
86 layout
.use_property_split
= True
89 box
.label(text
= "Defaults")
92 a
.label(text
= "Assign Material")
93 a
.prop(self
, "new_material_name", icon
= "MATERIAL")
94 a
.prop(self
, "override_type", expand
= False)
97 b
.label(text
= "Set Fake User")
98 b
.row().prop(self
, "fake_user", expand
= False)
99 b
.row().prop(self
, "fake_user_affect", expand
= False)
102 c
.label(text
= "Set Link To")
103 c
.row().prop(self
, "link_to", expand
= False)
104 c
.row().prop(self
, "link_to_affect", expand
= False)
107 d
.label(text
= "Set Auto Smooth")
108 d
.row().prop(self
, "auto_smooth_angle", expand
= False)
109 d
.row().prop(self
, "set_smooth_affect", expand
= False)
112 box
.label(text
= "Miscellaneous")
115 #row = col.split(factor = 0.5)
116 box
.prop(self
, "search_show_limit", expand
= False)
119 def materialutilities_get_preferences(context
):
120 return context
.preferences
.addons
[__package__
].preferences