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,443 @@
|
|
|
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
|
+
BASEXML = """<?xml version="1.0" encoding="UTF-8"?>
|
|
19
|
+
<xsi_file type="CompoundNode" name="ShapeCompound" formatversion="1.4" compoundversion="1.0">
|
|
20
|
+
\t<definition>
|
|
21
|
+
\t\t<nodes>
|
|
22
|
+
{0}
|
|
23
|
+
\t\t</nodes>
|
|
24
|
+
\t\t<exposed_ports>
|
|
25
|
+
\t\t\t<port index="0" portname="result" username="Result" basename="Result" portlabel="Result" exposetype="single"></port>
|
|
26
|
+
\t\t\t<port index="1" portname="in" username="In" basename="In" portlable="In" exposetype="single"></port>
|
|
27
|
+
\t\t</exposed_ports>
|
|
28
|
+
\t\t<connections>
|
|
29
|
+
{1}
|
|
30
|
+
\t\t</connections>
|
|
31
|
+
\t\t<layout>
|
|
32
|
+
\t\t\t<item type="input" name="In"></item>
|
|
33
|
+
\t\t\t<item type="output" name="Result"> </item>
|
|
34
|
+
\t\t</layout>
|
|
35
|
+
\t</definition>
|
|
36
|
+
</xsi_file>"""
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
SLIDERBASEXML = """<?xml version="1.0" encoding="UTF-8"?>
|
|
40
|
+
<xsi_file type="CompoundNode" name="SliderArray" formatversion="1.4" compoundversion="1.0">
|
|
41
|
+
\t<definition>
|
|
42
|
+
\t\t<nodes>
|
|
43
|
+
{0}
|
|
44
|
+
\t\t</nodes>
|
|
45
|
+
\t\t<exposed_ports>
|
|
46
|
+
\t\t\t<port index="0" portname="array" username="Array" basename="Array" portlabel="Array" exposetype="single"></port>
|
|
47
|
+
\t\t</exposed_ports>
|
|
48
|
+
\t\t<connections>
|
|
49
|
+
{1}
|
|
50
|
+
\t\t</connections>
|
|
51
|
+
\t\t<layout>
|
|
52
|
+
\t\t\t<item type="output" name="Array"> </item>
|
|
53
|
+
\t\t</layout>
|
|
54
|
+
\t</definition>
|
|
55
|
+
</xsi_file>"""
|
|
56
|
+
|
|
57
|
+
GETDATANODE = """
|
|
58
|
+
\t\t\t<node type="GetDataNode" index="{0}">
|
|
59
|
+
\t\t\t\t<param name="reference" type="31" value="{1}"></param>
|
|
60
|
+
\t\t\t\t<param_ext name="reference" type="31" value="{1}"></param_ext>
|
|
61
|
+
\t\t\t\t<portdef name="source" type="2048" structure="1" group="1" instance="0" port="0"></portdef>
|
|
62
|
+
\t\t\t\t<portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
|
|
63
|
+
\t\t\t\t<datablob category="ui_infos">
|
|
64
|
+
\t\t\t\t\t<prop name="posx">0</prop>
|
|
65
|
+
\t\t\t\t\t<prop name="posy">0</prop>
|
|
66
|
+
\t\t\t\t</datablob>
|
|
67
|
+
\t\t\t</node>
|
|
68
|
+
"""
|
|
69
|
+
MULNODE = """
|
|
70
|
+
\t\t\t<node type="MultiplyByScalarNode" index="{0}">
|
|
71
|
+
\t\t\t\t<portdef name="value" type="16" structure="1" group="0" instance="0" port="0"></portdef>
|
|
72
|
+
\t\t\t\t<portdef name="factor" type="4" structure="1" group="0" instance="0" port="1"></portdef>
|
|
73
|
+
\t\t\t\t<datablob category="ui_infos">
|
|
74
|
+
\t\t\t\t\t<prop name="posx">0</prop>
|
|
75
|
+
\t\t\t\t\t<prop name="posy">0</prop>
|
|
76
|
+
\t\t\t\t</datablob>
|
|
77
|
+
\t\t\t</node>
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
BUILDARRAYNODE = """
|
|
81
|
+
\t\t\t<node type="BuildArrayNode" index="0">
|
|
82
|
+
{0}
|
|
83
|
+
\t\t\t</node>
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
ADDNODE = """
|
|
87
|
+
\t\t\t<node type="AddNode" index="0">
|
|
88
|
+
{0}
|
|
89
|
+
\t\t\t</node>
|
|
90
|
+
"""
|
|
91
|
+
|
|
92
|
+
SELECTINARRAYNODE = """
|
|
93
|
+
\t\t\t<node type="SelectInArrayNode" index="{0}">
|
|
94
|
+
\t\t\t\t<param name="index" type="3" value="{1}"></param>
|
|
95
|
+
\t\t\t\t<param name="array" type="4" value="0.00000"></param>
|
|
96
|
+
\t\t\t\t<portdef name="index" type="2" structure="1" group="0" instance="0" port="0"></portdef>
|
|
97
|
+
\t\t\t\t<portdef name="array" type="4" structure="2" group="0" instance="0" port="0"></portdef>
|
|
98
|
+
\t\t\t\t<datablob category="ui_infos">
|
|
99
|
+
\t\t\t\t\t<prop name="posx">0</prop>
|
|
100
|
+
\t\t\t\t\t<prop name="posy">0</prop>
|
|
101
|
+
\t\t\t\t</datablob>
|
|
102
|
+
\t\t\t</node>
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
PASSTHROUGHNODE = """
|
|
106
|
+
\t\t\t<node type="PassThroughNode" index="{0}">
|
|
107
|
+
\t\t\t\t<param name="in" type="4" value="0.0000"></param>
|
|
108
|
+
\t\t\t\t<portdef name="in" type="4" structure="2" group="0" instance="0" port="0"></portdef>
|
|
109
|
+
\t\t\t\t<datablob category="ui_infos">
|
|
110
|
+
\t\t\t\t\t<prop name="posx">0</prop>
|
|
111
|
+
\t\t\t\t\t<prop name="posy">0</prop>
|
|
112
|
+
\t\t\t\t</datablob>
|
|
113
|
+
\t\t\t</node>
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
ADDPORT = '\t\t\t\t<portdef name="value{0}" type="16" structure="1" group="0" instance="{0}" port="0"></portdef>'
|
|
117
|
+
SCALARPORT = '\t\t\t\t<portdef name="value{0}" type="4" structure="1" group="0" instance="{0}" port="0"></portdef>'
|
|
118
|
+
CONNECTION = (
|
|
119
|
+
'\t\t\t<cnx from_node="{0}" from_port="{1}" to_node="{2}" to_port="{3}"> </cnx>'
|
|
120
|
+
)
|
|
121
|
+
OUTPROPERTY = "self.{0}_outProperty.{1}"
|
|
122
|
+
POSPROPERTY = "self.cls.{0}.{1}.positions"
|
|
123
|
+
INPROPERTY = "self.{0}_inProperty.{1}"
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
LOADER = """<?xml version="1.0" encoding="UTF-8"?>
|
|
127
|
+
<xsi_file type="CompoundNode" name="setDelta" formatversion="1.4" compoundversion="1.0">
|
|
128
|
+
<definition>
|
|
129
|
+
<nodes>
|
|
130
|
+
<node type="SetOneDataNode" index="0">
|
|
131
|
+
<param name="reference" type="31" value="Self.PointPosition"></param>
|
|
132
|
+
<param_ext name="reference" type="31" value="Self.PointPosition"></param_ext>
|
|
133
|
+
<portdef name="source" type="16" structure="1" group="1" instance="0" port="0"></portdef>
|
|
134
|
+
<portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
|
|
135
|
+
</node>
|
|
136
|
+
<node type="GetDataNode" index="1">
|
|
137
|
+
<param name="reference" type="31" value="self.pointposition"></param>
|
|
138
|
+
<param_ext name="reference" type="31" value="self.pointposition"></param_ext>
|
|
139
|
+
<portdef name="source" type="2048" structure="1" group="1" instance="0" port="0"></portdef>
|
|
140
|
+
<portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
|
|
141
|
+
</node>
|
|
142
|
+
<node type="GetDataNode" index="2">
|
|
143
|
+
<param name="reference" type="31" value="this_model.{1}.PointPosition"></param>
|
|
144
|
+
<param_ext name="reference" type="31" value="this_model.{1}.PointPosition"></param_ext>
|
|
145
|
+
<portdef name="source" type="2048" structure="1" group="1" instance="0" port="0"></portdef>
|
|
146
|
+
<portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
|
|
147
|
+
</node>
|
|
148
|
+
<node type="GetDataNode" index="3">
|
|
149
|
+
<param name="reference" type="31" value="this_model.{0}.PointPosition"></param>
|
|
150
|
+
<param_ext name="reference" type="31" value="this_model.{0}PointPosition"></param_ext>
|
|
151
|
+
<portdef name="source" type="2048" structure="1" group="1" instance="0" port="0"></portdef>
|
|
152
|
+
<portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
|
|
153
|
+
</node>
|
|
154
|
+
<node type="SwitchContextNode" index="4">
|
|
155
|
+
<portdef name="value" type="16" structure="1" group="0" instance="0" port="0"></portdef>
|
|
156
|
+
</node>
|
|
157
|
+
<node type="SubtractNode" index="5">
|
|
158
|
+
<portdef name="first" type="16" structure="1" group="0" instance="0" port="0"></portdef>
|
|
159
|
+
<portdef name="second" type="16" structure="1" group="0" instance="0" port="1"></portdef>
|
|
160
|
+
</node>
|
|
161
|
+
<node type="AddNode" index="6">
|
|
162
|
+
<portdef name="value1" type="16" structure="1" group="0" instance="0" port="0"></portdef>
|
|
163
|
+
<portdef name="value2" type="16" structure="1" group="0" instance="1" port="0"></portdef>
|
|
164
|
+
</node>
|
|
165
|
+
<node type="SwitchContextNode" index="7">
|
|
166
|
+
<portdef name="value" type="16" structure="1" group="0" instance="0" port="0"></portdef>
|
|
167
|
+
</node>
|
|
168
|
+
</nodes>
|
|
169
|
+
<exposed_ports>
|
|
170
|
+
<port index="0" portname="value" username="Value" basename="Value" portlabel="Value" exposetype="single"> </port>
|
|
171
|
+
</exposed_ports>
|
|
172
|
+
<connections>
|
|
173
|
+
<cnx from_node="2" from_port="value" to_node="4" to_port="value"> </cnx>
|
|
174
|
+
<cnx from_node="3" from_port="value" to_node="7" to_port="value"> </cnx>
|
|
175
|
+
<cnx from_node="1" from_port="value" to_node="6" to_port="value2"> </cnx>
|
|
176
|
+
<cnx from_node="4" from_port="result" to_node="5" to_port="second"> </cnx>
|
|
177
|
+
<cnx from_node="5" from_port="result" to_node="6" to_port="value1"> </cnx>
|
|
178
|
+
<cnx from_node="7" from_port="result" to_node="5" to_port="first"> </cnx>
|
|
179
|
+
<cnx from_node="6" from_port="result" to_node="0" to_port="source"> </cnx>
|
|
180
|
+
</connections>
|
|
181
|
+
<layout>
|
|
182
|
+
<item type="output" name="Value"> </item>
|
|
183
|
+
</layout>
|
|
184
|
+
</definition>
|
|
185
|
+
</xsi_file>
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
BASEDEBUGXML = """<?xml version="1.0" encoding="UTF-8"?>
|
|
190
|
+
<xsi_file type="CompoundNode" name="ShapeDebugCompound" formatversion="1.4" compoundversion="1.0">
|
|
191
|
+
\t<definition>
|
|
192
|
+
\t\t<nodes>
|
|
193
|
+
{0}
|
|
194
|
+
\t\t</nodes>
|
|
195
|
+
\t\t<exposed_ports>
|
|
196
|
+
\t\t\t<port index="0" portname="execute" username="Execute" basename="Execute" portlabel="Execute" exposetype="single"> </port>
|
|
197
|
+
\t\t\t<port index="1" portname="in" username="In" basename="In" portlabel="In" exposetype="single"> </port>
|
|
198
|
+
\t\t</exposed_ports>
|
|
199
|
+
\t\t<connections>
|
|
200
|
+
{1}
|
|
201
|
+
\t\t</connections>
|
|
202
|
+
\t\t<layout>
|
|
203
|
+
\t\t\t<item type="input" name="In"> </item>
|
|
204
|
+
\t\t\t<item type="output" name="Execute"> </item>
|
|
205
|
+
\t\t</layout>
|
|
206
|
+
\t</definition>
|
|
207
|
+
</xsi_file>"""
|
|
208
|
+
|
|
209
|
+
EXECUTENODE = """
|
|
210
|
+
\t\t\t<node type="ExecuteNode" index="{0}">
|
|
211
|
+
{1}
|
|
212
|
+
\t\t\t\t<datablob category="ui_infos">
|
|
213
|
+
\t\t\t\t\t<prop name="posx">0</prop>
|
|
214
|
+
\t\t\t\t\t<prop name="posy">0</prop>
|
|
215
|
+
\t\t\t\t</datablob>
|
|
216
|
+
\t\t\t</node>
|
|
217
|
+
"""
|
|
218
|
+
EXECPORT = '\t\t\t\t<portdef name="port{0}" type="4096" structure="1" group="0" instance="{0}" port="0"></portdef>'
|
|
219
|
+
|
|
220
|
+
SETDATANODE = """
|
|
221
|
+
\t\t\t<node type="SetOneDataNode" index="{0}">
|
|
222
|
+
\t\t\t\t<param name="reference" type="31" value="{1}"></param>
|
|
223
|
+
\t\t\t\t<param_ext name="reference" type="31" value="{1}"></param_ext>
|
|
224
|
+
\t\t\t\t<portdef name="source" type="4" structure="1" group="1" instance="0" port="0"></portdef>
|
|
225
|
+
\t\t\t\t<portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
|
|
226
|
+
\t\t\t\t<datablob category="ui_infos">
|
|
227
|
+
\t\t\t\t\t<prop name="posx">0</prop>
|
|
228
|
+
\t\t\t\t\t<prop name="posy">0</prop>
|
|
229
|
+
\t\t\t\t</datablob>
|
|
230
|
+
\t\t\t</node>
|
|
231
|
+
"""
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def buildIceDebugXML(shapeList, systemName, namePrefix):
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
Parameters
|
|
238
|
+
----------
|
|
239
|
+
shapeList :
|
|
240
|
+
|
|
241
|
+
systemName :
|
|
242
|
+
|
|
243
|
+
namePrefix :
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
Returns
|
|
247
|
+
-------
|
|
248
|
+
|
|
249
|
+
"""
|
|
250
|
+
execNodeIdx = 0
|
|
251
|
+
passIdx = 1
|
|
252
|
+
passNode = PASSTHROUGHNODE.format(passIdx)
|
|
253
|
+
index = 2
|
|
254
|
+
|
|
255
|
+
execPortIdx = 1
|
|
256
|
+
execPorts = []
|
|
257
|
+
nodes = []
|
|
258
|
+
connections = []
|
|
259
|
+
nodes.append(passNode)
|
|
260
|
+
|
|
261
|
+
for i, shape in enumerate(shapeList):
|
|
262
|
+
sliIdx = index
|
|
263
|
+
setIdx = index + 1
|
|
264
|
+
index += 2
|
|
265
|
+
|
|
266
|
+
outPropName = OUTPROPERTY.format(systemName, namePrefix + shape)
|
|
267
|
+
sliNode = SELECTINARRAYNODE.format(sliIdx, i)
|
|
268
|
+
setNode = SETDATANODE.format(setIdx, outPropName)
|
|
269
|
+
|
|
270
|
+
nodes.append(sliNode)
|
|
271
|
+
nodes.append(setNode)
|
|
272
|
+
|
|
273
|
+
setCnx = CONNECTION.format(sliIdx, "value", setIdx, "source")
|
|
274
|
+
execCnx = CONNECTION.format(
|
|
275
|
+
setIdx, "value", execNodeIdx, "port" + str(execPortIdx)
|
|
276
|
+
)
|
|
277
|
+
passCnx = CONNECTION.format(passIdx, "out", sliIdx, "array")
|
|
278
|
+
|
|
279
|
+
connections.append(setCnx)
|
|
280
|
+
connections.append(execCnx)
|
|
281
|
+
connections.append(passCnx)
|
|
282
|
+
|
|
283
|
+
execPort = EXECPORT.format(execPortIdx)
|
|
284
|
+
execPorts.append(execPort)
|
|
285
|
+
execPortIdx += 1
|
|
286
|
+
|
|
287
|
+
allExecPorts = "\n".join(execPorts)
|
|
288
|
+
execNode = EXECUTENODE.format(execNodeIdx, allExecPorts)
|
|
289
|
+
nodes.insert(execNodeIdx, execNode)
|
|
290
|
+
allNodes = "\n".join(nodes)
|
|
291
|
+
allConnections = "\n".join(connections)
|
|
292
|
+
output = BASEDEBUGXML.format(allNodes, allConnections)
|
|
293
|
+
return output
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
def buildIceXML(shapeList, systemName, clusterName, namePrefix):
|
|
297
|
+
"""
|
|
298
|
+
|
|
299
|
+
Parameters
|
|
300
|
+
----------
|
|
301
|
+
shapeList :
|
|
302
|
+
|
|
303
|
+
systemName :
|
|
304
|
+
|
|
305
|
+
clusterName :
|
|
306
|
+
|
|
307
|
+
namePrefix :
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
Returns
|
|
311
|
+
-------
|
|
312
|
+
|
|
313
|
+
"""
|
|
314
|
+
index = 1
|
|
315
|
+
addIdx = 1
|
|
316
|
+
|
|
317
|
+
addPorts = []
|
|
318
|
+
nodes = []
|
|
319
|
+
connections = []
|
|
320
|
+
|
|
321
|
+
passNode = PASSTHROUGHNODE.format(index)
|
|
322
|
+
nodes.append(passNode)
|
|
323
|
+
|
|
324
|
+
index += 1
|
|
325
|
+
|
|
326
|
+
selfPos = GETDATANODE.format(index, "Self.PointPosition")
|
|
327
|
+
selfCnx = CONNECTION.format(index, "value", 0, "value" + str(addIdx))
|
|
328
|
+
addPort = ADDPORT.format(addIdx, addIdx - 1)
|
|
329
|
+
|
|
330
|
+
nodes.append(selfPos)
|
|
331
|
+
connections.append(selfCnx)
|
|
332
|
+
addPorts.append(addPort)
|
|
333
|
+
|
|
334
|
+
addIdx += 1
|
|
335
|
+
index += 1
|
|
336
|
+
|
|
337
|
+
for i, shape in enumerate(shapeList):
|
|
338
|
+
sliIdx = index
|
|
339
|
+
posIdx = index + 1
|
|
340
|
+
mulIdx = index + 2
|
|
341
|
+
index += 3
|
|
342
|
+
|
|
343
|
+
posPropName = POSPROPERTY.format(clusterName, namePrefix + shape)
|
|
344
|
+
|
|
345
|
+
sliNode = SELECTINARRAYNODE.format(sliIdx, i)
|
|
346
|
+
posNode = GETDATANODE.format(posIdx, posPropName)
|
|
347
|
+
mulNode = MULNODE.format(mulIdx)
|
|
348
|
+
|
|
349
|
+
nodes.append(sliNode)
|
|
350
|
+
nodes.append(posNode)
|
|
351
|
+
nodes.append(mulNode)
|
|
352
|
+
|
|
353
|
+
sliCnx = CONNECTION.format(sliIdx, "value", mulIdx, "factor")
|
|
354
|
+
connections.append(sliCnx)
|
|
355
|
+
|
|
356
|
+
posCnx = CONNECTION.format(posIdx, "value", mulIdx, "value")
|
|
357
|
+
connections.append(posCnx)
|
|
358
|
+
|
|
359
|
+
passCnx = CONNECTION.format(1, "out", sliIdx, "array")
|
|
360
|
+
connections.append(passCnx)
|
|
361
|
+
|
|
362
|
+
if i != 0:
|
|
363
|
+
# Don't connect the rest shape
|
|
364
|
+
addCnx = CONNECTION.format(mulIdx, "result", 0, "value" + str(addIdx))
|
|
365
|
+
connections.append(addCnx)
|
|
366
|
+
addPort = ADDPORT.format(addIdx, addIdx - 1)
|
|
367
|
+
addPorts.append(addPort)
|
|
368
|
+
addIdx += 1
|
|
369
|
+
|
|
370
|
+
allPorts = "\n".join(addPorts)
|
|
371
|
+
addNode = ADDNODE.format(allPorts)
|
|
372
|
+
allNodes = "\n".join(nodes)
|
|
373
|
+
allNodes = addNode + "\n" + allNodes
|
|
374
|
+
allConnections = "\n".join(connections)
|
|
375
|
+
output = BASEXML.format(allNodes, allConnections)
|
|
376
|
+
|
|
377
|
+
return output
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
def buildSliderIceXML(sliderList, systemName):
|
|
381
|
+
"""
|
|
382
|
+
|
|
383
|
+
Parameters
|
|
384
|
+
----------
|
|
385
|
+
sliderList :
|
|
386
|
+
|
|
387
|
+
systemName :
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
Returns
|
|
391
|
+
-------
|
|
392
|
+
|
|
393
|
+
"""
|
|
394
|
+
index = 1
|
|
395
|
+
addIdx = 1
|
|
396
|
+
|
|
397
|
+
sliderPorts = []
|
|
398
|
+
nodes = []
|
|
399
|
+
connections = []
|
|
400
|
+
|
|
401
|
+
for slider in sliderList:
|
|
402
|
+
inIdx = index
|
|
403
|
+
|
|
404
|
+
inPropName = INPROPERTY.format(systemName, slider)
|
|
405
|
+
|
|
406
|
+
inNode = GETDATANODE.format(inIdx, inPropName)
|
|
407
|
+
|
|
408
|
+
nodes.append(inNode)
|
|
409
|
+
|
|
410
|
+
sliderCnx = CONNECTION.format(inIdx, "value", 0, "value" + str(addIdx))
|
|
411
|
+
connections.append(sliderCnx)
|
|
412
|
+
|
|
413
|
+
sliderPort = SCALARPORT.format(addIdx, addIdx - 1)
|
|
414
|
+
sliderPorts.append(sliderPort)
|
|
415
|
+
|
|
416
|
+
index += 1
|
|
417
|
+
addIdx += 1
|
|
418
|
+
|
|
419
|
+
allPorts = "\n".join(sliderPorts)
|
|
420
|
+
arrayNode = BUILDARRAYNODE.format(allPorts)
|
|
421
|
+
allNodes = "\n".join(nodes)
|
|
422
|
+
allNodes = arrayNode + "\n" + allNodes
|
|
423
|
+
allConnections = "\n".join(connections)
|
|
424
|
+
output = SLIDERBASEXML.format(allNodes, allConnections)
|
|
425
|
+
|
|
426
|
+
return output
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
def buildLoaderXML(loader, rester):
|
|
430
|
+
"""
|
|
431
|
+
|
|
432
|
+
Parameters
|
|
433
|
+
----------
|
|
434
|
+
loader :
|
|
435
|
+
|
|
436
|
+
rester :
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
Returns
|
|
440
|
+
-------
|
|
441
|
+
|
|
442
|
+
"""
|
|
443
|
+
return LOADER.format(loader.name, rester.name)
|