simplex-solver 3.1.0__39-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.
Files changed (79) hide show
  1. simplex_solver-3.1.0.dist-info/METADATA +90 -0
  2. simplex_solver-3.1.0.dist-info/RECORD +79 -0
  3. simplex_solver-3.1.0.dist-info/WHEEL +5 -0
  4. simplexui/__init__.py +53 -0
  5. simplexui/_version.py +1 -0
  6. simplexui/channelBox.py +858 -0
  7. simplexui/comboCheckDialog.py +343 -0
  8. simplexui/commands/__init__.py +16 -0
  9. simplexui/commands/alembicCommon.py +991 -0
  10. simplexui/commands/applyCorrectives.py +451 -0
  11. simplexui/commands/correctiveInterface.py +261 -0
  12. simplexui/commands/expandedExport.py +436 -0
  13. simplexui/commands/hdf5Convert.py +60 -0
  14. simplexui/commands/mayaCorrectiveInterface.py +161 -0
  15. simplexui/commands/mayatonumpy.py +375 -0
  16. simplexui/commands/mesh.py +1081 -0
  17. simplexui/commands/numpytoimath.py +319 -0
  18. simplexui/commands/poseblendlib.py +166 -0
  19. simplexui/commands/reorderSimplexPoints.py +102 -0
  20. simplexui/commands/rigidAlign.py +99 -0
  21. simplexui/commands/smpxBlend.py +629 -0
  22. simplexui/commands/unsubdivide.py +1227 -0
  23. simplexui/commands/uvTransfer.py +977 -0
  24. simplexui/dragFilter.py +299 -0
  25. simplexui/falloffDialog.py +471 -0
  26. simplexui/img/ChefHead.png +0 -0
  27. simplexui/img/frozen.png +0 -0
  28. simplexui/interface/__init__.py +28 -0
  29. simplexui/interface/dummyInterface.py +1585 -0
  30. simplexui/interface/mayaInterface.py +3271 -0
  31. simplexui/interfaceModel.py +1053 -0
  32. simplexui/interfaceModelTrees.py +441 -0
  33. simplexui/items/__init__.py +42 -0
  34. simplexui/items/accessor.py +213 -0
  35. simplexui/items/combo.py +852 -0
  36. simplexui/items/falloff.py +778 -0
  37. simplexui/items/group.py +297 -0
  38. simplexui/items/progression.py +743 -0
  39. simplexui/items/shape.py +443 -0
  40. simplexui/items/simplex.py +1764 -0
  41. simplexui/items/slider.py +738 -0
  42. simplexui/items/stack.py +154 -0
  43. simplexui/items/traversal.py +966 -0
  44. simplexui/main.pyw +22 -0
  45. simplexui/menu/__init__.py +69 -0
  46. simplexui/menu/dummyPlugins/__init__.py +16 -0
  47. simplexui/menu/genericPlugins/__init__.py +16 -0
  48. simplexui/menu/genericPlugins/_builtins.py +268 -0
  49. simplexui/menu/genericPlugins/checkPossibleCombos.py +45 -0
  50. simplexui/menu/genericPlugins/exportSplit.py +59 -0
  51. simplexui/menu/genericPlugins/showFalloffs.py +24 -0
  52. simplexui/menu/genericPlugins/showTraversals.py +24 -0
  53. simplexui/menu/genericPlugins/simplexUvTransfer.py +107 -0
  54. simplexui/menu/genericPlugins/unsubdivide.py +70 -0
  55. simplexui/menu/mayaPlugins/__init__.py +16 -0
  56. simplexui/menu/mayaPlugins/exportOther.py +43 -0
  57. simplexui/menu/mayaPlugins/extractProgressives.py +65 -0
  58. simplexui/menu/mayaPlugins/freezeCombo.py +245 -0
  59. simplexui/menu/mayaPlugins/generateShapeIncrementals.py +97 -0
  60. simplexui/menu/mayaPlugins/importObjs.py +193 -0
  61. simplexui/menu/mayaPlugins/linearizeTraversal.py +48 -0
  62. simplexui/menu/mayaPlugins/makeShelfBtn.py +65 -0
  63. simplexui/menu/mayaPlugins/relaxToSelection.py +75 -0
  64. simplexui/menu/mayaPlugins/reloadDefinition.py +33 -0
  65. simplexui/menu/mayaPlugins/snapToNeutral.py +72 -0
  66. simplexui/menu/mayaPlugins/softSelectToCluster.py +200 -0
  67. simplexui/menu/mayaPlugins/tweakMix.py +134 -0
  68. simplexui/menu/mayaPlugins/updateRestShape.py +105 -0
  69. simplexui/pysimplex.dll.a +0 -0
  70. simplexui/pysimplex.pyd +0 -0
  71. simplexui/simplexDialog.py +1454 -0
  72. simplexui/travCheckDialog.py +397 -0
  73. simplexui/traversalDialog.py +271 -0
  74. simplexui/ui/comboCheckDialog.ui +475 -0
  75. simplexui/ui/falloffDialog.ui +243 -0
  76. simplexui/ui/simplexDialog.ui +1458 -0
  77. simplexui/ui/travCheckDialog.ui +488 -0
  78. simplexui/ui/traversalDialog.ui +532 -0
  79. simplexui/utils.py +320 -0
