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
simplexui/items/stack.py
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
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
|
+
# pylint:disable=missing-docstring,unused-argument,no-self-use
|
|
19
|
+
import copy
|
|
20
|
+
from collections import OrderedDict
|
|
21
|
+
from contextlib import contextmanager
|
|
22
|
+
from functools import wraps
|
|
23
|
+
|
|
24
|
+
from ..interface import undoContext
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# UNDO STACK SETUP
|
|
28
|
+
class Stack(object):
|
|
29
|
+
"""Integrate simplex into the DCC undo stack"""
|
|
30
|
+
|
|
31
|
+
def __init__(self):
|
|
32
|
+
self._stack = OrderedDict()
|
|
33
|
+
self.depth = 0
|
|
34
|
+
self.currentRevision = 0
|
|
35
|
+
self.enabled = True
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key, value):
|
|
38
|
+
gt = []
|
|
39
|
+
# when setting a new key, remove all keys from
|
|
40
|
+
# the previous branch
|
|
41
|
+
for k in reversed(self._stack): # pylint: disable=bad-reversed-sequence
|
|
42
|
+
if k > key:
|
|
43
|
+
gt.append(k)
|
|
44
|
+
else:
|
|
45
|
+
# yay ordered dict
|
|
46
|
+
break
|
|
47
|
+
for k in gt:
|
|
48
|
+
del self._stack[k]
|
|
49
|
+
# traceback.print_stack()
|
|
50
|
+
self._stack[key] = value
|
|
51
|
+
|
|
52
|
+
def getRevision(self, revision):
|
|
53
|
+
"""Every time a change is made to the simplex definition,
|
|
54
|
+
the revision counter is updated, and the revision/definition
|
|
55
|
+
pair is put on the undo stack
|
|
56
|
+
|
|
57
|
+
Parameters
|
|
58
|
+
----------
|
|
59
|
+
revision : int
|
|
60
|
+
The revision number to get
|
|
61
|
+
|
|
62
|
+
Returns
|
|
63
|
+
-------
|
|
64
|
+
: Simplex or None
|
|
65
|
+
The stored Simplex system for the given revision
|
|
66
|
+
or None if nothing found
|
|
67
|
+
|
|
68
|
+
"""
|
|
69
|
+
# This method will ***ONLY*** be called by the undo callback
|
|
70
|
+
# Seriously, don't call this yourself
|
|
71
|
+
if revision != self.currentRevision:
|
|
72
|
+
if revision in self._stack:
|
|
73
|
+
data = self._stack[revision]
|
|
74
|
+
self.currentRevision = revision
|
|
75
|
+
return data
|
|
76
|
+
return None
|
|
77
|
+
|
|
78
|
+
def purge(self):
|
|
79
|
+
"""Clear the undo stack. This should be done on new-file"""
|
|
80
|
+
self._stack = OrderedDict()
|
|
81
|
+
self.depth = 0
|
|
82
|
+
self.currentRevision = 0
|
|
83
|
+
|
|
84
|
+
@contextmanager
|
|
85
|
+
def store(self, wrapObj):
|
|
86
|
+
"""A context manager That will store changes to a Simplex system
|
|
87
|
+
Nested calls to this manager will only store the first one
|
|
88
|
+
|
|
89
|
+
Parameters
|
|
90
|
+
----------
|
|
91
|
+
wrapObj : object
|
|
92
|
+
A system object that has a reference to the Simplex
|
|
93
|
+
|
|
94
|
+
Returns
|
|
95
|
+
-------
|
|
96
|
+
|
|
97
|
+
"""
|
|
98
|
+
from .simplex import Simplex
|
|
99
|
+
|
|
100
|
+
if self.enabled:
|
|
101
|
+
with undoContext(wrapObj.DCC):
|
|
102
|
+
self.depth += 1
|
|
103
|
+
try:
|
|
104
|
+
yield
|
|
105
|
+
finally:
|
|
106
|
+
self.depth -= 1
|
|
107
|
+
|
|
108
|
+
if self.depth == 0:
|
|
109
|
+
# Only store the top Level of the stack
|
|
110
|
+
srevision = wrapObj.DCC.incrementRevision()
|
|
111
|
+
if not isinstance(wrapObj, Simplex):
|
|
112
|
+
wrapObj = wrapObj.simplex
|
|
113
|
+
self[srevision] = copy.deepcopy(wrapObj)
|
|
114
|
+
else:
|
|
115
|
+
yield
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def stackable(method):
|
|
119
|
+
"""A Decorator to make a method auto update the stack
|
|
120
|
+
This decorator can only be used on methods of an object
|
|
121
|
+
that has its .simplex value set with a stack. If you need
|
|
122
|
+
to wrap an init method, use the stack.store contextmanager
|
|
123
|
+
|
|
124
|
+
Parameters
|
|
125
|
+
----------
|
|
126
|
+
method :
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
Returns
|
|
130
|
+
-------
|
|
131
|
+
|
|
132
|
+
"""
|
|
133
|
+
|
|
134
|
+
@wraps(method)
|
|
135
|
+
def stacked(self, *data, **kwdata):
|
|
136
|
+
"""Decorator closure that handles the stack
|
|
137
|
+
|
|
138
|
+
Parameters
|
|
139
|
+
----------
|
|
140
|
+
*data :
|
|
141
|
+
|
|
142
|
+
**kwdata :
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
Returns
|
|
146
|
+
-------
|
|
147
|
+
|
|
148
|
+
"""
|
|
149
|
+
ret = None
|
|
150
|
+
with self.stack.store(self):
|
|
151
|
+
ret = method(self, *data, **kwdata)
|
|
152
|
+
return ret
|
|
153
|
+
|
|
154
|
+
return stacked
|