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
@@ -0,0 +1,136 @@
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
+ """ Get the corrective deltas from a rig in XSI """
19
+
20
+ from __future__ import absolute_import
21
+
22
+ from dcc.xsi import constants, xsi
23
+ from dcc.xsi.ice import ICETree # pylint:disable=import-error
24
+ from six.moves import zip
25
+
26
+
27
+ def setPose(pvp, multiplier):
28
+ """Set a percentage of a pose
29
+
30
+ Parameters
31
+ ----------
32
+ pvp : [(str, float), ...]
33
+ A list of property/value pairs
34
+ multiplier : float
35
+ The percentage multiplier of the pose
36
+ """
37
+ for prop, val in pvp:
38
+ xsi.setValue(prop, val * multiplier)
39
+
40
+
41
+ def resetPose(pvp):
42
+ """Reset everything back to rest
43
+
44
+ Parameters
45
+ ----------
46
+ pvp : [(str, float), ...]
47
+ A list of property/value pairs
48
+ """
49
+ for prop, val in pvp:
50
+ xsi.setValue(prop, 0)
51
+
52
+
53
+ def getMeshVerts(mesh):
54
+ """Get the verts of the given mesh object
55
+
56
+ Parameters
57
+ ----------
58
+ mesh : XSIObject
59
+ A native xsi mesh object
60
+
61
+ Returns
62
+ -------
63
+ : [vert, ...]
64
+ A list of vertices
65
+ """
66
+ vts = mesh.ActivePrimitive.Geometry.Points.PositionArray
67
+ return list(zip(*vts))
68
+
69
+
70
+ def buildTree(mesh):
71
+ """Build the ICE tree that allows for this procedure
72
+
73
+ Parameters
74
+ ----------
75
+ mesh : XSIObject
76
+ A native xsi mesh object
77
+
78
+ Returns
79
+ -------
80
+ : XSIObject
81
+ The ICE Tree object
82
+ : XSIObject
83
+ The vector node in the ICE Tree
84
+ """
85
+ iceTree = ICETree(None, mesh, "Test", constants.siConstructionModePrimaryShape)
86
+
87
+ getter = iceTree.addGetDataNode("Self.PointPosition")
88
+ adder = iceTree.addNode("Add")
89
+ vector = iceTree.addNode("ScalarTo3DVector")
90
+ setter = iceTree.addSetDataNode("Self.PointPosition")
91
+
92
+ getter.value.connect(adder.value1)
93
+ vector.vector.connect(adder.value2)
94
+ adder.result.connect(setter.Value)
95
+ iceTree.connect(setter.Execute, 2)
96
+
97
+ return iceTree, vector
98
+
99
+
100
+ def getShiftValues(mesh):
101
+ """Shift the vertices along each axis *before* the skinning
102
+ op in the deformer history
103
+
104
+ Parameters
105
+ ----------
106
+ mesh : XSIObject
107
+ A native xsi mesh object
108
+
109
+ Returns
110
+ -------
111
+ : [vert, ...]
112
+ A list of un-shifted vertices
113
+ : [vert, ...]
114
+ A list of vertices pre-shifted by 1 along the X axis
115
+ : [vert, ...]
116
+ A list of vertices pre-shifted by 1 along the Y axis
117
+ : [vert, ...]
118
+ A list of vertices pre-shifted by 1 along the Z axis
119
+ """
120
+ tree, vector = buildTree(mesh)
121
+ zero = getMeshVerts(mesh)
122
+
123
+ vector.x.value = 1.0
124
+ oneX = getMeshVerts(mesh)
125
+ vector.x.value = 0.0
126
+
127
+ vector.y.value = 1.0
128
+ oneY = getMeshVerts(mesh)
129
+ vector.y.value = 0.0
130
+
131
+ vector.z.value = 1.0
132
+ oneZ = getMeshVerts(mesh)
133
+ vector.z.value = 0.0
134
+
135
+ tree.delete()
136
+ return zero, oneX, oneY, oneZ
@@ -0,0 +1,299 @@
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
+
19
+ from Qt.QtCore import QEvent, QObject, QPoint, Qt, Signal
20
+ from Qt.QtGui import QCursor, QMouseEvent
21
+ from Qt.QtWidgets import QApplication
22
+
23
+
24
+ class DragFilter(QObject):
25
+ """Drag Event Filter
26
+
27
+ This class provides an event filter that can be installed
28
+ on a Qt Widget to take click/drag events and give them slider
29
+ type interaction.
30
+
31
+ Signals:
32
+ dragPressed = Signal()
33
+ Emitted when the drag passes the startSensitivity
34
+ dragTick (int, float):
35
+ NumberOfTicks, TickMultiplier
36
+ Emitted after dragPressed every time the drag passes dragSensitivity
37
+ dragReleased = Signal()
38
+ Emitted when the mouse is released after dragPressed
39
+
40
+ Instance Options:
41
+ dragSensitivity(int): default=5
42
+ The number of pixels the cursor has to travel to emit a tick
43
+ startSensitivity(int): default=10
44
+ The number of pixels the cursor has to travel to enter into drag mode
45
+ cursorLock(bool): default=False
46
+ Whether the cursor returns to its start position every tick
47
+ wrapBoundary(int): default=10
48
+ When wrapping around the current screen, this is the number of pixels
49
+ in from the edge of the screen that the cursor will appear
50
+ dragCursor(int): default=self.CURSOR_ARROWS
51
+ The cursor that will be displayed while dragging
52
+ CURSOR_ARROWS will show horizontal/vertical drag
53
+ CURSOR_BLANK will hid the cursor
54
+ dragButton(Qt.MouseButton): default=Qt.MiddleButton
55
+ The button that will kick off the drag behavior
56
+ fastModifier(Qt.KeyboardModifier): default=Qt.ControlModifier
57
+ The modifier key that will cause the multiplier to emit with the signal
58
+ fastMultiplier(float): default=5.0
59
+ The size of the multiplier
60
+ slowModifier(Qt.KeyboardModifier): default=Qt.ShiftModifier
61
+ The modifier key that will cause the divisor to emit with the signal
62
+ slowDivisor(float): default=5.0
63
+ The size of the divisor
64
+ isSpinbox(bool): default=False
65
+ This must be set to True if you are setting this as the handler
66
+ for a QSpinBox. The QSpinBox will tick every 0.25s as long as your mouse is
67
+ held down. This option turns that off
68
+ """
69
+
70
+ DRAG_ENABLED = 0
71
+ DRAG_NONE = 0
72
+ DRAG_HORIZONTAL = 1
73
+ DRAG_VERTICAL = 2
74
+
75
+ CURSOR_NONE = 0
76
+ CURSOR_BLANK = 1
77
+ CURSOR_ARROWS = 2
78
+
79
+ dragTick = Signal(int, float) # NumberOfTicks, TickMultiplier
80
+ dragPressed = Signal()
81
+ dragReleased = Signal()
82
+
83
+ def __init__(self, parent):
84
+ super(DragFilter, self).__init__(parent)
85
+
86
+ self.dragSensitivity = 5 # pixels for one step
87
+ self.startSensitivity = 10 # pixel move to start the dragging
88
+ self.cursorLock = False
89
+ self.wrapBoundary = 10 # wrap when within boundary of screen edge
90
+ self.dragCursor = self.CURSOR_ARROWS
91
+ self.dragButton = Qt.MiddleButton
92
+
93
+ # The QSpinbox has an option where, if you hold down the mouse button
94
+ # it will continually increment. This flag enables a workaround
95
+ # for that problem
96
+ self.isSpinbox = False
97
+
98
+ self.fastModifier = Qt.ControlModifier
99
+ self.slowModifier = Qt.ShiftModifier
100
+
101
+ self.fastMultiplier = 5.0
102
+ self.slowDivisor = 5.0
103
+
104
+ # private vars
105
+ self._lastPos = QPoint()
106
+ self._leftover = 0
107
+ self._dragStart = None
108
+ self._firstDrag = False
109
+ self._dragType = self.DRAG_NONE
110
+ self._overridden = False
111
+ self._screen = None
112
+ self._isDragging = False
113
+
114
+ def doOverrideCursor(self):
115
+ """Change the cursor based on the current drag type"""
116
+ if self._overridden:
117
+ return
118
+ if self.dragCursor == self.CURSOR_BLANK:
119
+ QApplication.setOverrideCursor(Qt.BlankCursor)
120
+ elif self.dragCursor == self.CURSOR_ARROWS:
121
+ if self._dragType == self.DRAG_VERTICAL:
122
+ QApplication.setOverrideCursor(Qt.SizeVerCursor)
123
+ elif self._dragType == self.DRAG_HORIZONTAL:
124
+ QApplication.setOverrideCursor(Qt.SizeHorCursor)
125
+
126
+ self._overridden = True
127
+
128
+ def restoreOverrideCursor(self):
129
+ """Restore the cursor to the normal pointer"""
130
+ if not self._overridden:
131
+ return
132
+ QApplication.restoreOverrideCursor()
133
+ self._overridden = False
134
+
135
+ def doDrag(self, o, e):
136
+ """Handle a mouse drag event
137
+
138
+ Parameters
139
+ ----------
140
+ o : QObject
141
+ The object that is being dragged
142
+ e : QEvent
143
+ The QEvent of the mouse drag
144
+ """
145
+ if self._dragType == self.DRAG_HORIZONTAL:
146
+ delta = e.pos().x() - self._lastPos.x()
147
+ else:
148
+ delta = self._lastPos.y() - e.pos().y()
149
+
150
+ self._leftover += delta
151
+ self._lastPos = e.pos()
152
+
153
+ count = int(self._leftover / self.dragSensitivity)
154
+ if count:
155
+ mul = 1.0
156
+ if e.modifiers() & self.fastModifier:
157
+ mul = self.fastMultiplier
158
+ elif e.modifiers() & self.slowModifier:
159
+ mul = 1.0 / self.slowDivisor
160
+ self.dragTick.emit(count, mul)
161
+
162
+ # If we start off with negative leftover, then this modulo
163
+ # needs to return negative leftover steps
164
+ neg = self._leftover < 0
165
+ self._leftover %= self.dragSensitivity
166
+ if neg and self._leftover > 0:
167
+ self._leftover -= self.dragSensitivity
168
+
169
+ if self.cursorLock:
170
+ QCursor.setPos(self.mapToGlobal(self._dragStart))
171
+ self._lastPos = self._dragStart
172
+ else:
173
+ r = self._screen
174
+ b = self.wrapBoundary
175
+ p = o.mapToGlobal(e.pos())
176
+
177
+ # when wrapping move to the other side in by 2*boundary
178
+ # so we don't loop the wrapping
179
+ if p.x() > r.right() - b:
180
+ p.setX(r.left() + 2 * b)
181
+
182
+ if p.x() < r.left() + b:
183
+ p.setX(r.right() - 2 * b)
184
+
185
+ if p.y() > r.bottom() - b:
186
+ p.setY(r.top() + 2 * b)
187
+
188
+ if p.y() < r.top() + b:
189
+ p.setY(r.bottom() - 2 * b)
190
+
191
+ if p != e.globalPos():
192
+ QCursor.setPos(p)
193
+ self._lastPos = self.parent().mapFromGlobal(p)
194
+ self._leftover = 0
195
+
196
+ def startDrag(self, o, e):
197
+ """Start the drag event handling
198
+
199
+ Parameters
200
+ ----------
201
+ o : QObject
202
+ The object that is being dragged
203
+ e : QEvent
204
+ The QEvent of the mouse drag
205
+ """
206
+ if self._dragStart is None:
207
+ self._dragStart = e.pos()
208
+ dtop = QApplication.desktop()
209
+ sn = dtop.screenNumber(o.mapToGlobal(e.pos()))
210
+ self._screen = dtop.availableGeometry(sn)
211
+
212
+ if abs(e.x() - self._dragStart.x()) > self.startSensitivity:
213
+ self._dragType = self.DRAG_HORIZONTAL
214
+ elif abs(e.y() - self._dragStart.y()) > self.startSensitivity:
215
+ self._dragType = self.DRAG_VERTICAL
216
+
217
+ if self._dragType:
218
+ self._leftover = 0
219
+ self._lastPos = e.pos()
220
+ self._firstDrag = True
221
+
222
+ self.dragPressed.emit()
223
+ self.doOverrideCursor()
224
+
225
+ if self.isSpinbox:
226
+ if e.buttons() & self.dragButton:
227
+ # Send mouseRelease to spin buttons when dragging
228
+ # otherwise the spinbox will keep ticking. @longClickFix
229
+ # There's gotta be a better way to do this :-/
230
+ mouseup = QMouseEvent(
231
+ QEvent.MouseButtonRelease,
232
+ e.pos(),
233
+ self.dragButton,
234
+ e.buttons(),
235
+ e.modifiers(),
236
+ )
237
+ QApplication.sendEvent(o, mouseup)
238
+
239
+ def myendDrag(self, o, e):
240
+ """End the drag event handling. Can't call it endDrag because that's taken
241
+
242
+ Parameters
243
+ ----------
244
+ o : QObject
245
+ The object that is being dragged
246
+ e : QEvent
247
+ The QEvent of the mouse drag
248
+ """
249
+
250
+ # Only end dragging if it's *not* the first mouse release. See @longClickFix
251
+ if self._firstDrag and self.isSpinbox:
252
+ self._firstDrag = False
253
+
254
+ elif self._dragType:
255
+ self.restoreOverrideCursor()
256
+ self._dragType = self.DRAG_NONE
257
+ self._lastPos = QPoint()
258
+ self._dragStart = None
259
+ self._screen = None
260
+ self.dragReleased.emit()
261
+
262
+ def eventFilter(self, o, e):
263
+ """Overridden Qt eventFilter
264
+
265
+ Parameters
266
+ ----------
267
+ o : QObject
268
+ The object that is being dragged
269
+ e : QEvent
270
+ The QEvent of the mouse drag
271
+ """
272
+ if hasattr(self, "DRAG_ENABLED"):
273
+ if e.type() == QEvent.MouseMove:
274
+ if self._isDragging:
275
+ try:
276
+ if self._dragType != self.DRAG_NONE:
277
+ self.doDrag(o, e)
278
+ elif e.buttons() & self.dragButton:
279
+ self.startDrag(o, e)
280
+ except Exception:
281
+ # fix the cursor if there's an error during dragging
282
+ self.restoreOverrideCursor()
283
+ raise # re-raise the exception
284
+ return True
285
+
286
+ elif e.type() == QEvent.MouseButtonRelease:
287
+ self.myendDrag(o, e)
288
+ if e.button() & self.dragButton:
289
+ # Catch any dragbutton releases and handle them
290
+ self._isDragging = False
291
+ return True
292
+
293
+ elif e.type() == QEvent.MouseButtonPress:
294
+ if e.button() & self.dragButton:
295
+ # Catch any dragbutton presses and handle them
296
+ self._isDragging = True
297
+ return True
298
+
299
+ return super(DragFilter, self).eventFilter(o, e)