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
simplexui/utils.py ADDED
@@ -0,0 +1,320 @@
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
+ """Utility functions."""
19
+
20
+ import os
21
+ import re
22
+ import sys
23
+
24
+ from contextlib import contextmanager, ExitStack
25
+
26
+ from Qt.QtCore import QObject, QTimer, QSettings
27
+ from Qt.QtGui import QIcon
28
+
29
+ AT_BLUR = os.environ.get("SIMPLEX_AT_BLUR") == "true"
30
+
31
+
32
+ def toPyObject(thing):
33
+ """Because we could still be in the sip api 1.0
34
+ I have to check and convert all Qt returns to python objects
35
+
36
+ Parameters
37
+ ----------
38
+ thing : object
39
+ The object, possibly Qt type
40
+
41
+ Returns
42
+ -------
43
+ object
44
+ The python object
45
+
46
+ """
47
+ try:
48
+ return thing.toPyObject()
49
+ except Exception:
50
+ return thing
51
+
52
+
53
+ def getUiFile(fileVar, subFolder="ui", uiName=None):
54
+ """Get the path to the .ui file
55
+
56
+ Parameters
57
+ ----------
58
+ fileVar : str
59
+ The __file__ variable passed from the invocation
60
+ subFolder : str
61
+ The folder to look in for the ui files. Defaults to 'ui'
62
+ uiName : str or None
63
+ The name of the .ui file. Defaults to the basename of
64
+ fileVar with .ui instead of .py
65
+
66
+ Returns
67
+ -------
68
+ str
69
+ The path to the .ui file
70
+
71
+ """
72
+ uiFolder, filename = os.path.split(fileVar)
73
+ if uiName is None:
74
+ uiName = os.path.splitext(filename)[0]
75
+ if not subFolder:
76
+ raise ValueError("A subfolder must be provided")
77
+ uiFile = os.path.join(uiFolder, subFolder, uiName + ".ui")
78
+ return uiFile
79
+
80
+
81
+ def getNextName(name, currentNames):
82
+ """Get the next available number-incremented name
83
+
84
+ Parameters
85
+ ----------
86
+ name : str
87
+ The name I want to check
88
+ currentNames : list
89
+ The names that currently exist
90
+
91
+ Returns
92
+ -------
93
+ str
94
+ The next available number-incremented name
95
+
96
+ """
97
+ i = 0
98
+ s = set(currentNames)
99
+ while True:
100
+ if not i:
101
+ nn = name
102
+ else:
103
+ nn = name + str(i)
104
+ if nn not in s:
105
+ return nn
106
+ i += 1
107
+ return name
108
+
109
+
110
+ def clearPathSymbols(paths, keepers=None):
111
+ """Removes path symbols from the environment.
112
+
113
+ This means I can unload my tools from the current process and re-import them
114
+ rather than dealing with the always finicky reload()
115
+
116
+ We use directory paths rather than module names because it gives us more control
117
+ over what is unloaded
118
+
119
+ Parameters
120
+ ----------
121
+ paths : list
122
+ List of directory paths that will have their modules removed
123
+ keepers : list or None
124
+ List of module names that will not be removed (Default value = None)
125
+ """
126
+ keepers = keepers or []
127
+ paths = [os.path.normcase(os.path.normpath(p)) for p in paths]
128
+
129
+ for key, value in sys.modules.items():
130
+ protected = False
131
+
132
+ # Used by multiprocessing library, don't remove this.
133
+ if key == "__parents_main__":
134
+ protected = True
135
+
136
+ # Protect submodules of protected packages
137
+ if key in keepers:
138
+ protected = True
139
+
140
+ ckey = key
141
+ while not protected and "." in ckey:
142
+ ckey = ckey.rsplit(".", 1)[0]
143
+ if ckey in keepers:
144
+ protected = True
145
+
146
+ if protected:
147
+ continue
148
+
149
+ try:
150
+ packPath = value.__file__
151
+ except AttributeError:
152
+ continue
153
+
154
+ packPath = os.path.normcase(os.path.normpath(packPath))
155
+
156
+ isEnvPackage = any(packPath.startswith(p) for p in paths)
157
+ if isEnvPackage:
158
+ sys.modules.pop(key)
159
+
160
+
161
+ def caseSplit(name):
162
+ """Split CamelCase and dromedaryCase words
163
+ Taken From https://stackoverflow.com/questions/29916065/how-to-do-camelcase-split-in-python
164
+
165
+ Parameters
166
+ ----------
167
+ name : str
168
+ The string to split
169
+
170
+ Returns
171
+ -------
172
+ list
173
+ The split string
174
+ """
175
+ matches = re.finditer(".+?(?:(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|$)", name)
176
+ return [m.group(0) for m in matches]
177
+
178
+
179
+ class singleShot(QObject):
180
+ """Decorator class used to implement a QTimer.singleShot(0, function)
181
+
182
+ This is useful so your refresh function only gets called once even if
183
+ its connected to a signal that gets emitted several times at once.
184
+
185
+ Note:
186
+ The values passed to the decorated method will be accumulated
187
+ and run all at once, then reset for the next go-round
188
+
189
+ From the Qt Docs:
190
+ As a special case, a QTimer with a timeout of 0 will time out as
191
+ soon as all the events in the window system's event queue have
192
+ been processed. This can be used to do heavy work while providing
193
+ a snappy user interface
194
+ """
195
+
196
+ def __init__(self):
197
+ super(singleShot, self).__init__()
198
+ self._function = None
199
+ self._callScheduled = False
200
+ self._args = []
201
+ self._inst = None
202
+
203
+ def __call__(self, function):
204
+ self._function = function
205
+
206
+ def newFunction(inst, *args):
207
+ """
208
+
209
+ Parameters
210
+ ----------
211
+ inst :
212
+
213
+ *args :
214
+
215
+
216
+ Returns
217
+ -------
218
+
219
+ """
220
+ self._args.extend(args)
221
+ if not self._callScheduled:
222
+ self._inst = inst
223
+ self._callScheduled = True
224
+ QTimer.singleShot(0, self.callback)
225
+
226
+ newFunction.__name__ = function.__name__
227
+ newFunction.__doc__ = function.__doc__
228
+ return newFunction
229
+
230
+ def callback(self):
231
+ """Calls the decorated function and resets singleShot for the next group of calls"""
232
+ self._callScheduled = False
233
+ # self._args needs to be cleared before we call self._function
234
+ args = self._args
235
+ inst = self._inst
236
+ self._inst = None
237
+ self._args = []
238
+ self._function(inst, args)
239
+
240
+
241
+ def makeUnique(seq):
242
+ """Make a sequence unique, keeping the first time each item is seen
243
+
244
+ Parameters
245
+ ----------
246
+ seq : list or tuple
247
+ A python sequence
248
+
249
+ Returns
250
+ -------
251
+ list
252
+ A list with unique items
253
+ """
254
+ seen = set()
255
+ seen_add = seen.add # only resolve the method lookup once
256
+ return [x for x in seq if not (x in seen or seen_add(x))]
257
+
258
+
259
+ @contextmanager
260
+ def nested(*managers):
261
+ """Combine an arbitrary number of context managers into a single nested
262
+ context manager.
263
+ """
264
+ with ExitStack() as stack:
265
+ yield [stack.enter_context(m) for m in managers]
266
+
267
+
268
+ def naturalSortKey(s, _nsre=re.compile("([0-9]+)")):
269
+ """Get a sort key that puts strings with numbers in numerical order
270
+ This is accomplished by splitting the string into groups of digits, and non-digits,
271
+ then converting the digit groups into integers.
272
+
273
+ Parameters
274
+ ----------
275
+ s : str
276
+ The string to get the key for
277
+ _nsre :
278
+ A hack argument to hold the compiled regex
279
+
280
+ Returns
281
+ -------
282
+ list
283
+ A list containing both strings and integers.
284
+ """
285
+ return [int(text) if text.isdigit() else text.lower() for text in _nsre.split(s)]
286
+
287
+
288
+ def getIcon(iconName):
289
+ path = os.path.join(os.path.dirname(__file__), "img", iconName)
290
+ return QIcon(path)
291
+
292
+
293
+ class Prefs(object):
294
+ """A wrapper for reading/writing prefs both internal and external to blur"""
295
+
296
+ def __init__(self):
297
+ if AT_BLUR:
298
+ import blurdev.prefs
299
+
300
+ self._pref = blurdev.prefs.find("tools/simplex3")
301
+ else:
302
+ self._pref = QSettings("Blur", "Simplex3")
303
+
304
+ def restoreProperty(self, prop, default=None):
305
+ if AT_BLUR:
306
+ return self._pref.restoreProperty(prop, default)
307
+ else:
308
+ return toPyObject(self._pref.value(prop, default))
309
+
310
+ def recordProperty(self, prop, val):
311
+ if AT_BLUR:
312
+ self._pref.recordProperty(prop, val)
313
+ else:
314
+ self._pref.setValue(prop, val)
315
+
316
+ def save(self):
317
+ if AT_BLUR:
318
+ self._pref.save()
319
+ else:
320
+ self._pref.sync()