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,103 @@
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
+ """ Transfer shapes between mismatched models
19
+
20
+ Given a 1:1 point correspondence, transfer the shapes from one
21
+ geometry to another. Figuring out the correspondence is currently
22
+ outside the scope of this tool, though I may release one later.
23
+
24
+ The point correspondence should look like an unordered range, and
25
+ will be used as a numpy index to get the output values. It's also
26
+ possible to invert the range if you think you've got it backwards
27
+ """
28
+ # pylint:disable=wrong-import-position
29
+ from __future__ import absolute_import, print_function
30
+
31
+ import json
32
+
33
+ from .alembicCommon import buildSmpx, readSmpx
34
+
35
+ try:
36
+ import numpy as np
37
+ except ImportError:
38
+ pass
39
+
40
+
41
+ def reorderSimplexPoints(sourcePath, matchPath, outPath, invertMatch=False):
42
+ """Transfer shape data from the sourcePath using the numpy int array
43
+ at matchPath to make the final output at outPath
44
+
45
+ Parameters
46
+ ----------
47
+ sourcePath : str
48
+ The source .smpx file path
49
+ matchPath : str
50
+ The new vert order in numpy, or json format. The data should be an Nx2 array
51
+ of integers
52
+ outPath : str
53
+ The new output .smpx path
54
+ invertMatch : bool
55
+ Whether to directly apply the match from matchPath, or whether to invert it
56
+
57
+ Returns
58
+ -------
59
+
60
+ """
61
+ jsString, counts, verts, faces, uvs, uvFaces = readSmpx(sourcePath)
62
+
63
+ js = json.loads(jsString)
64
+ name = js["systemName"]
65
+
66
+ print("Loading Correspondence")
67
+ if matchPath.endswith(".json"):
68
+ with open(matchPath, "r") as f:
69
+ c = json.load(f)
70
+ c = np.array(c)
71
+ else:
72
+ c = np.load(matchPath)
73
+
74
+ c = c[c[:, 0].argsort()].T[1]
75
+ ci = c.argsort()
76
+ if invertMatch:
77
+ ci, c = c, ci
78
+
79
+ print("Reordering")
80
+ verts = verts[:, c, :]
81
+ faces = ci[faces]
82
+
83
+ buildSmpx(
84
+ outPath,
85
+ verts,
86
+ faces,
87
+ jsString,
88
+ name,
89
+ faceCounts=counts,
90
+ uvs=uvs,
91
+ uvFaces=uvFaces,
92
+ )
93
+
94
+
95
+ if __name__ == "__main__":
96
+ import os
97
+
98
+ base = r"K:\Departments\CharacterModeling\Library\Head\MaleHead_Standard\005"
99
+ _sourcePath = os.path.join(base, "HeadMaleStandard_High_Split_BadOrder.smpx")
100
+ _matchPath = os.path.join(base, "Reorder.np")
101
+ _outPath = os.path.join(base, "HeadMaleStandard_High_Split2.smpx")
102
+
103
+ reorderSimplexPoints(_sourcePath, _matchPath, _outPath)
@@ -0,0 +1,103 @@
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
+ from six.moves import range
21
+
22
+ try:
23
+ import numpy as np
24
+ except ImportError:
25
+ pass
26
+
27
+
28
+ def rigidAlign(P, Q, iters=10):
29
+ """Rigidly align meshes with matching vert order by a least-squares error.
30
+ Uses a variation of an algorithm by Umeyama
31
+ Relevant links:
32
+ * https://gist.github.com/nh2/bc4e2981b0e213fefd4aaa33edfb3893 (this code)
33
+ * http://stackoverflow.com/a/32244818/263061 (solution with scale)
34
+
35
+ Parameters
36
+ ----------
37
+ P : np.array
38
+ Static set of points
39
+ Q : np.array
40
+ Points to align with non-uniform scale
41
+ iters : int
42
+ The number of iterations (Defaults to 10)
43
+
44
+ Returns
45
+ -------
46
+ : np.array
47
+ The 4x4 transformation matrix that most closely aligns Q to P
48
+ """
49
+ # pylint:disable=invalid-name
50
+ assert P.shape == Q.shape
51
+
52
+ n, dim = P.shape
53
+ assert dim == 3
54
+
55
+ if iters <= 1:
56
+ raise ValueError("Must run at least 1 iteration")
57
+
58
+ # Get the centroid of each object
59
+ Qm = Q.mean(axis=0)
60
+ Pm = P.mean(axis=0)
61
+
62
+ # Subtract out the centroid to get the basic aligned mesh
63
+ cP = P - Pm # centeredP
64
+ cQRaw = Q - Qm # centeredQ
65
+
66
+ cQ = cQRaw.copy()
67
+ cumulation = np.eye(3) # build an accumulator for the rotation
68
+
69
+ # Here, we find an approximate rotation and scaling, but only
70
+ # keep track of the accumulated rotations.
71
+ # Then we apply the non-uniform scale by comparing bounding boxes
72
+ # This way we don't get any shear in our matrix, and we relatively
73
+ # quickly walk our way towards a minimum
74
+ for _ in range(iters):
75
+ # Magic?
76
+ C = np.dot(cP.T, cQ) / n
77
+ V, S, W = np.linalg.svd(C)
78
+
79
+ # Handle negative scaling
80
+ d = (np.linalg.det(V) * np.linalg.det(W)) < 0.0
81
+ if d:
82
+ S[-1] = -S[-1]
83
+ V[:, -1] = -V[:, -1]
84
+
85
+ # build the rotation matrix for this iteration
86
+ # and add it to the accumulation
87
+ R = np.dot(V, W)
88
+ cumulation = np.dot(cumulation, R.T)
89
+
90
+ # Now apply the accumulated rotation to the raw point positions
91
+ # Then grab the non-uniform scaling from the bounding box
92
+ # And set up cQ for the next iteration
93
+ cQ = np.dot(cQRaw, cumulation)
94
+ sf = (cP.max(axis=0) - cP.min(axis=0)) / (cQ.max(axis=0) - cQ.min(axis=0))
95
+ cQ = cQ * sf
96
+
97
+ # Build the final transformation
98
+ csf = cumulation * sf
99
+ tran = Pm - Qm.dot(csf)
100
+ outMat = np.eye(4)
101
+ outMat[:3, :3] = csf
102
+ outMat[3, :3] = tran
103
+ return outMat
@@ -0,0 +1,60 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsi_file type="CompoundNode" name="setDelta" formatversion="1.4" compoundversion="1.0">
3
+ <definition>
4
+ <nodes>
5
+ <node type="SetOneDataNode" index="0">
6
+ <param name="reference" type="31" value="Self.PointPosition"></param>
7
+ <param_ext name="reference" type="31" value="Self.PointPosition"></param_ext>
8
+ <portdef name="source" type="16" structure="1" group="1" instance="0" port="0"></portdef>
9
+ <portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
10
+ </node>
11
+ <node type="GetDataNode" index="1">
12
+ <param name="reference" type="31" value="self.pointposition"></param>
13
+ <param_ext name="reference" type="31" value="self.pointposition"></param_ext>
14
+ <portdef name="source" type="2048" structure="1" group="1" instance="0" port="0"></portdef>
15
+ <portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
16
+ </node>
17
+ <node type="GetDataNode" index="2">
18
+ <param name="reference" type="31" value="this_model.Rester.PointPosition"></param>
19
+ <param_ext name="reference" type="31" value="this_model.Rester.PointPosition"></param_ext>
20
+ <portdef name="source" type="2048" structure="1" group="1" instance="0" port="0"></portdef>
21
+ <portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
22
+ </node>
23
+ <node type="GetDataNode" index="3">
24
+ <param name="reference" type="31" value="this_model.Loader.PointPosition"></param>
25
+ <param_ext name="reference" type="31" value="this_model.Loader.PointPosition"></param_ext>
26
+ <portdef name="source" type="2048" structure="1" group="1" instance="0" port="0"></portdef>
27
+ <portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
28
+ </node>
29
+ <node type="SwitchContextNode" index="4">
30
+ <portdef name="value" type="16" structure="1" group="0" instance="0" port="0"></portdef>
31
+ </node>
32
+ <node type="SubtractNode" index="5">
33
+ <portdef name="first" type="16" structure="1" group="0" instance="0" port="0"></portdef>
34
+ <portdef name="second" type="16" structure="1" group="0" instance="0" port="1"></portdef>
35
+ </node>
36
+ <node type="AddNode" index="6">
37
+ <portdef name="value1" type="16" structure="1" group="0" instance="0" port="0"></portdef>
38
+ <portdef name="value2" type="16" structure="1" group="0" instance="1" port="0"></portdef>
39
+ </node>
40
+ <node type="SwitchContextNode" index="7">
41
+ <portdef name="value" type="16" structure="1" group="0" instance="0" port="0"></portdef>
42
+ </node>
43
+ </nodes>
44
+ <exposed_ports>
45
+ <port index="0" portname="value" username="Value" basename="Value" portlabel="Value" exposetype="single"> </port>
46
+ </exposed_ports>
47
+ <connections>
48
+ <cnx from_node="2" from_port="value" to_node="4" to_port="value"> </cnx>
49
+ <cnx from_node="3" from_port="value" to_node="7" to_port="value"> </cnx>
50
+ <cnx from_node="1" from_port="value" to_node="6" to_port="value2"> </cnx>
51
+ <cnx from_node="4" from_port="result" to_node="5" to_port="second"> </cnx>
52
+ <cnx from_node="5" from_port="result" to_node="6" to_port="value1"> </cnx>
53
+ <cnx from_node="7" from_port="result" to_node="5" to_port="first"> </cnx>
54
+ <cnx from_node="6" from_port="result" to_node="0" to_port="source"> </cnx>
55
+ </connections>
56
+ <layout>
57
+ <item type="output" name="Value"> </item>
58
+ </layout>
59
+ </definition>
60
+ </xsi_file>