Export UV Layout: fix property descriptions
[blender-addons.git] / materials_utils / preferences.py
blob14fb00d0b13efaf7bd94e37b82616fa7f8d7edac
1 # SPDX-FileCopyrightText: 2019-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 import bpy
7 from bpy.types import (
8 AddonPreferences,
9 PropertyGroup,
11 from bpy.props import (
12 StringProperty,
13 BoolProperty,
14 EnumProperty,
15 IntProperty,
16 FloatProperty
18 from math import radians
20 from .enum_values import *
22 # Addon Preferences
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',
35 description = '',
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,
42 default = 'TOGGLE'
44 fake_user_affect: EnumProperty(
45 name = "Affect",
46 description = "Which materials of objects to affect",
47 items = mu_fake_user_affect_enums,
48 default = 'UNUSED'
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,
54 default = 'OBJECT'
56 link_to_affect: EnumProperty(
57 name = "Affect",
58 description = "Which materials of objects to affect by default with Change Material Link",
59 items = mu_link_affect_enums,
60 default = 'SELECTED'
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'",
67 min = 0,
68 default = 0
72 def draw(self, context):
73 layout = self.layout
74 layout.use_property_split = True
76 box = layout.box()
77 box.label(text = "Defaults")
79 a = box.box()
80 a.label(text = "Assign Material")
81 a.prop(self, "new_material_name", icon = "MATERIAL")
82 a.prop(self, "override_type", expand = False)
84 b = box.box()
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)
89 c = box.box()
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)
94 box = layout.box()
95 box.label(text = "Miscellaneous")
97 #col = box.column()
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