@@ -0,0 +1,297 @@
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=None):
52
+ super(Group, self).__init__(simplex)
53
+ from .combo import Combo
54
+ from .slider import Slider
55
+ from .traversal import Traversal
56
+
57
+ color = QColor(128, 128, 128) if color is None else color
58
+
59
+ with self.stack.store(self):
60
+ self._name = name
61
+ self.items = []
62
+ self._buildIdx = None
63
+ self.expanded = {}
64
+ self.color = color
65
+ self.groupType = groupType
66
+
67
+ mgrs = [
68
+ model.insertItemManager(simplex, row=self._getInsertionRow())
69
+ for model in self.models
70
+ ]
71
+ with nested(*mgrs):
72
+ if self.groupType is Slider:
73
+ self.simplex.sliderGroups.append(self)
74
+ elif self.groupType is Combo:
75
+ self.simplex.comboGroups.append(self)
76
+ elif self.groupType is Traversal:
77
+ self.simplex.traversalGroups.append(self)
78
+
79
+ def _getInsertionRow(self):
80
+ """ """
81
+ from .combo import Combo
82
+ from .slider import Slider
83
+ from .traversal import Traversal
84
+
85
+ c = len(self.simplex.sliderGroups)
86
+ if self.groupType is Slider:
87
+ return c
88
+ c += len(self.simplex.comboGroups)
89
+ if self.groupType is Combo:
90
+ return c
91
+ c += len(self.simplex.traversalGroups)
92
+ if self.groupType is Traversal:
93
+ return c
94
+
95
+ @property
96
+ def name(self):
97
+ """Get the name of the Group"""
98
+ return self._name
99
+
100
+ @name.setter
101
+ @stackable
102
+ def name(self, value):
103
+ """Set the name of the Group
104
+
105
+ Parameters
106
+ ----------
107
+ value :
108
+
109
+
110
+ Returns
111
+ -------
112
+
113
+ """
114
+ self._name = value
115
+ for model in self.models:
116
+ model.itemDataChanged(self)
117
+
118
+ def treeChild(self, row):
119
+ """
120
+
121
+ Parameters
122
+ ----------
123
+ row :
124
+
125
+
126
+ Returns
127
+ -------
128
+
129
+ """
130
+ return self.items[row]
131
+
132
+ def treeRow(self):
133
+ """ """
134
+ return self.simplex.groups.index(self)
135
+
136
+ def treeParent(self):
137
+ """ """
138
+ return self.simplex
139
+
140
+ def treeChildCount(self):
141
+ """ """
142
+ return len(self.items)
143
+
144
+ @classmethod
145
+ def createGroup(cls, name, simplex, things=None, groupType=None):
146
+ """Convenience method for creating a group
147
+
148
+ Parameters
149
+ ----------
150
+ name : str
151
+ The name to give the new Group
152
+ simpelx : Simplex
153
+ The Simplex system
154
+ things : [object
155
+ The things to add to this Group (Default value = None)
156
+ groupType : type
157
+ The type that the new Group can hold (Default value = None)
158
+ simplex :
159
+
160
+
161
+ Returns
162
+ -------
163
+
164
+ """
165
+ g = cls(name, simplex, groupType)
166
+ if things is not None:
167
+ g.take(things)
168
+ return g
169
+
170
+ @classmethod
171
+ def loadV2(cls, simplex, data):
172
+ """Load the data from a version2 formatted json dictionary
173
+
174
+ Parameters
175
+ ----------
176
+ simplex : Simplex
177
+ The Simplex system that's being built
178
+ data : dict
179
+ The chunk of the json dict used to build this object
180
+
181
+ Returns
182
+ -------
183
+ : Group
184
+ The specified Group
185
+
186
+ """
187
+ from .combo import Combo
188
+ from .slider import Slider
189
+ from .traversal import Traversal
190
+
191
+ name = data["name"]
192
+ color = data.get("color", (0, 0, 0))
193
+ typeName = data["type"]
194
+ if typeName == "Slider":
195
+ groupType = Slider
196
+ elif typeName == "Combo":
197
+ groupType = Combo
198
+ elif typeName == "Traversal":
199
+ groupType = Traversal
200
+ else:
201
+ raise RuntimeError("Malformed simplex json string: Improper group type")
202
+ return cls(name, simplex, groupType, QColor(*color))
203
+
204
+ def buildDefinition(self, simpDict, legacy):
205
+ """Output a dictionary definition of this object
206
+
207
+ Parameters
208
+ ----------
209
+ simpDict : dict
210
+ The dictionary that is being built
211
+ legacy : bool
212
+ Whether to write out the legacy definition, or the newer one
213
+
214
+ Returns
215
+ -------
216
+
217
+ """
218
+ if self._buildIdx is None:
219
+ self._buildIdx = len(simpDict["groups"])
220
+ if legacy:
221
+ simpDict.setdefault("groups", []).append(self.name)
222
+ else:
223
+ x = {
224
+ "name": self.name,
225
+ "color": self.color.getRgb()[:3],
226
+ "type": self.groupType.__name__,
227
+ }
228
+ simpDict.setdefault("groups", []).append(x)
229
+ return self._buildIdx
230
+
231
+ def clearBuildIndex(self):
232
+ """Clear the build index of this object
233
+
234
+ The buildIndex is stored when building a definition dictionary
235
+ that keeps track of its index for later referencing
236
+
237
+ Parameters
238
+ ----------
239
+
240
+ Returns
241
+ -------
242
+
243
+ """
244
+ self._buildIdx = None
245
+
246
+ @stackable
247
+ def delete(self):
248
+ """Delete a group. Any objects in this group will be deleted"""
249
+ from .combo import Combo
250
+ from .slider import Slider
251
+
252
+ if self.groupType is Slider:
253
+ if len(self.simplex.sliderGroups) == 1:
254
+ return
255
+ gList = self.simplex.sliderGroups
256
+ elif self.groupType is Combo:
257
+ if len(self.simplex.comboGroups) == 1:
258
+ return
259
+ gList = self.simplex.comboGroups
260
+ else:
261
+ raise RuntimeError("Somehow this group has no type")
262
+
263
+ mgrs = [model.removeItemManager(self) for model in self.models]
264
+ with nested(*mgrs):
265
+ # Delete the children first
266
+ # Gotta iterate over copies of the lists
267
+ # as .delete removes the items from the list
268
+ for item in self.items[:]:
269
+ item.delete()
270
+
271
+ gList.remove(self)
272
+
273
+ @stackable
274
+ def take(self, things):
275
+ """Remove some items from their current groups and put them in this one
276
+
277
+ Parameters
278
+ ----------
279
+ things : [object
280
+ A list of things to put in this group
281
+
282
+ Returns
283
+ -------
284
+
285
+ """
286
+ if self.groupType is None:
287
+ self.groupType = type(things[0])
288
+
289
+ if not all(isinstance(i, self.groupType) for i in things):
290
+ raise ValueError(
291
+ "All items in this group must be of type: {}".format(self.groupType)
292
+ )
293
+
294
+ # do it this way instead of using set() to keep order
295
+ for thing in things:
296
+ if thing not in self.items:
297
+ thing.setGroup(self)