forked from fblah/ShapeKeyTransferBlender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuisettings.py
106 lines (93 loc) · 3.47 KB
/
uisettings.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
#----------------------------------------------------------
# File uisettings.py
#----------------------------------------------------------
#
# ShapeKeyTransfer - Copyright (C) 2018 Ajit Christopher D'Monte
#
# 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/>.
#
# ----------------------------------------------------------
import bpy
from bpy.props import (StringProperty,
BoolProperty,
IntProperty,
FloatProperty,
FloatVectorProperty,
EnumProperty,
PointerProperty,
)
from bpy.types import (Panel,
Operator,
PropertyGroup,
)
# Properties of the main part of the panel
# ----------------------------------------------------------
class UISettings(PropertyGroup):
"""Mesh Selection Boxes"""
src_mesh = PointerProperty(
type=bpy.types.Mesh,
name="Source Mesh",
description="Select a source mesh",
options={'ANIMATABLE'},
update=None
)
dest_mesh = PointerProperty(
type=bpy.types.Mesh,
name="Destination Mesh",
description="Select a destination mesh",
options={'ANIMATABLE'},
update=None
)
# Properties of the operator
# ----------------------------------------------------------
class TransferShapeKeysOperatorUI(PropertyGroup):
"""Transfer shape key operator options and properties"""
specify_end_vertex = BoolProperty(
name="Specify End Vertex",
description="Execute till last vertex specified.",
default = False
)
use_one_vertex = BoolProperty(
name="Use Closest Vertex",
description="Use the position of the closet vertex only or several vertices within the range.",
default = True
)
skip_unpaired_vertices = BoolProperty(
name="Skip unpaired vertices",
description="Use this to skip vertices which cant find naerby vertices in source mesh to copy position from.",
default = True
)
increment_radius = FloatProperty(
name = "Increment Radius",
description = "Radius to increment selection sphere.",
default = 0.05,
soft_min = 0.01,
soft_max = 1,
min = 0.00000001
)
number_of_increments = IntProperty(
name = "Number of increments",
description = "Number of times to increment selection radius before giving up.",
default = 2,
soft_min = 1,
soft_max = 50,
min = 1
)
# Property of 1 item in the excluded shape key list
# ----------------------------------------------------------
class ShapeKeyItem(PropertyGroup):
"""List box properties"""
#name = StringProperty() -> Instantiated by default
obj_type = StringProperty()
obj_id = IntProperty()