simplex-solver 3.0.18__37-abi3-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pysimplex.pyd +0 -0
- simplex_solver-3.0.18.dist-info/METADATA +87 -0
- simplex_solver-3.0.18.dist-info/RECORD +81 -0
- simplex_solver-3.0.18.dist-info/WHEEL +5 -0
- simplex_solver-3.0.18.dist-info/licenses/LICENSE +165 -0
- simplexui/__init__.py +54 -0
- simplexui/channelBox.py +862 -0
- simplexui/comboCheckDialog.py +335 -0
- simplexui/commands/__init__.py +16 -0
- simplexui/commands/alembicCommon.py +1045 -0
- simplexui/commands/applyCorrectives.py +455 -0
- simplexui/commands/buildIceXML.py +443 -0
- simplexui/commands/correctiveInterface.py +271 -0
- simplexui/commands/expandedExport.py +435 -0
- simplexui/commands/hdf5Convert.py +62 -0
- simplexui/commands/mayaCorrectiveInterface.py +164 -0
- simplexui/commands/mesh.py +1086 -0
- simplexui/commands/reorderSimplexPoints.py +103 -0
- simplexui/commands/rigidAlign.py +103 -0
- simplexui/commands/setDelta.xsicompound +60 -0
- simplexui/commands/smpxBlend.py +634 -0
- simplexui/commands/unsubdivide.py +1232 -0
- simplexui/commands/uvTransfer.py +986 -0
- simplexui/commands/xsiCorrectiveInterface.py +136 -0
- simplexui/dragFilter.py +299 -0
- simplexui/falloffDialog.py +476 -0
- simplexui/img/ChefHead.png +0 -0
- simplexui/img/frozen.png +0 -0
- simplexui/interface/__init__.py +30 -0
- simplexui/interface/dummyInterface.py +1564 -0
- simplexui/interface/mayaInterface.py +3197 -0
- simplexui/interface/xsiInterface.py +2944 -0
- simplexui/interfaceModel.py +1040 -0
- simplexui/interfaceModelTrees.py +439 -0
- simplexui/interfaceModel_Test.py +259 -0
- simplexui/items/__init__.py +26 -0
- simplexui/items/accessor.py +217 -0
- simplexui/items/combo.py +855 -0
- simplexui/items/falloff.py +780 -0
- simplexui/items/group.py +295 -0
- simplexui/items/progression.py +745 -0
- simplexui/items/shape.py +444 -0
- simplexui/items/simplex.py +1747 -0
- simplexui/items/slider.py +741 -0
- simplexui/items/stack.py +156 -0
- simplexui/items/traversal.py +969 -0
- simplexui/main.pyw +22 -0
- simplexui/menu/__init__.py +73 -0
- simplexui/menu/dummyPlugins/__init__.py +16 -0
- simplexui/menu/genericPlugins/__init__.py +16 -0
- simplexui/menu/genericPlugins/_builtins.py +260 -0
- simplexui/menu/genericPlugins/checkPossibleCombos.py +47 -0
- simplexui/menu/genericPlugins/exportSplit.py +61 -0
- simplexui/menu/genericPlugins/showFalloffs.py +24 -0
- simplexui/menu/genericPlugins/showTraversals.py +24 -0
- simplexui/menu/genericPlugins/simplexUvTransfer.py +109 -0
- simplexui/menu/genericPlugins/unsubdivide.py +71 -0
- simplexui/menu/mayaPlugins/__init__.py +16 -0
- simplexui/menu/mayaPlugins/exportOther.py +45 -0
- simplexui/menu/mayaPlugins/extractProgressives.py +67 -0
- simplexui/menu/mayaPlugins/freezeCombo.py +251 -0
- simplexui/menu/mayaPlugins/generateShapeIncrementals.py +100 -0
- simplexui/menu/mayaPlugins/importObjs.py +196 -0
- simplexui/menu/mayaPlugins/linearizeTraversal.py +49 -0
- simplexui/menu/mayaPlugins/makeShelfBtn.py +69 -0
- simplexui/menu/mayaPlugins/relaxToSelection.py +77 -0
- simplexui/menu/mayaPlugins/reloadDefinition.py +34 -0
- simplexui/menu/mayaPlugins/snapToNeutral.py +74 -0
- simplexui/menu/mayaPlugins/softSelectToCluster.py +204 -0
- simplexui/menu/mayaPlugins/tweakMix.py +138 -0
- simplexui/menu/mayaPlugins/updateRestShape.py +107 -0
- simplexui/menu/xsiPlugins/__init__.py +16 -0
- simplexui/simplexDialog.py +1391 -0
- simplexui/travCheckDialog.py +393 -0
- simplexui/traversalDialog.py +277 -0
- simplexui/ui/comboCheckDialog.ui +475 -0
- simplexui/ui/falloffDialog.ui +243 -0
- simplexui/ui/simplexDialog.ui +1458 -0
- simplexui/ui/travCheckDialog.ui +488 -0
- simplexui/ui/traversalDialog.ui +532 -0
- simplexui/utils.py +320 -0
simplexui/items/group.py
ADDED
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
# Copyright 2016, Blur Studio
|
|
2
|
+
#
|
|
3
|
+
# This file is part of Simplex.
|
|
4
|
+
#
|
|
5
|
+
# Simplex is free software: you can redistribute it and/or modify
|
|
6
|
+
# it under the terms of the GNU Lesser General Public License as published by
|
|
7
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
8
|
+
# (at your option) any later version.
|
|
9
|
+
#
|
|
10
|
+
# Simplex is distributed in the hope that it will be useful,
|
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
# GNU Lesser General Public License for more details.
|
|
14
|
+
#
|
|
15
|
+
# You should have received a copy of the GNU Lesser General Public License
|
|
16
|
+
# along with Simplex. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
+
|
|
18
|
+
# pylint:disable=missing-docstring,unused-argument,no-self-use
|
|
19
|
+
from Qt.QtGui import QColor
|
|
20
|
+
from ..utils import nested
|
|
21
|
+
from .accessor import SimplexAccessor
|
|
22
|
+
from .stack import stackable
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class Group(SimplexAccessor):
|
|
26
|
+
"""Groups organize Simplex items
|
|
27
|
+
|
|
28
|
+
Groups have no purpose in the solver. They don't do anything other than organize
|
|
29
|
+
the items in a system.
|
|
30
|
+
|
|
31
|
+
Each group can hold only one type of item (Slider, Combo, or Traversal)
|
|
32
|
+
|
|
33
|
+
Parameters
|
|
34
|
+
----------
|
|
35
|
+
name : str
|
|
36
|
+
The name of the group
|
|
37
|
+
simplex : Simplex
|
|
38
|
+
The Simplex system
|
|
39
|
+
groupType : type
|
|
40
|
+
The type that this group can hold
|
|
41
|
+
color : QColor
|
|
42
|
+
The color of this item in the Ui
|
|
43
|
+
|
|
44
|
+
Returns
|
|
45
|
+
-------
|
|
46
|
+
|
|
47
|
+
"""
|
|
48
|
+
|
|
49
|
+
classDepth = 1
|
|
50
|
+
|
|
51
|
+
def __init__(self, name, simplex, groupType, color=QColor(128, 128, 128)):
|
|
52
|
+
super(Group, self).__init__(simplex)
|
|
53
|
+
from .combo import Combo
|
|
54
|
+
from .slider import Slider
|
|
55
|
+
from .traversal import Traversal
|
|
56
|
+
|
|
57
|
+
with self.stack.store(self):
|
|
58
|
+
self._name = name
|
|
59
|
+
self.items = []
|
|
60
|
+
self._buildIdx = None
|
|
61
|
+
self.expanded = {}
|
|
62
|
+
self.color = color
|
|
63
|
+
self.groupType = groupType
|
|
64
|
+
|
|
65
|
+
mgrs = [
|
|
66
|
+
model.insertItemManager(simplex, row=self._getInsertionRow())
|
|
67
|
+
for model in self.models
|
|
68
|
+
]
|
|
69
|
+
with nested(*mgrs):
|
|
70
|
+
if self.groupType is Slider:
|
|
71
|
+
self.simplex.sliderGroups.append(self)
|
|
72
|
+
elif self.groupType is Combo:
|
|
73
|
+
self.simplex.comboGroups.append(self)
|
|
74
|
+
elif self.groupType is Traversal:
|
|
75
|
+
self.simplex.traversalGroups.append(self)
|
|
76
|
+
|
|
77
|
+
def _getInsertionRow(self):
|
|
78
|
+
""" """
|
|
79
|
+
from .combo import Combo
|
|
80
|
+
from .slider import Slider
|
|
81
|
+
from .traversal import Traversal
|
|
82
|
+
|
|
83
|
+
c = len(self.simplex.sliderGroups)
|
|
84
|
+
if self.groupType is Slider:
|
|
85
|
+
return c
|
|
86
|
+
c += len(self.simplex.comboGroups)
|
|
87
|
+
if self.groupType is Combo:
|
|
88
|
+
return c
|
|
89
|
+
c += len(self.simplex.traversalGroups)
|
|
90
|
+
if self.groupType is Traversal:
|
|
91
|
+
return c
|
|
92
|
+
|
|
93
|
+
@property
|
|
94
|
+
def name(self):
|
|
95
|
+
"""Get the name of the Group"""
|
|
96
|
+
return self._name
|
|
97
|
+
|
|
98
|
+
@name.setter
|
|
99
|
+
@stackable
|
|
100
|
+
def name(self, value):
|
|
101
|
+
"""Set the name of the Group
|
|
102
|
+
|
|
103
|
+
Parameters
|
|
104
|
+
----------
|
|
105
|
+
value :
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
Returns
|
|
109
|
+
-------
|
|
110
|
+
|
|
111
|
+
"""
|
|
112
|
+
self._name = value
|
|
113
|
+
for model in self.models:
|
|
114
|
+
model.itemDataChanged(self)
|
|
115
|
+
|
|
116
|
+
def treeChild(self, row):
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
Parameters
|
|
120
|
+
----------
|
|
121
|
+
row :
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
Returns
|
|
125
|
+
-------
|
|
126
|
+
|
|
127
|
+
"""
|
|
128
|
+
return self.items[row]
|
|
129
|
+
|
|
130
|
+
def treeRow(self):
|
|
131
|
+
""" """
|
|
132
|
+
return self.simplex.groups.index(self)
|
|
133
|
+
|
|
134
|
+
def treeParent(self):
|
|
135
|
+
""" """
|
|
136
|
+
return self.simplex
|
|
137
|
+
|
|
138
|
+
def treeChildCount(self):
|
|
139
|
+
""" """
|
|
140
|
+
return len(self.items)
|
|
141
|
+
|
|
142
|
+
@classmethod
|
|
143
|
+
def createGroup(cls, name, simplex, things=None, groupType=None):
|
|
144
|
+
"""Convenience method for creating a group
|
|
145
|
+
|
|
146
|
+
Parameters
|
|
147
|
+
----------
|
|
148
|
+
name : str
|
|
149
|
+
The name to give the new Group
|
|
150
|
+
simpelx : Simplex
|
|
151
|
+
The Simplex system
|
|
152
|
+
things : [object
|
|
153
|
+
The things to add to this Group (Default value = None)
|
|
154
|
+
groupType : type
|
|
155
|
+
The type that the new Group can hold (Default value = None)
|
|
156
|
+
simplex :
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
Returns
|
|
160
|
+
-------
|
|
161
|
+
|
|
162
|
+
"""
|
|
163
|
+
g = cls(name, simplex, groupType)
|
|
164
|
+
if things is not None:
|
|
165
|
+
g.take(things)
|
|
166
|
+
return g
|
|
167
|
+
|
|
168
|
+
@classmethod
|
|
169
|
+
def loadV2(cls, simplex, data):
|
|
170
|
+
"""Load the data from a version2 formatted json dictionary
|
|
171
|
+
|
|
172
|
+
Parameters
|
|
173
|
+
----------
|
|
174
|
+
simplex : Simplex
|
|
175
|
+
The Simplex system that's being built
|
|
176
|
+
data : dict
|
|
177
|
+
The chunk of the json dict used to build this object
|
|
178
|
+
|
|
179
|
+
Returns
|
|
180
|
+
-------
|
|
181
|
+
: Group
|
|
182
|
+
The specified Group
|
|
183
|
+
|
|
184
|
+
"""
|
|
185
|
+
from .combo import Combo
|
|
186
|
+
from .slider import Slider
|
|
187
|
+
from .traversal import Traversal
|
|
188
|
+
|
|
189
|
+
name = data["name"]
|
|
190
|
+
color = data.get("color", (0, 0, 0))
|
|
191
|
+
typeName = data["type"]
|
|
192
|
+
if typeName == "Slider":
|
|
193
|
+
groupType = Slider
|
|
194
|
+
elif typeName == "Combo":
|
|
195
|
+
groupType = Combo
|
|
196
|
+
elif typeName == "Traversal":
|
|
197
|
+
groupType = Traversal
|
|
198
|
+
else:
|
|
199
|
+
raise RuntimeError("Malformed simplex json string: Improper group type")
|
|
200
|
+
return cls(name, simplex, groupType, QColor(*color))
|
|
201
|
+
|
|
202
|
+
def buildDefinition(self, simpDict, legacy):
|
|
203
|
+
"""Output a dictionary definition of this object
|
|
204
|
+
|
|
205
|
+
Parameters
|
|
206
|
+
----------
|
|
207
|
+
simpDict : dict
|
|
208
|
+
The dictionary that is being built
|
|
209
|
+
legacy : bool
|
|
210
|
+
Whether to write out the legacy definition, or the newer one
|
|
211
|
+
|
|
212
|
+
Returns
|
|
213
|
+
-------
|
|
214
|
+
|
|
215
|
+
"""
|
|
216
|
+
if self._buildIdx is None:
|
|
217
|
+
self._buildIdx = len(simpDict["groups"])
|
|
218
|
+
if legacy:
|
|
219
|
+
simpDict.setdefault("groups", []).append(self.name)
|
|
220
|
+
else:
|
|
221
|
+
x = {
|
|
222
|
+
"name": self.name,
|
|
223
|
+
"color": self.color.getRgb()[:3],
|
|
224
|
+
"type": self.groupType.__name__,
|
|
225
|
+
}
|
|
226
|
+
simpDict.setdefault("groups", []).append(x)
|
|
227
|
+
return self._buildIdx
|
|
228
|
+
|
|
229
|
+
def clearBuildIndex(self):
|
|
230
|
+
"""Clear the build index of this object
|
|
231
|
+
|
|
232
|
+
The buildIndex is stored when building a definition dictionary
|
|
233
|
+
that keeps track of its index for later referencing
|
|
234
|
+
|
|
235
|
+
Parameters
|
|
236
|
+
----------
|
|
237
|
+
|
|
238
|
+
Returns
|
|
239
|
+
-------
|
|
240
|
+
|
|
241
|
+
"""
|
|
242
|
+
self._buildIdx = None
|
|
243
|
+
|
|
244
|
+
@stackable
|
|
245
|
+
def delete(self):
|
|
246
|
+
"""Delete a group. Any objects in this group will be deleted"""
|
|
247
|
+
from .combo import Combo
|
|
248
|
+
from .slider import Slider
|
|
249
|
+
|
|
250
|
+
if self.groupType is Slider:
|
|
251
|
+
if len(self.simplex.sliderGroups) == 1:
|
|
252
|
+
return
|
|
253
|
+
gList = self.simplex.sliderGroups
|
|
254
|
+
elif self.groupType is Combo:
|
|
255
|
+
if len(self.simplex.comboGroups) == 1:
|
|
256
|
+
return
|
|
257
|
+
gList = self.simplex.comboGroups
|
|
258
|
+
else:
|
|
259
|
+
raise RuntimeError("Somehow this group has no type")
|
|
260
|
+
|
|
261
|
+
mgrs = [model.removeItemManager(self) for model in self.models]
|
|
262
|
+
with nested(*mgrs):
|
|
263
|
+
# Delete the children first
|
|
264
|
+
# Gotta iterate over copies of the lists
|
|
265
|
+
# as .delete removes the items from the list
|
|
266
|
+
for item in self.items[:]:
|
|
267
|
+
item.delete()
|
|
268
|
+
|
|
269
|
+
gList.remove(self)
|
|
270
|
+
|
|
271
|
+
@stackable
|
|
272
|
+
def take(self, things):
|
|
273
|
+
"""Remove some items from their current groups and put them in this one
|
|
274
|
+
|
|
275
|
+
Parameters
|
|
276
|
+
----------
|
|
277
|
+
things : [object
|
|
278
|
+
A list of things to put in this group
|
|
279
|
+
|
|
280
|
+
Returns
|
|
281
|
+
-------
|
|
282
|
+
|
|
283
|
+
"""
|
|
284
|
+
if self.groupType is None:
|
|
285
|
+
self.groupType = type(things[0])
|
|
286
|
+
|
|
287
|
+
if not all([isinstance(i, self.groupType) for i in things]):
|
|
288
|
+
raise ValueError(
|
|
289
|
+
"All items in this group must be of type: {}".format(self.groupType)
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
# do it this way instead of using set() to keep order
|
|
293
|
+
for thing in things:
|
|
294
|
+
if thing not in self.items:
|
|
295
|
+
thing.setGroup(self)
|