simplex-solver 3.2.2__cp39-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 (84) hide show
  1. simplex_solver-3.2.2.dist-info/DELVEWHEEL +2 -0
  2. simplex_solver-3.2.2.dist-info/METADATA +94 -0
  3. simplex_solver-3.2.2.dist-info/RECORD +84 -0
  4. simplex_solver-3.2.2.dist-info/WHEEL +5 -0
  5. simplex_solver.libs/.load-order-simplex_solver-3.2.2 +1 -0
  6. simplex_solver.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll +0 -0
  7. simplexui/__init__.py +86 -0
  8. simplexui/_version.py +1 -0
  9. simplexui/channelBox.py +867 -0
  10. simplexui/comboCheckDialog.py +396 -0
  11. simplexui/commands/__init__.py +16 -0
  12. simplexui/commands/alembicCommon.py +1148 -0
  13. simplexui/commands/alembic_walker.py +299 -0
  14. simplexui/commands/applyCorrectives.py +452 -0
  15. simplexui/commands/correctiveInterface.py +259 -0
  16. simplexui/commands/expandedExport.py +434 -0
  17. simplexui/commands/hdf5Convert.py +62 -0
  18. simplexui/commands/mayaCorrectiveInterface.py +159 -0
  19. simplexui/commands/mayatonumpy.py +416 -0
  20. simplexui/commands/mesh.py +1085 -0
  21. simplexui/commands/poseblendlib.py +168 -0
  22. simplexui/commands/reorderSimplexPoints.py +102 -0
  23. simplexui/commands/replaceDefinitionJson.py +74 -0
  24. simplexui/commands/rigidAlign.py +97 -0
  25. simplexui/commands/unsubdivide.py +1222 -0
  26. simplexui/commands/uvTransfer.py +976 -0
  27. simplexui/dragFilter.py +334 -0
  28. simplexui/falloffDialog.py +504 -0
  29. simplexui/img/ChefHead.png +0 -0
  30. simplexui/img/frozen.png +0 -0
  31. simplexui/interface/__init__.py +30 -0
  32. simplexui/interface/dummyInterface.py +1313 -0
  33. simplexui/interface/mayaInterface.py +2294 -0
  34. simplexui/interfaceModel.py +655 -0
  35. simplexui/interfaceModelTrees.py +456 -0
  36. simplexui/items/__init__.py +50 -0
  37. simplexui/items/accessor.py +145 -0
  38. simplexui/items/combo.py +645 -0
  39. simplexui/items/dragItem.py +44 -0
  40. simplexui/items/falloff.py +748 -0
  41. simplexui/items/group.py +267 -0
  42. simplexui/items/progression.py +613 -0
  43. simplexui/items/shape.py +384 -0
  44. simplexui/items/simplex.py +1734 -0
  45. simplexui/items/slider.py +632 -0
  46. simplexui/items/stack.py +147 -0
  47. simplexui/items/traversal.py +780 -0
  48. simplexui/items/treeItem.py +441 -0
  49. simplexui/main.pyw +22 -0
  50. simplexui/menu/__init__.py +73 -0
  51. simplexui/menu/dummyPlugins/__init__.py +16 -0
  52. simplexui/menu/genericPlugins/__init__.py +16 -0
  53. simplexui/menu/genericPlugins/_builtins.py +270 -0
  54. simplexui/menu/genericPlugins/checkPossibleCombos.py +48 -0
  55. simplexui/menu/genericPlugins/exportSplit.py +67 -0
  56. simplexui/menu/genericPlugins/showFalloffs.py +26 -0
  57. simplexui/menu/genericPlugins/showTraversals.py +26 -0
  58. simplexui/menu/genericPlugins/simplexUvTransfer.py +106 -0
  59. simplexui/menu/genericPlugins/unsubdivide.py +72 -0
  60. simplexui/menu/mayaPlugins/__init__.py +16 -0
  61. simplexui/menu/mayaPlugins/exportOther.py +53 -0
  62. simplexui/menu/mayaPlugins/extractProgressives.py +68 -0
  63. simplexui/menu/mayaPlugins/freezeCombo.py +247 -0
  64. simplexui/menu/mayaPlugins/generateShapeIncrementals.py +99 -0
  65. simplexui/menu/mayaPlugins/importObjs.py +199 -0
  66. simplexui/menu/mayaPlugins/linearizeTraversal.py +60 -0
  67. simplexui/menu/mayaPlugins/makeShelfBtn.py +67 -0
  68. simplexui/menu/mayaPlugins/relaxToSelection.py +76 -0
  69. simplexui/menu/mayaPlugins/reloadDefinition.py +44 -0
  70. simplexui/menu/mayaPlugins/snapToNeutral.py +71 -0
  71. simplexui/menu/mayaPlugins/softSelectToCluster.py +201 -0
  72. simplexui/menu/mayaPlugins/tweakMix.py +136 -0
  73. simplexui/menu/mayaPlugins/updateRestShape.py +113 -0
  74. simplexui/pysimplex.lib +0 -0
  75. simplexui/pysimplex.pyd +0 -0
  76. simplexui/simplexDialog.py +1547 -0
  77. simplexui/travCheckDialog.py +419 -0
  78. simplexui/traversalDialog.py +299 -0
  79. simplexui/ui/comboCheckDialog.ui +475 -0
  80. simplexui/ui/falloffDialog.ui +243 -0
  81. simplexui/ui/simplexDialog.ui +1458 -0
  82. simplexui/ui/travCheckDialog.ui +488 -0
  83. simplexui/ui/traversalDialog.ui +532 -0
  84. simplexui/utils.py +307 -0
