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.
- simplex_solver-3.2.2.dist-info/DELVEWHEEL +2 -0
- simplex_solver-3.2.2.dist-info/METADATA +94 -0
- simplex_solver-3.2.2.dist-info/RECORD +84 -0
- simplex_solver-3.2.2.dist-info/WHEEL +5 -0
- simplex_solver.libs/.load-order-simplex_solver-3.2.2 +1 -0
- simplex_solver.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll +0 -0
- simplexui/__init__.py +86 -0
- simplexui/_version.py +1 -0
- simplexui/channelBox.py +867 -0
- simplexui/comboCheckDialog.py +396 -0
- simplexui/commands/__init__.py +16 -0
- simplexui/commands/alembicCommon.py +1148 -0
- simplexui/commands/alembic_walker.py +299 -0
- simplexui/commands/applyCorrectives.py +452 -0
- simplexui/commands/correctiveInterface.py +259 -0
- simplexui/commands/expandedExport.py +434 -0
- simplexui/commands/hdf5Convert.py +62 -0
- simplexui/commands/mayaCorrectiveInterface.py +159 -0
- simplexui/commands/mayatonumpy.py +416 -0
- simplexui/commands/mesh.py +1085 -0
- simplexui/commands/poseblendlib.py +168 -0
- simplexui/commands/reorderSimplexPoints.py +102 -0
- simplexui/commands/replaceDefinitionJson.py +74 -0
- simplexui/commands/rigidAlign.py +97 -0
- simplexui/commands/unsubdivide.py +1222 -0
- simplexui/commands/uvTransfer.py +976 -0
- simplexui/dragFilter.py +334 -0
- simplexui/falloffDialog.py +504 -0
- simplexui/img/ChefHead.png +0 -0
- simplexui/img/frozen.png +0 -0
- simplexui/interface/__init__.py +30 -0
- simplexui/interface/dummyInterface.py +1313 -0
- simplexui/interface/mayaInterface.py +2294 -0
- simplexui/interfaceModel.py +655 -0
- simplexui/interfaceModelTrees.py +456 -0
- simplexui/items/__init__.py +50 -0
- simplexui/items/accessor.py +145 -0
- simplexui/items/combo.py +645 -0
- simplexui/items/dragItem.py +44 -0
- simplexui/items/falloff.py +748 -0
- simplexui/items/group.py +267 -0
- simplexui/items/progression.py +613 -0
- simplexui/items/shape.py +384 -0
- simplexui/items/simplex.py +1734 -0
- simplexui/items/slider.py +632 -0
- simplexui/items/stack.py +147 -0
- simplexui/items/traversal.py +780 -0
- simplexui/items/treeItem.py +441 -0
- simplexui/main.pyw +22 -0
- simplexui/menu/__init__.py +73 -0
- simplexui/menu/dummyPlugins/__init__.py +16 -0
- simplexui/menu/genericPlugins/__init__.py +16 -0
- simplexui/menu/genericPlugins/_builtins.py +270 -0
- simplexui/menu/genericPlugins/checkPossibleCombos.py +48 -0
- simplexui/menu/genericPlugins/exportSplit.py +67 -0
- simplexui/menu/genericPlugins/showFalloffs.py +26 -0
- simplexui/menu/genericPlugins/showTraversals.py +26 -0
- simplexui/menu/genericPlugins/simplexUvTransfer.py +106 -0
- simplexui/menu/genericPlugins/unsubdivide.py +72 -0
- simplexui/menu/mayaPlugins/__init__.py +16 -0
- simplexui/menu/mayaPlugins/exportOther.py +53 -0
- simplexui/menu/mayaPlugins/extractProgressives.py +68 -0
- simplexui/menu/mayaPlugins/freezeCombo.py +247 -0
- simplexui/menu/mayaPlugins/generateShapeIncrementals.py +99 -0
- simplexui/menu/mayaPlugins/importObjs.py +199 -0
- simplexui/menu/mayaPlugins/linearizeTraversal.py +60 -0
- simplexui/menu/mayaPlugins/makeShelfBtn.py +67 -0
- simplexui/menu/mayaPlugins/relaxToSelection.py +76 -0
- simplexui/menu/mayaPlugins/reloadDefinition.py +44 -0
- simplexui/menu/mayaPlugins/snapToNeutral.py +71 -0
- simplexui/menu/mayaPlugins/softSelectToCluster.py +201 -0
- simplexui/menu/mayaPlugins/tweakMix.py +136 -0
- simplexui/menu/mayaPlugins/updateRestShape.py +113 -0
- simplexui/pysimplex.lib +0 -0
- simplexui/pysimplex.pyd +0 -0
- simplexui/simplexDialog.py +1547 -0
- simplexui/travCheckDialog.py +419 -0
- simplexui/traversalDialog.py +299 -0
- simplexui/ui/comboCheckDialog.ui +475 -0
- simplexui/ui/falloffDialog.ui +243 -0
- simplexui/ui/simplexDialog.ui +1458 -0
- simplexui/ui/travCheckDialog.ui +488 -0
- simplexui/ui/traversalDialog.ui +532 -0
- simplexui/utils.py +307 -0
|
@@ -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
|
+
from __future__ import annotations
|
|
19
|
+
|
|
20
|
+
import re
|
|
21
|
+
|
|
22
|
+
from Qt import QtCompat
|
|
23
|
+
from Qt.QtGui import QAction, QStandardItemModel
|
|
24
|
+
from Qt.QtWidgets import (
|
|
25
|
+
QApplication,
|
|
26
|
+
QDialog,
|
|
27
|
+
QFrame,
|
|
28
|
+
QInputDialog,
|
|
29
|
+
QMessageBox,
|
|
30
|
+
QProgressDialog,
|
|
31
|
+
QPushButton,
|
|
32
|
+
QVBoxLayout,
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
from .interface import DCC
|
|
36
|
+
from .interfaceModel import (
|
|
37
|
+
TraversalFilterModel,
|
|
38
|
+
TraversalModel,
|
|
39
|
+
coerceIndexToRoots,
|
|
40
|
+
coerceIndexToType,
|
|
41
|
+
)
|
|
42
|
+
from .interfaceModelTrees import TraversalTree
|
|
43
|
+
from .items import Group, Simplex, Slider, Traversal, TravPair
|
|
44
|
+
from .travCheckDialog import TraversalCheckDialog
|
|
45
|
+
from .utils import execwid, getUiFile, makeUnique
|
|
46
|
+
|
|
47
|
+
NAME_CHECK = re.compile(r"[A-Za-z][\w.]*")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class TraversalDialog(QDialog):
|
|
51
|
+
"""The dialog for dealing with Traversals
|
|
52
|
+
|
|
53
|
+
Parameters
|
|
54
|
+
----------
|
|
55
|
+
parent : SimplexDialog
|
|
56
|
+
The parent simplex dialog
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
uiTraversalLAY: QVBoxLayout
|
|
60
|
+
uiTravButtonFRM: QFrame
|
|
61
|
+
uiTravNewBTN: QPushButton
|
|
62
|
+
uiTravAddSliderBTN: QPushButton
|
|
63
|
+
uiTravNewGroupBTN: QPushButton
|
|
64
|
+
uiTravNewShapeBTN: QPushButton
|
|
65
|
+
uiTravDeleteBTN: QPushButton
|
|
66
|
+
uiShapeExtractBTN: QPushButton
|
|
67
|
+
uiShapeConnectBTN: QPushButton
|
|
68
|
+
|
|
69
|
+
uiConvertCorrectiveACT: QAction
|
|
70
|
+
uiDoubleSliderRangeACT: QAction
|
|
71
|
+
uiExportACT: QAction
|
|
72
|
+
uiExportObjPSDACT: QAction
|
|
73
|
+
uiExtractOnCreateACT: QAction
|
|
74
|
+
uiExtractPosedACT: QAction
|
|
75
|
+
uiHideRedundantACT: QAction
|
|
76
|
+
uiImportACT: QAction
|
|
77
|
+
uiImportObjPSDACT: QAction
|
|
78
|
+
uiLegacyJsonACT: QAction
|
|
79
|
+
uiLiveShapeConnectionACT: QAction
|
|
80
|
+
uiLiveUpdateACT: QAction
|
|
81
|
+
uiSetWorkingDirectoryACT: QAction
|
|
82
|
+
uiSplitShapePSDACT: QAction
|
|
83
|
+
|
|
84
|
+
def __init__(self, parent) -> None:
|
|
85
|
+
super().__init__(parent)
|
|
86
|
+
|
|
87
|
+
uiPath = getUiFile(__file__)
|
|
88
|
+
QtCompat.loadUi(uiPath, self)
|
|
89
|
+
self.parUI = parent
|
|
90
|
+
|
|
91
|
+
# Load the custom tree manually
|
|
92
|
+
self.uiTraversalTREE = TraversalTree(self)
|
|
93
|
+
self.uiTraversalTREE.setDragEnabled(False)
|
|
94
|
+
self.uiTraversalTREE.setDragDropMode(TraversalTree.DragDropMode.NoDragDrop)
|
|
95
|
+
self.uiTraversalTREE.setSelectionMode(
|
|
96
|
+
TraversalTree.SelectionMode.ExtendedSelection
|
|
97
|
+
)
|
|
98
|
+
self.uiTraversalTREE.dragFilter.dragPressed.connect(self.dragStart)
|
|
99
|
+
self.uiTraversalTREE.dragFilter.dragReleased.connect(self.dragStop)
|
|
100
|
+
|
|
101
|
+
self.uiTraversalLAY.addWidget(self.uiTraversalTREE)
|
|
102
|
+
self.simplex = None
|
|
103
|
+
self.parUI.simplexLoaded.connect(self.loadSimplex)
|
|
104
|
+
|
|
105
|
+
self.uiTravDeleteBTN.clicked.connect(self.deleteTrav)
|
|
106
|
+
self.uiTravNewBTN.clicked.connect(self.newTrav)
|
|
107
|
+
self.uiTravNewGroupBTN.clicked.connect(self.newGroup)
|
|
108
|
+
self.uiTravNewShapeBTN.clicked.connect(self.newShape)
|
|
109
|
+
self.uiTravAddSliderBTN.clicked.connect(self.addSlider)
|
|
110
|
+
self.uiShapeExtractBTN.clicked.connect(self.shapeExtract)
|
|
111
|
+
self.uiShapeConnectBTN.clicked.connect(self.shapeConnectFromSelection)
|
|
112
|
+
|
|
113
|
+
self.parUI.uiHideRedundantACT.toggled.connect(self.hideRedundant)
|
|
114
|
+
|
|
115
|
+
self.loadSimplex()
|
|
116
|
+
|
|
117
|
+
def hideRedundant(self) -> None:
|
|
118
|
+
"""Hide Redundant items in the ui based on the checkbox"""
|
|
119
|
+
if self.simplex is None:
|
|
120
|
+
return
|
|
121
|
+
check = self.uiHideRedundantACT.isChecked()
|
|
122
|
+
travModel = self.uiTraversalTREE.model()
|
|
123
|
+
travModel.doFilter = check
|
|
124
|
+
travModel.invalidateFilter()
|
|
125
|
+
|
|
126
|
+
def dragStart(self) -> None:
|
|
127
|
+
"""Slot for handling the start of a MMB Drag event"""
|
|
128
|
+
if self.simplex is not None:
|
|
129
|
+
self.simplex.DCC.undoOpen()
|
|
130
|
+
|
|
131
|
+
def dragStop(self) -> None:
|
|
132
|
+
"""Slot for handling the end of a MMB Drag event"""
|
|
133
|
+
if self.simplex is not None:
|
|
134
|
+
self.simplex.DCC.undoClose()
|
|
135
|
+
|
|
136
|
+
def loadSimplex(self) -> None:
|
|
137
|
+
"""Load the simplex system from the parent dialog"""
|
|
138
|
+
system = self.parUI.simplex
|
|
139
|
+
if system is None:
|
|
140
|
+
self.simplex = system
|
|
141
|
+
self.uiTraversalTREE.setModel(QStandardItemModel())
|
|
142
|
+
|
|
143
|
+
self.uiTravDeleteBTN.setEnabled(False)
|
|
144
|
+
self.uiTravNewBTN.setEnabled(False)
|
|
145
|
+
self.uiTravNewGroupBTN.setEnabled(False)
|
|
146
|
+
self.uiTravNewShapeBTN.setEnabled(False)
|
|
147
|
+
self.uiTravAddSliderBTN.setEnabled(False)
|
|
148
|
+
self.uiShapeExtractBTN.setEnabled(False)
|
|
149
|
+
self.uiShapeConnectBTN.setEnabled(False)
|
|
150
|
+
return
|
|
151
|
+
else:
|
|
152
|
+
self.uiTravDeleteBTN.setEnabled(True)
|
|
153
|
+
self.uiTravNewBTN.setEnabled(True)
|
|
154
|
+
self.uiTravNewGroupBTN.setEnabled(True)
|
|
155
|
+
self.uiTravNewShapeBTN.setEnabled(True)
|
|
156
|
+
self.uiTravAddSliderBTN.setEnabled(True)
|
|
157
|
+
self.uiShapeExtractBTN.setEnabled(True)
|
|
158
|
+
self.uiShapeConnectBTN.setEnabled(True)
|
|
159
|
+
|
|
160
|
+
if system == self.simplex:
|
|
161
|
+
return
|
|
162
|
+
|
|
163
|
+
self.simplex = system
|
|
164
|
+
|
|
165
|
+
sliderProxyModel = self.parUI.uiSliderTREE.model()
|
|
166
|
+
if not sliderProxyModel:
|
|
167
|
+
self.uiTraversalTREE.setModel(None)
|
|
168
|
+
return
|
|
169
|
+
sliderModel = sliderProxyModel.sourceModel()
|
|
170
|
+
simplexModel = sliderModel.sourceModel()
|
|
171
|
+
|
|
172
|
+
travModel = TraversalModel(simplexModel)
|
|
173
|
+
travProxModel = TraversalFilterModel(travModel)
|
|
174
|
+
self.uiTraversalTREE.setModel(travProxModel)
|
|
175
|
+
|
|
176
|
+
def deleteTrav(self) -> None:
|
|
177
|
+
"""Delete the selected traversals"""
|
|
178
|
+
idxs = self.uiTraversalTREE.getSelectedIndexes()
|
|
179
|
+
roots = coerceIndexToRoots(idxs)
|
|
180
|
+
if not roots:
|
|
181
|
+
QMessageBox.warning(self, "Warning", "Nothing Selected")
|
|
182
|
+
return
|
|
183
|
+
roots = makeUnique([i.model().itemFromIndex(i) for i in roots])
|
|
184
|
+
for r in roots:
|
|
185
|
+
if isinstance(r, Simplex):
|
|
186
|
+
QMessageBox.warning(
|
|
187
|
+
self, "Warning", "Cannot delete a simplex system this way (for now)"
|
|
188
|
+
)
|
|
189
|
+
return
|
|
190
|
+
|
|
191
|
+
pairs = [r for r in roots if isinstance(r, TravPair)]
|
|
192
|
+
roots = [r for r in roots if not isinstance(r, TravPair)]
|
|
193
|
+
|
|
194
|
+
for r in roots:
|
|
195
|
+
r.delete()
|
|
196
|
+
|
|
197
|
+
TravPair.removeAll(pairs)
|
|
198
|
+
|
|
199
|
+
self.uiTraversalTREE.model().invalidateFilter()
|
|
200
|
+
|
|
201
|
+
def newGroup(self) -> None:
|
|
202
|
+
"""Create a new group for organizing the traversals"""
|
|
203
|
+
if self.simplex is None:
|
|
204
|
+
return
|
|
205
|
+
newName, good = QInputDialog.getText(
|
|
206
|
+
self, "New Group", "Enter a name for the new group", text="Group"
|
|
207
|
+
)
|
|
208
|
+
if not good:
|
|
209
|
+
return
|
|
210
|
+
if not NAME_CHECK.match(newName):
|
|
211
|
+
message = "Group name can only contain letters and numbers, and cannot start with a number"
|
|
212
|
+
QMessageBox.warning(self, "Warning", message)
|
|
213
|
+
return
|
|
214
|
+
|
|
215
|
+
items = self.uiTraversalTREE.getSelectedItems(Slider)
|
|
216
|
+
Group.createGroup(str(newName), self.simplex, items)
|
|
217
|
+
|
|
218
|
+
def newShape(self) -> None:
|
|
219
|
+
"""Add a new shape to the traversal's Progression"""
|
|
220
|
+
pars = self.uiTraversalTREE.getSelectedIndexes()
|
|
221
|
+
if not pars:
|
|
222
|
+
return
|
|
223
|
+
travs = coerceIndexToType(pars, Traversal)
|
|
224
|
+
for travIdx in travs:
|
|
225
|
+
trav = travIdx.model().itemFromIndex(travIdx)
|
|
226
|
+
trav.prog.createShape()
|
|
227
|
+
|
|
228
|
+
def shapeExtract(self):
|
|
229
|
+
"""Extract a shape from the traversal's progression"""
|
|
230
|
+
indexes = self.uiTraversalTREE.getSelectedIndexes()
|
|
231
|
+
return self.parUI.shapeIndexExtract(indexes)
|
|
232
|
+
|
|
233
|
+
def newTrav(self) -> None:
|
|
234
|
+
"""Create a new traversal based on the selection in the main UI"""
|
|
235
|
+
sliders = self.parUI.uiSliderTREE.getSelectedItems(Slider)
|
|
236
|
+
if len(sliders) < 2:
|
|
237
|
+
message = "Must have at least 2 sliders selected"
|
|
238
|
+
QMessageBox.warning(self, "Warning", message)
|
|
239
|
+
return None
|
|
240
|
+
|
|
241
|
+
tcd = TraversalCheckDialog(
|
|
242
|
+
sliders, mode="create", parent=self, grandparent=self.parUI
|
|
243
|
+
)
|
|
244
|
+
tcd.move(self.pos())
|
|
245
|
+
execwid(tcd)
|
|
246
|
+
|
|
247
|
+
def addSlider(self) -> None:
|
|
248
|
+
"""Add a slider to the traversal's definition"""
|
|
249
|
+
# add the slider to both the start and end
|
|
250
|
+
travs = self.uiTraversalTREE.getSelectedItems(Traversal)
|
|
251
|
+
sliders = self.parUI.uiSliderTREE.getSelectedItems(Slider)
|
|
252
|
+
if not travs:
|
|
253
|
+
return
|
|
254
|
+
if not sliders:
|
|
255
|
+
return
|
|
256
|
+
for slider in sliders:
|
|
257
|
+
travs[-1].addSlider(slider)
|
|
258
|
+
|
|
259
|
+
def shapeConnectFromSelection(self) -> None:
|
|
260
|
+
"""Connect a shape into the traversal based on the DCC scene selection"""
|
|
261
|
+
if self.simplex is None:
|
|
262
|
+
return
|
|
263
|
+
# make a dict of name:object
|
|
264
|
+
sel = DCC.getSelectedObjects()
|
|
265
|
+
selDict = {}
|
|
266
|
+
for s in sel:
|
|
267
|
+
name = DCC.getObjectName(s)
|
|
268
|
+
if name.endswith("_Extract"):
|
|
269
|
+
nn = name.rsplit("_Extract", 1)[0]
|
|
270
|
+
selDict[nn] = s
|
|
271
|
+
|
|
272
|
+
pairDict = {}
|
|
273
|
+
for p in self.simplex.progs:
|
|
274
|
+
for pp in p.pairs:
|
|
275
|
+
pairDict[pp.shape.name] = pp
|
|
276
|
+
|
|
277
|
+
# get all common names
|
|
278
|
+
common = selDict.keys() & pairDict.keys()
|
|
279
|
+
|
|
280
|
+
# get those items
|
|
281
|
+
pairs = [pairDict[i] for i in common]
|
|
282
|
+
|
|
283
|
+
# Set up the progress bar
|
|
284
|
+
pBar = QProgressDialog("Connecting Shapes", "Cancel", 0, 100, self)
|
|
285
|
+
pBar.setMaximum(len(pairs))
|
|
286
|
+
|
|
287
|
+
# Do the extractions
|
|
288
|
+
for pair in pairs:
|
|
289
|
+
c = pair.prog.controller
|
|
290
|
+
c.connectShape(pair.shape, delete=True)
|
|
291
|
+
|
|
292
|
+
# ProgressBar
|
|
293
|
+
pBar.setValue(pBar.value() + 1)
|
|
294
|
+
pBar.setLabelText(f"Connecting:\n{pair.shape.name}")
|
|
295
|
+
QApplication.processEvents()
|
|
296
|
+
if pBar.wasCanceled():
|
|
297
|
+
return
|
|
298
|
+
|
|
299
|
+
pBar.close()
|