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'",
72 def draw(self
, context
):
74 layout
.use_property_split
= True
77 box
.label(text
= "Defaults")
80 a
.label(text
= "Assign Material")
81 a
.prop(self
, "new_material_name", icon
= "MATERIAL")
82 a
.prop(self
, "override_type", expand
= False)
85 b
.label(text
= "Set Fake User")
86 b
.row().prop(self
, "fake_user", expand
= False)
87 b
.row().prop(self
, "fake_user_affect", expand
= False)
90 c
.label(text
= "Set Link To")
91 c
.row().prop(self
, "link_to", expand
= False)
92 c
.row().prop(self
, "link_to_affect", expand
= False)
95 box
.label(text
= "Miscellaneous")
98 #row = col.split(factor = 0.5)
99 box
.prop(self
, "search_show_limit", expand
= False)
102 def materialutilities_get_preferences(context
):
103 return context
.preferences
.addons
[__package__
].preferences