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.
- simplex_solver-3.1.0.dist-info/METADATA +90 -0
- simplex_solver-3.1.0.dist-info/RECORD +79 -0
- simplex_solver-3.1.0.dist-info/WHEEL +5 -0
- simplexui/__init__.py +53 -0
- simplexui/_version.py +1 -0
- simplexui/channelBox.py +858 -0
- simplexui/comboCheckDialog.py +343 -0
- simplexui/commands/__init__.py +16 -0
- simplexui/commands/alembicCommon.py +991 -0
- simplexui/commands/applyCorrectives.py +451 -0
- simplexui/commands/correctiveInterface.py +261 -0
- simplexui/commands/expandedExport.py +436 -0
- simplexui/commands/hdf5Convert.py +60 -0
- simplexui/commands/mayaCorrectiveInterface.py +161 -0
- simplexui/commands/mayatonumpy.py +375 -0
- simplexui/commands/mesh.py +1081 -0
- simplexui/commands/numpytoimath.py +319 -0
- simplexui/commands/poseblendlib.py +166 -0
- simplexui/commands/reorderSimplexPoints.py +102 -0
- simplexui/commands/rigidAlign.py +99 -0
- simplexui/commands/smpxBlend.py +629 -0
- simplexui/commands/unsubdivide.py +1227 -0
- simplexui/commands/uvTransfer.py +977 -0
- simplexui/dragFilter.py +299 -0
- simplexui/falloffDialog.py +471 -0
- simplexui/img/ChefHead.png +0 -0
- simplexui/img/frozen.png +0 -0
- simplexui/interface/__init__.py +28 -0
- simplexui/interface/dummyInterface.py +1585 -0
- simplexui/interface/mayaInterface.py +3271 -0
- simplexui/interfaceModel.py +1053 -0
- simplexui/interfaceModelTrees.py +441 -0
- simplexui/items/__init__.py +42 -0
- simplexui/items/accessor.py +213 -0
- simplexui/items/combo.py +852 -0
- simplexui/items/falloff.py +778 -0
- simplexui/items/group.py +297 -0
- simplexui/items/progression.py +743 -0
- simplexui/items/shape.py +443 -0
- simplexui/items/simplex.py +1764 -0
- simplexui/items/slider.py +738 -0
- simplexui/items/stack.py +154 -0
- simplexui/items/traversal.py +966 -0
- simplexui/main.pyw +22 -0
- simplexui/menu/__init__.py +69 -0
- simplexui/menu/dummyPlugins/__init__.py +16 -0
- simplexui/menu/genericPlugins/__init__.py +16 -0
- simplexui/menu/genericPlugins/_builtins.py +268 -0
- simplexui/menu/genericPlugins/checkPossibleCombos.py +45 -0
- simplexui/menu/genericPlugins/exportSplit.py +59 -0
- simplexui/menu/genericPlugins/showFalloffs.py +24 -0
- simplexui/menu/genericPlugins/showTraversals.py +24 -0
- simplexui/menu/genericPlugins/simplexUvTransfer.py +107 -0
- simplexui/menu/genericPlugins/unsubdivide.py +70 -0
- simplexui/menu/mayaPlugins/__init__.py +16 -0
- simplexui/menu/mayaPlugins/exportOther.py +43 -0
- simplexui/menu/mayaPlugins/extractProgressives.py +65 -0
- simplexui/menu/mayaPlugins/freezeCombo.py +245 -0
- simplexui/menu/mayaPlugins/generateShapeIncrementals.py +97 -0
- simplexui/menu/mayaPlugins/importObjs.py +193 -0
- simplexui/menu/mayaPlugins/linearizeTraversal.py +48 -0
- simplexui/menu/mayaPlugins/makeShelfBtn.py +65 -0
- simplexui/menu/mayaPlugins/relaxToSelection.py +75 -0
- simplexui/menu/mayaPlugins/reloadDefinition.py +33 -0
- simplexui/menu/mayaPlugins/snapToNeutral.py +72 -0
- simplexui/menu/mayaPlugins/softSelectToCluster.py +200 -0
- simplexui/menu/mayaPlugins/tweakMix.py +134 -0
- simplexui/menu/mayaPlugins/updateRestShape.py +105 -0
- simplexui/pysimplex.dll.a +0 -0
- simplexui/pysimplex.pyd +0 -0
- simplexui/simplexDialog.py +1454 -0
- simplexui/travCheckDialog.py +397 -0
- simplexui/traversalDialog.py +271 -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 +320 -0
|
@@ -0,0 +1,134 @@
|
|
|
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 functools import partial
|
|
19
|
+
|
|
20
|
+
import maya.cmds as cmds
|
|
21
|
+
|
|
22
|
+
from ...interface.mayaInterface import disconnected
|
|
23
|
+
from ...interfaceModel import coerceIndexToType
|
|
24
|
+
from ...items import Combo
|
|
25
|
+
from Qt.QtWidgets import QAction
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def registerTool(window, menu):
|
|
29
|
+
tweakMixACT = QAction("Tweak Mix", window)
|
|
30
|
+
menu.addAction(tweakMixACT)
|
|
31
|
+
tweakMixACT.triggered.connect(partial(tweakMixInterface, window))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def tweakMixInterface(window):
|
|
35
|
+
if not window.simplex:
|
|
36
|
+
return
|
|
37
|
+
live = window.uiLiveShapeConnectionACT.isChecked()
|
|
38
|
+
|
|
39
|
+
indexes = window.uiComboTREE.selectedIndexes()
|
|
40
|
+
indexes = coerceIndexToType(indexes, Combo)
|
|
41
|
+
if not indexes:
|
|
42
|
+
return
|
|
43
|
+
combos = [idx.model().itemFromIndex(idx) for idx in indexes]
|
|
44
|
+
combos = list(set(combos))
|
|
45
|
+
tweakMix(window.simplex, combos, live)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def registerContext(tree, clickIdx, indexes, menu):
|
|
49
|
+
window = tree.window()
|
|
50
|
+
live = window.uiLiveShapeConnectionACT.isChecked()
|
|
51
|
+
indexes = coerceIndexToType(indexes, Combo)
|
|
52
|
+
if indexes:
|
|
53
|
+
indexes = list(set(indexes))
|
|
54
|
+
tweakMixACT = menu.addAction("Tweak Mix")
|
|
55
|
+
tweakMixACT.triggered.connect(partial(tweakMixContext, window, indexes, live))
|
|
56
|
+
return True
|
|
57
|
+
return False
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def tweakMixContext(window, indexes, live):
|
|
61
|
+
combos = [idx.model().itemFromIndex(idx) for idx in indexes]
|
|
62
|
+
combos = list(set(combos))
|
|
63
|
+
tweakMix(window.simplex, combos, live)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def tweakMix(simplex, combos, live):
|
|
67
|
+
# first extract the rest shape non-live
|
|
68
|
+
restGeo = simplex.extractRestShape()
|
|
69
|
+
|
|
70
|
+
floatShapes = simplex.getFloatingShapes()
|
|
71
|
+
floatShapes = [i.thing for i in floatShapes]
|
|
72
|
+
|
|
73
|
+
offset = 5
|
|
74
|
+
for combo in combos:
|
|
75
|
+
offset += 5
|
|
76
|
+
|
|
77
|
+
shape = None
|
|
78
|
+
for pp in combo.prog.pairs:
|
|
79
|
+
if pp.value == 1.0:
|
|
80
|
+
shape = pp.shape
|
|
81
|
+
break
|
|
82
|
+
else:
|
|
83
|
+
continue
|
|
84
|
+
|
|
85
|
+
geo = combo.extractShape(shape, live=live, offset=offset)
|
|
86
|
+
# disconnect the controller from the operator
|
|
87
|
+
tweakShapes = []
|
|
88
|
+
with disconnected(simplex.DCC.op) as sliderCnx:
|
|
89
|
+
# disconnect any float shapes
|
|
90
|
+
with disconnected(floatShapes):
|
|
91
|
+
cnx = sliderCnx[simplex.DCC.op]
|
|
92
|
+
for a in cnx.values():
|
|
93
|
+
cmds.setAttr(a, 0.0)
|
|
94
|
+
|
|
95
|
+
# set the combo values
|
|
96
|
+
for pair in combo.pairs:
|
|
97
|
+
cmds.setAttr(cnx[pair.slider.thing], pair.value)
|
|
98
|
+
|
|
99
|
+
for shape in simplex.shapes[1:]: # skip the restShape
|
|
100
|
+
shapeVal = cmds.getAttr(shape.thing)
|
|
101
|
+
if shapeVal != 0.0: # maybe handle floating point errors
|
|
102
|
+
tweakShapes.append((shape, shapeVal))
|
|
103
|
+
|
|
104
|
+
tweakMeshes = []
|
|
105
|
+
with disconnected(simplex.DCC.shapeNode) as shapeCnx:
|
|
106
|
+
cnx = shapeCnx[simplex.DCC.shapeNode]
|
|
107
|
+
for a in cnx.values():
|
|
108
|
+
cmds.setAttr(a, 0.0)
|
|
109
|
+
for tshape, shapeVal in tweakShapes:
|
|
110
|
+
cmds.setAttr(tshape.thing, shapeVal)
|
|
111
|
+
# print "setAttr", tshape.thing, shapeVal
|
|
112
|
+
tweakMesh = cmds.duplicate(
|
|
113
|
+
simplex.DCC.mesh, name="{0}_Tweak".format(tshape.name)
|
|
114
|
+
)[0]
|
|
115
|
+
tweakMeshes.append(tweakMesh)
|
|
116
|
+
cmds.setAttr(tshape.thing, 0.0)
|
|
117
|
+
|
|
118
|
+
# Yeah, yeah, this is REALLY ugly, but it's quick and it works
|
|
119
|
+
tempBS = cmds.blendShape(geo, name="Temp_BS")
|
|
120
|
+
cmds.blendShape(tempBS, edit=True, target=(geo, 0, restGeo, 1.0))
|
|
121
|
+
cmds.blendShape(tempBS, edit=True, weight=[(0, 1.0)])
|
|
122
|
+
cmds.delete(geo, constructionHistory=True)
|
|
123
|
+
|
|
124
|
+
# build the actual blendshape
|
|
125
|
+
tweakBS = cmds.blendShape(geo, name="Tweak_BS")
|
|
126
|
+
for i, tm in enumerate(tweakMeshes):
|
|
127
|
+
cmds.blendShape(tweakBS, edit=True, target=(geo, i, tm, 1.0))
|
|
128
|
+
tmLen = len(tweakMeshes)
|
|
129
|
+
cmds.blendShape(
|
|
130
|
+
tweakBS, edit=True, weight=list(zip(list(range(tmLen)), [1.0] * tmLen))
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
cmds.delete(tweakMeshes)
|
|
134
|
+
cmds.delete(restGeo)
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
import textwrap
|
|
19
|
+
from functools import partial
|
|
20
|
+
|
|
21
|
+
import maya.cmds as cmds
|
|
22
|
+
|
|
23
|
+
from Qt.QtWidgets import QAction, QMessageBox
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def registerTool(window, menu):
|
|
27
|
+
updateRestShapeACT = QAction("Update Rest Shape", window)
|
|
28
|
+
menu.addAction(updateRestShapeACT)
|
|
29
|
+
updateRestShapeACT.triggered.connect(partial(updateRestShapeInterface, window))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def updateRestShapeInterface(window):
|
|
33
|
+
sel = cmds.ls(sl=True)
|
|
34
|
+
if not sel:
|
|
35
|
+
QMessageBox.warning(window, "Nothing Selected", "Nothing Selected")
|
|
36
|
+
return
|
|
37
|
+
sel = sel[0]
|
|
38
|
+
mesh = window.simplex.DCC.mesh
|
|
39
|
+
|
|
40
|
+
# TODO, Check vert number and blendshape input connections
|
|
41
|
+
selVerts = cmds.polyEvaluate(sel, vertex=1)
|
|
42
|
+
meshVerts = cmds.polyEvaluate(mesh, vertex=1)
|
|
43
|
+
|
|
44
|
+
if selVerts != meshVerts:
|
|
45
|
+
msg = "Selected object {0} has {1} verts\nBase Object has {2} verts".format(
|
|
46
|
+
sel, selVerts, meshVerts
|
|
47
|
+
)
|
|
48
|
+
QMessageBox.warning(window, "Vert Mismatch", msg)
|
|
49
|
+
return
|
|
50
|
+
|
|
51
|
+
# TODO Check for live connections
|
|
52
|
+
bs = window.simplex.DCC.shapeNode
|
|
53
|
+
cnx = cmds.listConnections(bs, plugs=1, destination=0, type="mesh")
|
|
54
|
+
if cnx:
|
|
55
|
+
cnxs = ", ".join([i.split(".")[0] for i in cnx])
|
|
56
|
+
cnxs = textwrap.fill(cnxs)
|
|
57
|
+
msg = [
|
|
58
|
+
"Some shapes have a live input connection:",
|
|
59
|
+
cnxs,
|
|
60
|
+
"",
|
|
61
|
+
"These shapes will not get the update.",
|
|
62
|
+
"Continue anyway?",
|
|
63
|
+
]
|
|
64
|
+
msg = "\n".join(msg)
|
|
65
|
+
btns = QMessageBox.StandardButton.Ok | QMessageBox.StandardButton.Cancel
|
|
66
|
+
bret = QMessageBox.question(window, "Live Connections", msg, btns)
|
|
67
|
+
if not bret & QMessageBox.StandardButton.Ok:
|
|
68
|
+
return
|
|
69
|
+
|
|
70
|
+
updateRestShape(mesh, sel, window=window)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def updateRestShape(mesh, newRest, window=None):
|
|
74
|
+
allShapes = cmds.listRelatives(mesh, children=1, shapes=1) or []
|
|
75
|
+
noInter = cmds.listRelatives(mesh, children=1, shapes=1, noIntermediate=1) or []
|
|
76
|
+
hist = cmds.listHistory(mesh)
|
|
77
|
+
inter = (set(allShapes) - set(noInter)) & set(hist)
|
|
78
|
+
if not inter:
|
|
79
|
+
if window is not None:
|
|
80
|
+
QMessageBox.warning(
|
|
81
|
+
window, "No Intermediates", "No intermediate meshes found"
|
|
82
|
+
)
|
|
83
|
+
return
|
|
84
|
+
inter = list(inter)
|
|
85
|
+
|
|
86
|
+
if len(inter) == 1:
|
|
87
|
+
orig = inter[0]
|
|
88
|
+
else:
|
|
89
|
+
origs = [i for i in inter if "Orig" in i]
|
|
90
|
+
if len(origs) != 1:
|
|
91
|
+
if window is not None:
|
|
92
|
+
QMessageBox.warning(
|
|
93
|
+
window,
|
|
94
|
+
"Too Many Intermediates",
|
|
95
|
+
"Too Many intermediate meshes found: {0}".format(origs),
|
|
96
|
+
)
|
|
97
|
+
return
|
|
98
|
+
orig = origs[0]
|
|
99
|
+
|
|
100
|
+
outMesh = "{0}.worldMesh[0]".format(newRest)
|
|
101
|
+
inMesh = "{0}.inMesh".format(orig)
|
|
102
|
+
|
|
103
|
+
cmds.connectAttr(outMesh, inMesh, force=1)
|
|
104
|
+
cmds.refresh(force=1)
|
|
105
|
+
cmds.disconnectAttr(outMesh, inMesh)
|
|
Binary file
|
simplexui/pysimplex.pyd
ADDED
|
Binary file
|