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