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.
- pysimplex.pyd +0 -0
- simplex_solver-3.0.18.dist-info/METADATA +87 -0
- simplex_solver-3.0.18.dist-info/RECORD +81 -0
- simplex_solver-3.0.18.dist-info/WHEEL +5 -0
- simplex_solver-3.0.18.dist-info/licenses/LICENSE +165 -0
- simplexui/__init__.py +54 -0
- simplexui/channelBox.py +862 -0
- simplexui/comboCheckDialog.py +335 -0
- simplexui/commands/__init__.py +16 -0
- simplexui/commands/alembicCommon.py +1045 -0
- simplexui/commands/applyCorrectives.py +455 -0
- simplexui/commands/buildIceXML.py +443 -0
- simplexui/commands/correctiveInterface.py +271 -0
- simplexui/commands/expandedExport.py +435 -0
- simplexui/commands/hdf5Convert.py +62 -0
- simplexui/commands/mayaCorrectiveInterface.py +164 -0
- simplexui/commands/mesh.py +1086 -0
- simplexui/commands/reorderSimplexPoints.py +103 -0
- simplexui/commands/rigidAlign.py +103 -0
- simplexui/commands/setDelta.xsicompound +60 -0
- simplexui/commands/smpxBlend.py +634 -0
- simplexui/commands/unsubdivide.py +1232 -0
- simplexui/commands/uvTransfer.py +986 -0
- simplexui/commands/xsiCorrectiveInterface.py +136 -0
- simplexui/dragFilter.py +299 -0
- simplexui/falloffDialog.py +476 -0
- simplexui/img/ChefHead.png +0 -0
- simplexui/img/frozen.png +0 -0
- simplexui/interface/__init__.py +30 -0
- simplexui/interface/dummyInterface.py +1564 -0
- simplexui/interface/mayaInterface.py +3197 -0
- simplexui/interface/xsiInterface.py +2944 -0
- simplexui/interfaceModel.py +1040 -0
- simplexui/interfaceModelTrees.py +439 -0
- simplexui/interfaceModel_Test.py +259 -0
- simplexui/items/__init__.py +26 -0
- simplexui/items/accessor.py +217 -0
- simplexui/items/combo.py +855 -0
- simplexui/items/falloff.py +780 -0
- simplexui/items/group.py +295 -0
- simplexui/items/progression.py +745 -0
- simplexui/items/shape.py +444 -0
- simplexui/items/simplex.py +1747 -0
- simplexui/items/slider.py +741 -0
- simplexui/items/stack.py +156 -0
- simplexui/items/traversal.py +969 -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 +260 -0
- simplexui/menu/genericPlugins/checkPossibleCombos.py +47 -0
- simplexui/menu/genericPlugins/exportSplit.py +61 -0
- simplexui/menu/genericPlugins/showFalloffs.py +24 -0
- simplexui/menu/genericPlugins/showTraversals.py +24 -0
- simplexui/menu/genericPlugins/simplexUvTransfer.py +109 -0
- simplexui/menu/genericPlugins/unsubdivide.py +71 -0
- simplexui/menu/mayaPlugins/__init__.py +16 -0
- simplexui/menu/mayaPlugins/exportOther.py +45 -0
- simplexui/menu/mayaPlugins/extractProgressives.py +67 -0
- simplexui/menu/mayaPlugins/freezeCombo.py +251 -0
- simplexui/menu/mayaPlugins/generateShapeIncrementals.py +100 -0
- simplexui/menu/mayaPlugins/importObjs.py +196 -0
- simplexui/menu/mayaPlugins/linearizeTraversal.py +49 -0
- simplexui/menu/mayaPlugins/makeShelfBtn.py +69 -0
- simplexui/menu/mayaPlugins/relaxToSelection.py +77 -0
- simplexui/menu/mayaPlugins/reloadDefinition.py +34 -0
- simplexui/menu/mayaPlugins/snapToNeutral.py +74 -0
- simplexui/menu/mayaPlugins/softSelectToCluster.py +204 -0
- simplexui/menu/mayaPlugins/tweakMix.py +138 -0
- simplexui/menu/mayaPlugins/updateRestShape.py +107 -0
- simplexui/menu/xsiPlugins/__init__.py +16 -0
- simplexui/simplexDialog.py +1391 -0
- simplexui/travCheckDialog.py +393 -0
- simplexui/traversalDialog.py +277 -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,62 @@
|
|
|
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 absolute_import
|
|
19
|
+
|
|
20
|
+
import json
|
|
21
|
+
|
|
22
|
+
from .alembicCommon import buildSmpx, readSmpx
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def hdf5Convert(inPath, outPath, ogawa=False):
|
|
26
|
+
"""Load and parse all the data from a simplex file
|
|
27
|
+
|
|
28
|
+
Parameters
|
|
29
|
+
----------
|
|
30
|
+
inPath : str
|
|
31
|
+
The input .smpx file path
|
|
32
|
+
outPath : str
|
|
33
|
+
The output .smpx file path
|
|
34
|
+
ogawa : bool
|
|
35
|
+
Whether to write out in Ogawa format. Defaults False
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
|
|
40
|
+
"""
|
|
41
|
+
jsString, counts, verts, faces, uvs, uvFaces = readSmpx(inPath)
|
|
42
|
+
|
|
43
|
+
js = json.loads(jsString)
|
|
44
|
+
name = js["systemName"]
|
|
45
|
+
|
|
46
|
+
buildSmpx(
|
|
47
|
+
outPath,
|
|
48
|
+
verts,
|
|
49
|
+
faces,
|
|
50
|
+
jsString,
|
|
51
|
+
name,
|
|
52
|
+
faceCounts=counts,
|
|
53
|
+
uvs=uvs,
|
|
54
|
+
uvFaces=uvFaces,
|
|
55
|
+
ogawa=ogawa,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
if __name__ == "__main__":
|
|
60
|
+
inPath = r"D:\Users\tyler\Desktop\Head_Morphs_Main_Head-Face_v0010.smpx"
|
|
61
|
+
outPath = r"D:\Users\tyler\Desktop\Head_ogawa.smpx"
|
|
62
|
+
hdf5Convert(inPath, outPath, ogawa=True)
|
|
@@ -0,0 +1,164 @@
|
|
|
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 Maya """
|
|
19
|
+
|
|
20
|
+
from __future__ import absolute_import
|
|
21
|
+
|
|
22
|
+
from ctypes import c_float
|
|
23
|
+
|
|
24
|
+
from maya import OpenMaya as om
|
|
25
|
+
from maya import cmds
|
|
26
|
+
from six.moves import range
|
|
27
|
+
|
|
28
|
+
try:
|
|
29
|
+
import numpy as np
|
|
30
|
+
except ImportError:
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def setPose(pvp, multiplier):
|
|
35
|
+
"""Set a percentage of a pose
|
|
36
|
+
|
|
37
|
+
Parameters
|
|
38
|
+
----------
|
|
39
|
+
pvp : [(str, float), ...]
|
|
40
|
+
A list of property/value pairs
|
|
41
|
+
multiplier : float
|
|
42
|
+
The percentage multiplier of the pose
|
|
43
|
+
"""
|
|
44
|
+
for prop, val in pvp:
|
|
45
|
+
cmds.setAttr(prop, val * multiplier)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def resetPose(pvp):
|
|
49
|
+
"""Reset everything back to rest
|
|
50
|
+
|
|
51
|
+
Parameters
|
|
52
|
+
----------
|
|
53
|
+
pvp : [(str, float), ...]
|
|
54
|
+
A list of property/value pairs
|
|
55
|
+
"""
|
|
56
|
+
for prop, val in pvp:
|
|
57
|
+
cmds.setAttr(prop, 0)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def _getDagPath(mesh):
|
|
61
|
+
sl = om.MSelectionList()
|
|
62
|
+
sl.add(mesh)
|
|
63
|
+
dagPath = om.MDagPath()
|
|
64
|
+
sl.getDagPath(0, dagPath)
|
|
65
|
+
return dagPath
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _getMayaPoints(meshFn):
|
|
69
|
+
rawPts = meshFn.getRawPoints()
|
|
70
|
+
ptCount = meshFn.numVertices()
|
|
71
|
+
cta = (c_float * 3 * ptCount).from_address(int(rawPts))
|
|
72
|
+
out = np.ctypeslib.as_array(cta)
|
|
73
|
+
out = np.copy(out)
|
|
74
|
+
out = out.reshape((-1, 3))
|
|
75
|
+
return out
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def getDeformerChain(chkObj):
|
|
79
|
+
# Follow the deformer chain
|
|
80
|
+
memo = []
|
|
81
|
+
while chkObj and chkObj not in memo:
|
|
82
|
+
memo.append(chkObj)
|
|
83
|
+
|
|
84
|
+
typ = cmds.nodeType(chkObj)
|
|
85
|
+
if typ == "mesh":
|
|
86
|
+
cnx = cmds.listConnections(
|
|
87
|
+
chkObj + ".inMesh", destination=False, shapes=True
|
|
88
|
+
) or [None]
|
|
89
|
+
chkObj = cnx[0]
|
|
90
|
+
elif typ == "groupParts":
|
|
91
|
+
cnx = cmds.listConnections(
|
|
92
|
+
chkObj + ".inputGeometry", destination=False, shapes=True
|
|
93
|
+
) or [None]
|
|
94
|
+
chkObj = cnx[0]
|
|
95
|
+
elif typ == "polySoftEdge":
|
|
96
|
+
cnx = cmds.listConnections(
|
|
97
|
+
chkObj + ".inputPolymesh", destination=False, shapes=True
|
|
98
|
+
) or [None]
|
|
99
|
+
chkObj = cnx[0]
|
|
100
|
+
elif typ == "AlembicNode":
|
|
101
|
+
# Alembic nodes aren't part of the deformer chain
|
|
102
|
+
# Cut it off, and return
|
|
103
|
+
return memo[:-1]
|
|
104
|
+
else:
|
|
105
|
+
cnx = cmds.ls(chkObj, type="geometryFilter") or [None]
|
|
106
|
+
chkObj = cnx[0]
|
|
107
|
+
if chkObj: # we have a deformer
|
|
108
|
+
# Get the mesh index of this deformer
|
|
109
|
+
cnx = cmds.listConnections(
|
|
110
|
+
chkObj, connections=True, plugs=True, source=False
|
|
111
|
+
)
|
|
112
|
+
prev = cmds.ls(memo[-2])[0] # Get the minimal unique name for testing
|
|
113
|
+
defIdx = 0
|
|
114
|
+
for i in range(0, len(cnx), 2):
|
|
115
|
+
if cnx[i + 1].startswith(prev):
|
|
116
|
+
defIdx = int(cnx[i].split("[")[-1][:-1])
|
|
117
|
+
break
|
|
118
|
+
# Use that mesh index to get the output
|
|
119
|
+
cnx = cmds.listConnections(
|
|
120
|
+
chkObj + ".input[{0}].inputGeometry".format(defIdx),
|
|
121
|
+
destination=False,
|
|
122
|
+
shapes=True,
|
|
123
|
+
) or [None]
|
|
124
|
+
chkObj = cnx[0]
|
|
125
|
+
|
|
126
|
+
return memo
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def getShiftValues(thing):
|
|
130
|
+
"""Shift the vertices along each axis *before* the skinning
|
|
131
|
+
op in the deformer history
|
|
132
|
+
|
|
133
|
+
Parameters
|
|
134
|
+
----------
|
|
135
|
+
mesh : str
|
|
136
|
+
The name of a mesh
|
|
137
|
+
|
|
138
|
+
Returns
|
|
139
|
+
-------
|
|
140
|
+
: [vert, ...]
|
|
141
|
+
A list of un-shifted vertices
|
|
142
|
+
: [vert, ...]
|
|
143
|
+
A list of vertices pre-shifted by 1 along the X axis
|
|
144
|
+
: [vert, ...]
|
|
145
|
+
A list of vertices pre-shifted by 1 along the Y axis
|
|
146
|
+
: [vert, ...]
|
|
147
|
+
A list of vertices pre-shifted by 1 along the Z axis
|
|
148
|
+
"""
|
|
149
|
+
orig = getDeformerChain(thing)[-1]
|
|
150
|
+
|
|
151
|
+
dp = _getDagPath(thing)
|
|
152
|
+
meshFn = om.MFnMesh(dp)
|
|
153
|
+
allVerts = "{0}.vtx[*]".format(orig)
|
|
154
|
+
|
|
155
|
+
zero = _getMayaPoints(meshFn)
|
|
156
|
+
cmds.move(1, 0, 0, allVerts, relative=1, objectSpace=1)
|
|
157
|
+
oneX = _getMayaPoints(meshFn)
|
|
158
|
+
cmds.move(-1, 1, 0, allVerts, relative=1, objectSpace=1)
|
|
159
|
+
oneY = _getMayaPoints(meshFn)
|
|
160
|
+
cmds.move(0, -1, 1, allVerts, relative=1, objectSpace=1)
|
|
161
|
+
oneZ = _getMayaPoints(meshFn)
|
|
162
|
+
cmds.move(0, 0, -1, allVerts, relative=1, objectSpace=1)
|
|
163
|
+
|
|
164
|
+
return zero, oneX, oneY, oneZ
|