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.
Files changed (84) hide show
  1. simplex_solver-3.2.2.dist-info/DELVEWHEEL +2 -0
  2. simplex_solver-3.2.2.dist-info/METADATA +94 -0
  3. simplex_solver-3.2.2.dist-info/RECORD +84 -0
  4. simplex_solver-3.2.2.dist-info/WHEEL +5 -0
  5. simplex_solver.libs/.load-order-simplex_solver-3.2.2 +1 -0
  6. simplex_solver.libs/msvcp140-a4c2229bdc2a2a630acdc095b4d86008.dll +0 -0
  7. simplexui/__init__.py +86 -0
  8. simplexui/_version.py +1 -0
  9. simplexui/channelBox.py +867 -0
  10. simplexui/comboCheckDialog.py +396 -0
  11. simplexui/commands/__init__.py +16 -0
  12. simplexui/commands/alembicCommon.py +1148 -0
  13. simplexui/commands/alembic_walker.py +299 -0
  14. simplexui/commands/applyCorrectives.py +452 -0
  15. simplexui/commands/correctiveInterface.py +259 -0
  16. simplexui/commands/expandedExport.py +434 -0
  17. simplexui/commands/hdf5Convert.py +62 -0
  18. simplexui/commands/mayaCorrectiveInterface.py +159 -0
  19. simplexui/commands/mayatonumpy.py +416 -0
  20. simplexui/commands/mesh.py +1085 -0
  21. simplexui/commands/poseblendlib.py +168 -0
  22. simplexui/commands/reorderSimplexPoints.py +102 -0
  23. simplexui/commands/replaceDefinitionJson.py +74 -0
  24. simplexui/commands/rigidAlign.py +97 -0
  25. simplexui/commands/unsubdivide.py +1222 -0
  26. simplexui/commands/uvTransfer.py +976 -0
  27. simplexui/dragFilter.py +334 -0
  28. simplexui/falloffDialog.py +504 -0
  29. simplexui/img/ChefHead.png +0 -0
  30. simplexui/img/frozen.png +0 -0
  31. simplexui/interface/__init__.py +30 -0
  32. simplexui/interface/dummyInterface.py +1313 -0
  33. simplexui/interface/mayaInterface.py +2294 -0
  34. simplexui/interfaceModel.py +655 -0
  35. simplexui/interfaceModelTrees.py +456 -0
  36. simplexui/items/__init__.py +50 -0
  37. simplexui/items/accessor.py +145 -0
  38. simplexui/items/combo.py +645 -0
  39. simplexui/items/dragItem.py +44 -0
  40. simplexui/items/falloff.py +748 -0
  41. simplexui/items/group.py +267 -0
  42. simplexui/items/progression.py +613 -0
  43. simplexui/items/shape.py +384 -0
  44. simplexui/items/simplex.py +1734 -0
  45. simplexui/items/slider.py +632 -0
  46. simplexui/items/stack.py +147 -0
  47. simplexui/items/traversal.py +780 -0
  48. simplexui/items/treeItem.py +441 -0
  49. simplexui/main.pyw +22 -0
  50. simplexui/menu/__init__.py +73 -0
  51. simplexui/menu/dummyPlugins/__init__.py +16 -0
  52. simplexui/menu/genericPlugins/__init__.py +16 -0
  53. simplexui/menu/genericPlugins/_builtins.py +270 -0
  54. simplexui/menu/genericPlugins/checkPossibleCombos.py +48 -0
  55. simplexui/menu/genericPlugins/exportSplit.py +67 -0
  56. simplexui/menu/genericPlugins/showFalloffs.py +26 -0
  57. simplexui/menu/genericPlugins/showTraversals.py +26 -0
  58. simplexui/menu/genericPlugins/simplexUvTransfer.py +106 -0
  59. simplexui/menu/genericPlugins/unsubdivide.py +72 -0
  60. simplexui/menu/mayaPlugins/__init__.py +16 -0
  61. simplexui/menu/mayaPlugins/exportOther.py +53 -0
  62. simplexui/menu/mayaPlugins/extractProgressives.py +68 -0
  63. simplexui/menu/mayaPlugins/freezeCombo.py +247 -0
  64. simplexui/menu/mayaPlugins/generateShapeIncrementals.py +99 -0
  65. simplexui/menu/mayaPlugins/importObjs.py +199 -0
  66. simplexui/menu/mayaPlugins/linearizeTraversal.py +60 -0
  67. simplexui/menu/mayaPlugins/makeShelfBtn.py +67 -0
  68. simplexui/menu/mayaPlugins/relaxToSelection.py +76 -0
  69. simplexui/menu/mayaPlugins/reloadDefinition.py +44 -0
  70. simplexui/menu/mayaPlugins/snapToNeutral.py +71 -0
  71. simplexui/menu/mayaPlugins/softSelectToCluster.py +201 -0
  72. simplexui/menu/mayaPlugins/tweakMix.py +136 -0
  73. simplexui/menu/mayaPlugins/updateRestShape.py +113 -0
  74. simplexui/pysimplex.lib +0 -0
  75. simplexui/pysimplex.pyd +0 -0
  76. simplexui/simplexDialog.py +1547 -0
  77. simplexui/travCheckDialog.py +419 -0
  78. simplexui/traversalDialog.py +299 -0
  79. simplexui/ui/comboCheckDialog.ui +475 -0
  80. simplexui/ui/falloffDialog.ui +243 -0
  81. simplexui/ui/simplexDialog.ui +1458 -0
  82. simplexui/ui/travCheckDialog.ui +488 -0
  83. simplexui/ui/traversalDialog.ui +532 -0
  84. simplexui/utils.py +307 -0
