-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathpreferences.py
116 lines (101 loc) · 3.46 KB
/
preferences.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ##### END GPL LICENSE BLOCK #####
import bpy
import math
from . import types
class YAVNEPrefs(bpy.types.AddonPreferences):
bl_idname = __package__.split('.')[0]
vertex_normal_weight: types.VertexNormalWeight.create_property()
face_normal_influence: types.FaceNormalInfluence.create_property()
source: bpy.props.StringProperty(
name = 'Shading Source',
description = 'Source object from which to transfer interpolated normals'
)
available_sources: bpy.props.CollectionProperty(
type = bpy.types.PropertyGroup
)
normal_buffer: bpy.props.FloatVectorProperty(
name = 'Normal Vector Buffer',
description = 'Stored world space normal vector',
step = 1,
precision = 2,
size = 3,
subtype = 'XYZ'
)
merge_distance: bpy.props.FloatProperty(
name = 'Merge Distance',
description = 'Maximum allowed distance between merged vertex normals',
default = 0.0001,
min = 0.0001,
soft_max = 1.0,
step = 0.01,
precision = 4
)
merge_unselected: bpy.props.BoolProperty(
name = 'Unselected',
description = (
'Unselected vertex normals within given distance of selected ' +
'vertices are also merged'
),
default = False
)
show_update_options: bpy.props.BoolProperty(
name = 'Update Options',
description = 'Show/hide options for updating vertex normals',
default = False
)
use_linked_face_weights: bpy.props.BoolProperty(
name = 'Linked Face Weights',
description = (
'Factor linked face areas into the calculation of face weighted ' +
'vertex normals'
),
default = True
)
link_angle: bpy.props.FloatProperty(
name = 'Link Angle',
description = (
'Maximum angle between faces to be considered as linked\n\n' +
'e.g. Coplanar faces have a link angle of zero degrees'
),
default = math.radians(2.0),
min = 0.0,
max = math.pi,
step = 10,
precision = 1,
subtype = 'ANGLE'
)
use_auto_smooth: bpy.props.BoolProperty(
name = 'Auto Smooth',
description = 'Auto smooth based on angle between faces',
default = True
)
smooth_angle: bpy.props.FloatProperty(
name = 'Smooth Angle',
description = 'Maximum angle between faces to be considered as smooth',
default = math.radians(89.9),
min = 0.0,
max = math.pi,
step = 10,
precision = 1,
subtype = 'ANGLE'
)
use_flat_faces: bpy.props.BoolProperty(
name = 'Flat Face Shading',
description = 'Preserves shading discontinuities caused by flat faces',
default = False
)