3 from bpy
.types
import (
7 from bpy
.props
import (
14 from math
import radians
16 from .enum_values
import *
19 class VIEW3D_MT_materialutilities_preferences(AddonPreferences
):
20 bl_idname
= __package__
22 new_material_name
: StringProperty(
23 name
= "New Material name",
24 description
= "What Base name pattern to use for a new created Material\n"
25 "It is appended by an automatic numeric pattern depending\n"
26 "on the number of Scene's materials containing the Base",
27 default
= "Unnamed Material",
29 override_type
: EnumProperty(
30 name
= 'Assignment method',
32 items
= mu_override_type_enums
34 fake_user
: EnumProperty(
35 name
= "Set Fake User",
36 description
= "Default option for the Set Fake User (Turn fake user on or off)",
37 items
= mu_fake_user_set_enums
,
40 fake_user_affect
: EnumProperty(
42 description
= "Which materials of objects to affect",
43 items
= mu_fake_user_affect_enums
,
46 link_to
: EnumProperty(
47 name
= "Change Material Link To",
48 description
= "Default option for the Change Material Link operator",
49 items
= mu_link_to_enums
,
52 link_to_affect
: EnumProperty(
54 description
= "Which materials of objects to affect by default with Change Material Link",
55 items
= mu_link_affect_enums
,
58 search_show_limit
: IntProperty(
59 name
= "Show 'Search' Limit",
60 description
= "How many materials should there be before the 'Search' option is shown "
61 "in the Assign Material and Select By Material menus\n"
62 "Set it to 0 to always show 'Search'",
67 set_smooth_affect
: EnumProperty(
68 name
= "Set Auto Smooth Affect",
69 description
= "Which objects to affect",
70 items
= mu_affect_enums
,
73 auto_smooth_angle
: FloatProperty(
74 name
= "Auto Smooth Angle",
75 description
= "Maximum angle between face normals that will be considered as smooth",
82 def draw(self
, context
):
84 layout
.use_property_split
= True
87 box
.label(text
= "Defaults")
90 a
.label(text
= "Assign Material")
91 a
.prop(self
, "new_material_name", icon
= "MATERIAL")
92 a
.prop(self
, "override_type", expand
= False)
95 b
.label(text
= "Set Fake User")
96 b
.row().prop(self
, "fake_user", expand
= False)
97 b
.row().prop(self
, "fake_user_affect", expand
= False)
100 c
.label(text
= "Set Link To")
101 c
.row().prop(self
, "link_to", expand
= False)
102 c
.row().prop(self
, "link_to_affect", expand
= False)
105 d
.label(text
= "Set Auto Smooth")
106 d
.row().prop(self
, "auto_smooth_angle", expand
= False)
107 d
.row().prop(self
, "set_smooth_affect", expand
= False)
110 box
.label(text
= "Miscellaneous")
113 #row = col.split(factor = 0.5)
114 box
.prop(self
, "search_show_limit", expand
= False)
117 def materialutilities_get_preferences(context
):
118 return context
.preferences
.addons
[__package__
].preferences