@@ -0,0 +1,147 @@
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
+ from __future__ import annotations
18
+
19
+ import copy
20
+ from collections import OrderedDict
21
+ from contextlib import contextmanager
22
+ from functools import wraps
23
+ from typing import TYPE_CHECKING, Any
24
+
25
+ from ..interface import undoContext
26
+
27
+ if TYPE_CHECKING:
28
+ from .simplex import Simplex
29
+
30
+
31
+ # UNDO STACK SETUP
32
+ class Stack:
33
+ """Integrate simplex into the DCC undo stack"""
34
+
35
+ def __init__(self) -> None:
36
+ # Technically not needed, but I depend on the ordering behavior
37
+ self._stack: OrderedDict[int, Any] = OrderedDict()
38
+ self.depth: int = 0
39
+ self.currentRevision: int = 0
40
+ self.enabled: bool = True
41
+
42
+ def push(self, key: int, value: Any) -> None:
43
+ """Push the memento value onto the stack for the given revision key"""
44
+ gt = []
45
+ # when setting a new key, remove all keys from
46
+ # the previous branch
47
+ for k in reversed(self._stack):
48
+ if k > key:
49
+ gt.append(k)
50
+ else:
51
+ # yay ordered dict
52
+ break
53
+ for k in gt:
54
+ del self._stack[k]
55
+ self._stack[key] = value
56
+
57
+ def getRevision(self, revision: int) -> Simplex | None:
58
+ """Every time a change is made to the simplex definition,
59
+ the revision counter is updated, and the revision/definition
60
+ pair is put on the undo stack
61
+
62
+ Parameters
63
+ ----------
64
+ revision : int
65
+ The revision number to get
66
+
67
+ Returns
68
+ -------
69
+ : Simplex or None
70
+ The stored Simplex system for the given revision
71
+ or None if nothing found
72
+ """
73
+ # This method will ***ONLY*** be called by the undo callback
74
+ # Seriously, don't call this yourself
75
+ if revision != self.currentRevision:
76
+ if revision in self._stack:
77
+ data = self._stack[revision]
78
+ self.currentRevision = revision
79
+ return data
80
+ return None
81
+
82
+ def purge(self) -> None:
83
+ """Clear the undo stack. This should be done on new-file"""
84
+ self._stack = OrderedDict()
85
+ self.depth = 0
86
+ self.currentRevision = 0
87
+
88
+ @contextmanager
89
+ def store(self, wrapObj: Any):
90
+ """A context manager That will store changes to a Simplex system
91
+ Nested calls to this manager will only store the first one
92
+
93
+ Parameters
94
+ ----------
95
+ wrapObj : object
96
+ A system object that has a reference to the Simplex
97
+ """
98
+ if self.enabled:
99
+ with undoContext(wrapObj.DCC):
100
+ self.depth += 1
101
+ try:
102
+ yield
103
+ finally:
104
+ self.depth -= 1
105
+
106
+ if self.depth == 0:
107
+ # Only store the top Level of the stack
108
+ srevision = wrapObj.DCC.incrementRevision()
109
+
110
+ """
111
+ print("COPYING", wrapObj.simplex)
112
+ for k in dir(wrapObj.simplex):
113
+ print(k, type(getattr(wrapObj.simplex, k)))
114
+ print("------------DONE")
115
+ """
116
+ memo = {}
117
+ try:
118
+ self.push(srevision, copy.deepcopy(wrapObj.simplex, memo=memo))
119
+ except Exception:
120
+ print("MEMO!", memo)
121
+ raise
122
+ else:
123
+ yield
124
+
125
+
126
+ class Memo(dict):
127
+ def __setitem__(self, key, value) -> None:
128
+ print("SETTING", key, value)
129
+ super().__setitem__(key, value)
130
+
131
+
132
+ def stackable(method):
133
+ """A Decorator to make a method auto update the stack
134
+ This decorator can only be used on methods of an object
135
+ that has its .simplex value set with a stack. If you need
136
+ to wrap an init method, use the stack.store contextmanager
137
+ """
138
+
139
+ @wraps(method)
140
+ def stacked(self, *data, **kwdata):
141
+ """Decorator closure that handles the stack"""
142
+ ret = None
143
+ with self.stack.store(self):
144
+ ret = method(self, *data, **kwdata)
145
+ return ret
146
+
147
+ return stacked