@@ -0,0 +1,267 @@
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
+ from __future__ import annotations
18
+
19
+ from typing import TYPE_CHECKING, Any, Union
20
+
21
+ from .accessor import SimplexTreeAccessor
22
+ from .stack import stackable
23
+ from .treeItem import TreeItem
24
+
25
+ if TYPE_CHECKING:
26
+ from .combo import Combo
27
+ from .simplex import Simplex
28
+ from .slider import Slider
29
+ from .traversal import Traversal
30
+
31
+ GroupType = Union[type[Combo], type[Slider], type[Traversal]]
32
+ GroupMember = Union[Combo, Slider, Traversal]
33
+
34
+
35
+ class Group(SimplexTreeAccessor):
36
+ """Groups organize Simplex items
37
+
38
+ Groups have no purpose in the solver. They don't do anything other than organize
39
+ the items in a system.
40
+
41
+ Each group can hold only one type of item (Slider, Combo, or Traversal)
42
+
43
+ Parameters
44
+ ----------
45
+ name : str
46
+ The name of the group
47
+ simplex : Simplex
48
+ The Simplex system
49
+ groupType : type
50
+ The type that this group can hold
51
+ """
52
+
53
+ classDepth: int = 1
54
+
55
+ def __init__(
56
+ self,
57
+ name: str,
58
+ simplex: Simplex,
59
+ groupType: GroupType,
60
+ ) -> None:
61
+ super().__init__(simplex)
62
+ from .combo import Combo
63
+ from .slider import Slider
64
+ from .traversal import Traversal
65
+
66
+ with self.stack.store(self):
67
+ self._name: str = name
68
+ self.items: list[Combo | Slider | Traversal] = []
69
+ self._buildIdx: int | None = None
70
+ self.groupType: GroupType = groupType
71
+
72
+ with self.insertItemManager(simplex, row=self._getInsertionRow()):
73
+ if self.groupType is Slider:
74
+ self.simplex.sliderGroups.append(self)
75
+ elif self.groupType is Combo:
76
+ self.simplex.comboGroups.append(self)
77
+ elif self.groupType is Traversal:
78
+ self.simplex.traversalGroups.append(self)
79
+
80
+ def _getInsertionRow(self) -> int:
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
+ return 0
95
+
96
+ @property
97
+ def name(self) -> str:
98
+ """Get the name of the Group"""
99
+ return self._name
100
+
101
+ @name.setter
102
+ @stackable
103
+ def name(self, value: str) -> None:
104
+ """Set the name of the Group"""
105
+ self._name = value
106
+
107
+ @classmethod
108
+ def createGroup(
109
+ cls,
110
+ name: str,
111
+ simplex: Simplex,
112
+ things: list[GroupMember] | None = None,
113
+ groupType: GroupType | None = None,
114
+ ) -> Group:
115
+ """Convenience method for creating a group
116
+
117
+ Parameters
118
+ ----------
119
+ name : str
120
+ The name to give the new Group
121
+ simpelx : Simplex
122
+ The Simplex system
123
+ things : [object
124
+ The things to add to this Group (Default value = None)
125
+ groupType : type
126
+ The type that the new Group can hold (Default value = None)
127
+ simplex :
128
+ """
129
+
130
+ if groupType is None:
131
+ if not things:
132
+ raise ValueError(
133
+ "Cannot build a group without setting the type, or giving an object to infer from"
134
+ )
135
+ groupType = type(things[0])
136
+
137
+ g = cls(name, simplex, groupType)
138
+ if things is not None:
139
+ g.take(things)
140
+ return g
141
+
142
+ @classmethod
143
+ def loadV2(cls, simplex: Simplex, data: dict[str, Any]) -> Group:
144
+ """Load the data from a version2 formatted json dictionary
145
+
146
+ Parameters
147
+ ----------
148
+ simplex : Simplex
149
+ The Simplex system that's being built
150
+ data : dict
151
+ The chunk of the json dict used to build this object
152
+
153
+ Returns
154
+ -------
155
+ : Group
156
+ The specified Group
157
+ """
158
+ from .combo import Combo
159
+ from .slider import Slider
160
+ from .traversal import Traversal
161
+
162
+ name = data["name"]
163
+ typeName = data["type"]
164
+ if typeName == "Slider":
165
+ groupType = Slider
166
+ elif typeName == "Combo":
167
+ groupType = Combo
168
+ elif typeName == "Traversal":
169
+ groupType = Traversal
170
+ else:
171
+ raise RuntimeError("Malformed simplex json string: Improper group type")
172
+ return cls(name, simplex, groupType)
173
+
174
+ def buildDefinition(self, simpDict: dict[str, Any], legacy: bool) -> int:
175
+ """Output a dictionary definition of this object
176
+
177
+ Parameters
178
+ ----------
179
+ simpDict : dict
180
+ The dictionary that is being built
181
+ legacy : bool
182
+ Whether to write out the legacy definition, or the newer one
183
+ """
184
+ if self._buildIdx is None:
185
+ self._buildIdx = len(simpDict["groups"])
186
+ if legacy:
187
+ simpDict.setdefault("groups", []).append(self.name)
188
+ else:
189
+ x = {
190
+ "name": self.name,
191
+ "type": self.groupType.__name__,
192
+ }
193
+ simpDict.setdefault("groups", []).append(x)
194
+ return self._buildIdx
195
+
196
+ def clearBuildIndex(self) -> None:
197
+ """Clear the build index of this object
198
+
199
+ The buildIndex is stored when building a definition dictionary
200
+ that keeps track of its index for later referencing
201
+ """
202
+ self._buildIdx = None
203
+
204
+ @stackable
205
+ def delete(self) -> None:
206
+ """Delete a group. Any objects in this group will be deleted"""
207
+ from .combo import Combo
208
+ from .slider import Slider
209
+
210
+ if self.groupType is Slider:
211
+ if len(self.simplex.sliderGroups) == 1:
212
+ return
213
+ gList = self.simplex.sliderGroups
214
+ elif self.groupType is Combo:
215
+ if len(self.simplex.comboGroups) == 1:
216
+ return
217
+ gList = self.simplex.comboGroups
218
+ else:
219
+ raise RuntimeError("Somehow this group has no type")
220
+
221
+ with self.removeItemManager(self):
222
+ # Delete the children first
223
+ # Gotta iterate over copies of the lists
224
+ # as .delete removes the items from the list
225
+ for item in self.items[:]:
226
+ item.delete()
227
+
228
+ gList.remove(self)
229
+
230
+ @stackable
231
+ def take(self, things: list[GroupMember]) -> None:
232
+ """Remove some items from their current groups and put them in this one
233
+
234
+ Parameters
235
+ ----------
236
+ things : [object
237
+ A list of things to put in this group
238
+ """
239
+ if self.groupType is None:
240
+ self.groupType = type(things[0])
241
+
242
+ if not all(isinstance(i, self.groupType) for i in things):
243
+ raise ValueError(
244
+ f"All items in this group must be of type: {self.groupType}"
245
+ )
246
+
247
+ # do it this way instead of using set() to keep order
248
+ for thing in things:
249
+ if thing not in self.items:
250
+ thing.setGroup(self)
251
+
252
+ def treeChild(self, row) -> TreeItem:
253
+ return self.items[row]
254
+
255
+ def treeRow(self) -> int:
256
+ return self.simplex.groups.index(self)
257
+
258
+ def treeParent(self) -> TreeItem:
259
+ return self.simplex
260
+
261
+ def treeChildCount(self) -> int:
262
+ return len(self.items)
263
+
264
+ def treeData(self, column: int) -> str | None:
265
+ if column == 0:
266
+ return self.name
267
+ return None