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,741 @@
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
+ from __future__ import absolute_import
20
+
21
+ import itertools
22
+
23
+ from ..interface import undoContext
24
+ from Qt.QtGui import QColor
25
+ from ..utils import caseSplit, getNextName, makeUnique, nested, singleShot
26
+ from .accessor import SimplexAccessor
27
+ from .group import Group
28
+ from .progression import ProgPair, Progression
29
+ from .shape import Shape
30
+ from .stack import stackable
31
+
32
+
33
+ class Slider(SimplexAccessor):
34
+ """A user-input to the simplex system that directly controls a Progression
35
+
36
+ Parameters
37
+ ----------
38
+ name : str
39
+ The name of this Slider
40
+ simplex : Simplex
41
+ The parent Simplex system
42
+ prog : Progression
43
+ The Progression that this Slider controls
44
+ group : Group
45
+ The Group to create this Slider in
46
+ color : QColor
47
+ The color of this item in the UI
48
+ create : bool
49
+ Whether to create a DCC Shape, or look for it already in-scene
50
+
51
+ Returns
52
+ -------
53
+
54
+ """
55
+
56
+ classDepth = 7
57
+
58
+ def __init__(
59
+ self, name, simplex, prog, group, color=QColor(128, 128, 128), create=True
60
+ ):
61
+ if group.groupType != type(self):
62
+ raise ValueError("Cannot add this slider to a combo group")
63
+
64
+ super(Slider, self).__init__(simplex)
65
+ with self.stack.store(self):
66
+ self._name = name
67
+ self._thing = None
68
+ self._thingRepr = None
69
+ self.prog = prog
70
+ self.split = False
71
+ self.prog.controller = self
72
+ self._buildIdx = None
73
+ self._value = 0.0
74
+ self.expanded = {}
75
+ self.color = color
76
+ self._enabled = True
77
+
78
+ mn, mx = self.prog.getRange()
79
+ self.minValue = mn
80
+ self.maxValue = mx
81
+
82
+ mgrs = [model.insertItemManager(group) for model in self.models]
83
+ with nested(*mgrs):
84
+ self.group = group
85
+ self.group.items.append(self)
86
+
87
+ self.simplex.sliders.append(self)
88
+
89
+ newThing = self.DCC.getSliderThing(self._name)
90
+ if newThing is None:
91
+ if create:
92
+ self.thing = simplex.DCC.createSlider(self)
93
+ else:
94
+ raise RuntimeError(
95
+ "Unable to find existing shape: {0}".format(self.name)
96
+ )
97
+ else:
98
+ self.thing = newThing
99
+
100
+ @property
101
+ def enabled(self):
102
+ """Get whether this Slider is evaluated in the solver"""
103
+ return self._enabled
104
+
105
+ @enabled.setter
106
+ @stackable
107
+ def enabled(self, value):
108
+ """Get whether this Slider is evaluated in the solver
109
+
110
+ Parameters
111
+ ----------
112
+ value :
113
+
114
+
115
+ Returns
116
+ -------
117
+
118
+ """
119
+ self._enabled = value
120
+ for model in self.models:
121
+ model.itemDataChanged(self)
122
+
123
+ @classmethod
124
+ def createSlider(cls, name, simplex, group=None, shape=None, tVal=1.0):
125
+ """Create a new slider with a name in a group.
126
+ Possibly create a single default shape for this slider
127
+
128
+ Parameters
129
+ ----------
130
+ name : str
131
+ The name of this Slider
132
+ simplex : Simplex
133
+ The parent Simplex system
134
+ group : Group or None
135
+ The group to add the Slider to.
136
+ If None, create a default group. Defaults to None
137
+ shape : Shape or None
138
+ What shape to add to the new Slider's Progression at the given tVal
139
+ if None, create a default shape. Defaults to None
140
+ tVal : float
141
+ The value for the new shape in the Slider's Progression. Defaults to 1.0
142
+
143
+ Returns
144
+ -------
145
+ Slider
146
+ The newly created Slider
147
+
148
+ """
149
+ if simplex.restShape is None:
150
+ raise RuntimeError("Simplex system is missing rest shape")
151
+
152
+ if group is None:
153
+ if simplex.sliderGroups:
154
+ group = simplex.sliderGroups[0]
155
+ else:
156
+ group = Group("{0}_GROUP".format(name), simplex, Slider)
157
+
158
+ currentNames = [s.name for s in simplex.sliders]
159
+ name = getNextName(name, currentNames)
160
+
161
+ prog = Progression(name, simplex)
162
+ if shape is None:
163
+ prog.createShape(name, tVal)
164
+ else:
165
+ prog.pairs.append(ProgPair(simplex, shape, tVal))
166
+
167
+ sli = cls(name, simplex, prog, group)
168
+ return sli
169
+
170
+ @classmethod
171
+ def createMultiSlider(cls, name, simplex, shapes, tVals, group=None):
172
+ """Create a new slider with a name (possibly in a custom group) with the
173
+ provided shapes and t-values.
174
+
175
+ Parameters
176
+ ----------
177
+ name : str
178
+ The name of this Slider
179
+ simplex : Simplex
180
+ The parent Simplex system
181
+ shape : list of Shape
182
+ What shape s to add to the new Slider's Progression at the given tVals
183
+ tVal : list of float
184
+ The values for the new shapes in the Slider's Progression
185
+ group : Group or None
186
+ The group to add the Slider to.
187
+ If None, create a default group. Defaults to None
188
+ Returns
189
+ -------
190
+ Slider
191
+ The newly created Slider
192
+
193
+ """
194
+ if simplex.restShape is None:
195
+ raise RuntimeError("Simplex system is missing rest shape")
196
+
197
+ if group is None:
198
+ if simplex.sliderGroups:
199
+ group = simplex.sliderGroups[0]
200
+ else:
201
+ group = Group("{0}_GROUP".format(name), simplex, Slider)
202
+
203
+ currentNames = [s.name for s in simplex.sliders]
204
+ name = getNextName(name, currentNames)
205
+
206
+ prog = Progression(name, simplex)
207
+ for shape, tVal in zip(shapes, tVals):
208
+ prog.pairs.append(ProgPair(simplex, shape, tVal))
209
+
210
+ sli = cls(name, simplex, prog, group)
211
+ return sli
212
+
213
+ @property
214
+ def name(self):
215
+ """Get the name of a Slider"""
216
+ return self._name
217
+
218
+ @name.setter
219
+ @stackable
220
+ def name(self, value):
221
+ """Set the name of a Slider
222
+
223
+ Parameters
224
+ ----------
225
+ value :
226
+
227
+
228
+ Returns
229
+ -------
230
+
231
+ """
232
+ self._name = value
233
+ self.prog.name = value
234
+ self.DCC.renameSlider(self, value)
235
+ # TODO Also rename the combos
236
+ for model in self.models:
237
+ model.itemDataChanged(self)
238
+
239
+ def treeChild(self, row):
240
+ """
241
+
242
+ Parameters
243
+ ----------
244
+ row :
245
+
246
+
247
+ Returns
248
+ -------
249
+
250
+ """
251
+ return self.prog.pairs[row]
252
+
253
+ def treeRow(self):
254
+ """ """
255
+ return self.group.items.index(self)
256
+
257
+ def treeParent(self):
258
+ """ """
259
+ return self.group
260
+
261
+ def treeChildCount(self):
262
+ """ """
263
+ return len(self.prog.pairs)
264
+
265
+ def treeData(self, column):
266
+ """
267
+
268
+ Parameters
269
+ ----------
270
+ column :
271
+
272
+
273
+ Returns
274
+ -------
275
+
276
+ """
277
+ if column == 0:
278
+ return self.name
279
+ if column == 1:
280
+ return self.value
281
+ return None
282
+
283
+ def treeChecked(self):
284
+ """ """
285
+ return self.enabled
286
+
287
+ def nameLinks(self):
288
+ """
289
+
290
+ Parameters
291
+ ----------
292
+
293
+ Returns
294
+ -------
295
+ : type
296
+ Name Linking is currenly in-development
297
+
298
+ """
299
+ # split by underscore
300
+ sp = self._name.split("_")
301
+ sliderPoss = []
302
+ for orig in sp:
303
+ s = caseSplit(orig)
304
+ if len(s) > 1:
305
+ s = orig + s
306
+ sliderPoss.append(s)
307
+
308
+ # remove numbered chunks from the end
309
+ shapeNames = []
310
+ shapes = [p.shape for p in self.prog.pairs]
311
+ for s in shapes:
312
+ x = s.name.rsplit("_", 1)
313
+ if len(x) == 2:
314
+ base, sfx = x
315
+ if sfx[0].lower() == "n":
316
+ sfx = sfx[1:]
317
+ x = base if sfx.isdigit() else s.name
318
+ shapeNames.append(x)
319
+
320
+ out = [False] * len(shapeNames)
321
+ for poss in itertools.product(*sliderPoss):
322
+ check = "".join(poss)
323
+ for i, s in enumerate(shapeNames):
324
+ if check == s:
325
+ out[i] = True
326
+ if all(out):
327
+ break
328
+ return out
329
+
330
+ @classmethod
331
+ def buildSliderName(cls, pairs):
332
+ """Figure out then name for a slider with given shapes
333
+
334
+ This will mostly be used to figure out what the new name
335
+ for a slider will be if its shapes are renamed
336
+
337
+ Parameters
338
+ ----------
339
+ pairs : [(str
340
+ A list of (name, value) pairs
341
+
342
+ Returns
343
+ -------
344
+ : str
345
+ A newly created name
346
+
347
+ """
348
+ # In this case, pairs is *not* a list of ProgPairs
349
+ # but a list of (name, value) tuples
350
+
351
+ # First, I'm just going to ignore anything with values that aren't 1.0
352
+ # This simplifies the logic greatly
353
+ extPairs = [p for p in pairs if abs(p[1]) == 1.0]
354
+ if len(extPairs) == 1:
355
+ return extPairs[0]
356
+ if extPairs[0] == 1:
357
+ extPairs = extPairs.reversed()
358
+
359
+ names = []
360
+ for ep in extPairs:
361
+ sp = ep[0].split("_")
362
+ if Shape.isNumberField(sp[-1]):
363
+ sp = sp[:-1]
364
+ names.append(sp)
365
+
366
+ return "_".join(["".join(makeUnique(n)) for n in names])
367
+
368
+ @property
369
+ def thing(self):
370
+ """Get the stored reference to the DCC attribute"""
371
+ # if this is a deepcopied object, then self._thing will
372
+ # be None. Rebuild the thing connection by its representation
373
+ if self._thing is None and self._thingRepr:
374
+ self._thing = self.DCC.loadPersistentSlider(self._thingRepr)
375
+ return self._thing
376
+
377
+ @thing.setter
378
+ def thing(self, value):
379
+ """Set the stored reference to the DCC attribute
380
+
381
+ Parameters
382
+ ----------
383
+ value :
384
+
385
+
386
+ Returns
387
+ -------
388
+
389
+ """
390
+ self._thing = value
391
+ self._thingRepr = self.DCC.getPersistentSlider(value)
392
+
393
+ @property
394
+ def value(self):
395
+ """Get the current value for this Slider"""
396
+ return self._value
397
+
398
+ @value.setter
399
+ def value(self, val):
400
+ """Set the current value for this Slider
401
+
402
+ Parameters
403
+ ----------
404
+ val :
405
+
406
+
407
+ Returns
408
+ -------
409
+
410
+ """
411
+ self._value = val
412
+ for model in self.models:
413
+ model.itemDataChanged(self)
414
+ self._setAllSliders(self)
415
+
416
+ @singleShot()
417
+ def _setAllSliders(self, sliders):
418
+ """
419
+
420
+ Parameters
421
+ ----------
422
+ sliders :
423
+
424
+
425
+ Returns
426
+ -------
427
+
428
+ """
429
+ with undoContext(self.DCC):
430
+ for slider in sliders:
431
+ self.DCC.setSliderWeight(slider, slider.value)
432
+
433
+ def updateValue(self):
434
+ """ """
435
+ pass
436
+
437
+ @classmethod
438
+ def loadV2(cls, simplex, progs, data, create):
439
+ """Load the data from a version2 formatted json dictionary
440
+
441
+ Parameters
442
+ ----------
443
+ simplex : Simplex
444
+ The Simplex system that's being built
445
+ progs : [Progression
446
+ The progressions that have already been built
447
+ data : dict
448
+ The chunk of the json dict used to build this object
449
+ create : bool
450
+ Whether to create the DCC Shape, or look for it already in-scene
451
+
452
+ Returns
453
+ -------
454
+ : Slider
455
+ The specified Slider
456
+
457
+ """
458
+ name = data["name"]
459
+ prog = progs[data["prog"]]
460
+ group = simplex.groups[data.get("group", 0)]
461
+ color = QColor(*data.get("color", (128, 128, 128)))
462
+ return cls(name, simplex, prog, group, create=create, color=color)
463
+
464
+ def buildDefinition(self, simpDict, legacy):
465
+ """Output a dictionary definition of this object
466
+
467
+ Parameters
468
+ ----------
469
+ simpDict : dict
470
+ The dictionary that is being built
471
+ legacy : bool
472
+ Whether to write out the legacy definition, or the newer one
473
+
474
+ Returns
475
+ -------
476
+
477
+ """
478
+ if self._buildIdx is None:
479
+ self._buildIdx = len(simpDict["sliders"])
480
+ if legacy:
481
+ gIdx = self.group.buildDefinition(simpDict, legacy)
482
+ pIdx = self.prog.buildDefinition(simpDict, legacy)
483
+ simpDict.setdefault("sliders", []).append([self.name, pIdx, gIdx])
484
+ else:
485
+ x = {
486
+ "name": self.name,
487
+ "prog": self.prog.buildDefinition(simpDict, legacy),
488
+ "group": self.group.buildDefinition(simpDict, legacy),
489
+ "color": self.color.getRgb()[:3],
490
+ "enabled": self._enabled,
491
+ }
492
+ simpDict.setdefault("sliders", []).append(x)
493
+ return self._buildIdx
494
+
495
+ def clearBuildIndex(self):
496
+ """Clear the build index of this object
497
+
498
+ The buildIndex is stored when building a definition dictionary
499
+ that keeps track of its index for later referencing
500
+
501
+ Parameters
502
+ ----------
503
+
504
+ Returns
505
+ -------
506
+
507
+ """
508
+ self._buildIdx = None
509
+ self.prog.clearBuildIndex()
510
+ self.group.clearBuildIndex()
511
+
512
+ def setRange(self):
513
+ """Set the range of this Slider based on the progPair values"""
514
+ values = [i.value for i in self.prog.pairs]
515
+ self.minValue = min(values)
516
+ self.maxValue = max(values)
517
+ self.DCC.setSliderRange(self)
518
+
519
+ @stackable
520
+ def delete(self):
521
+ """Delete a slider, any shapes it contains, and all downstream Combos and Traversals"""
522
+ self.simplex.deleteDownstream(self)
523
+ mgrs = [model.removeItemManager(self) for model in self.models]
524
+ with nested(*mgrs):
525
+ g = self.group
526
+ g.items.remove(self)
527
+ self.group = None
528
+ self.simplex.sliders.remove(self)
529
+
530
+ pairs = self.prog.pairs[:] # gotta make a copy
531
+ for pp in pairs:
532
+ if not pp.shape.isRest:
533
+ self.simplex.shapes.remove(pp.shape)
534
+ self.DCC.deleteShape(pp.shape)
535
+
536
+ self.DCC.deleteSlider(self)
537
+
538
+ @stackable
539
+ def setInterpolation(self, interp):
540
+ """Set the interpolation of a single Slider
541
+
542
+ Parameters
543
+ ----------
544
+ interp : str
545
+ The interpolation for this Slider's Progression
546
+
547
+ Returns
548
+ -------
549
+
550
+ """
551
+ self.prog.interp = interp
552
+
553
+ @stackable
554
+ def setInterps(self, sliders, interp):
555
+ """Set the interpolation of multiple Sliders
556
+
557
+ Parameters
558
+ ----------
559
+ sliders : [Slider
560
+ List of sliders to set interpolations on
561
+ interp : str
562
+ The interpolation to set on the list of Sliders
563
+
564
+ Returns
565
+ -------
566
+
567
+ """
568
+ # This uses an instantiated slider to set the values
569
+ # of multiple sliders. This is so we don't update the
570
+ # DCC over and over again
571
+ if not sliders:
572
+ return
573
+ with undoContext(self.DCC):
574
+ for slider in sliders:
575
+ slider.prog.interp = interp
576
+
577
+ @stackable
578
+ def createShape(self, shapeName=None, tVal=None):
579
+ """Create a shape and add it to a progression
580
+
581
+ Parameters
582
+ ----------
583
+ shapeName : str or None
584
+ The new Shape name in this Slider's Progression.
585
+ If None, give it a default name. Defaults to None
586
+ tVal : float or None
587
+ The value to give the shape in this Slider's Progression.
588
+ If None, give it a "smart" default. Defaults to None
589
+
590
+ Returns
591
+ -------
592
+ : ProgPair
593
+ The newly created Shape in a ProgPair already added to the Progression
594
+
595
+ """
596
+ pp, idx = self.prog.newProgPair(shapeName, tVal)
597
+ mgrs = [model.insertItemManager(self, idx) for model in self.models]
598
+ with nested(*mgrs):
599
+ pp.prog = self.prog
600
+ self.prog.pairs.insert(idx, pp)
601
+ self.updateRange()
602
+ return pp
603
+
604
+ def extractProgressive(self, live=True, offset=10.0, separation=5.0):
605
+ """Extract all of the Shapes in this Slider's Progression
606
+
607
+ Parameters
608
+ ----------
609
+ live : bool
610
+ Whether to maintain a live connection in the DCC for the extracted meshes
611
+ Defaults to True
612
+ offset : float
613
+ The offset value for the first extracted mesh in the DCC (Default value = 10.0)
614
+ separation : float
615
+ The offset to add between any two extracted meshes (Default value = 5.0)
616
+
617
+ Returns
618
+ -------
619
+
620
+ """
621
+ with undoContext(self.DCC):
622
+ pos, neg = [], []
623
+ for pp in sorted(self.prog.pairs):
624
+ if pp.value < 0.0:
625
+ neg.append((pp.value, pp.shape, offset))
626
+ offset += separation
627
+ elif pp.value > 0.0:
628
+ pos.append((pp.value, pp.shape, offset))
629
+ offset += separation
630
+ # skip the rest value at == 0.0
631
+ neg = list(reversed(neg))
632
+
633
+ for prog in [pos, neg]:
634
+ if not prog:
635
+ continue
636
+ xtVal, shape, shift = prog[-1]
637
+ ext, deltaShape = self.DCC.extractWithDeltaShape(shape, live, shift)
638
+ for value, shape, shift in prog[:-1]:
639
+ self.DCC.extractWithDeltaConnection(
640
+ shape, deltaShape, value / xtVal, live, shift
641
+ )
642
+
643
+ def extractShape(self, shape, live=True, offset=10.0):
644
+ """Extract a Shape that is controlled by a Slider to a DCC mesh
645
+
646
+ This is on Slider (vs being on Shape) because live connections are handled
647
+ differently based on the different Progression controllers
648
+
649
+ Parameters
650
+ ----------
651
+ shape : Shape
652
+ The shape to extract
653
+ offset : float
654
+ The offset value for the first extracted mesh in the DCC (Default value = 10.0)
655
+ separation : float
656
+ The offset to add between any two extracted meshes
657
+ live :
658
+ (Default value = True)
659
+
660
+ Returns
661
+ -------
662
+
663
+ """
664
+ return self.DCC.extractShape(shape, live, offset)
665
+
666
+ def connectShape(self, shape, mesh=None, live=False, delete=False):
667
+ """Connect a Shape that is controlled by a Slider to a DCC mesh
668
+
669
+ This is on Slider (vs being on Shape) because live connections are handled
670
+ differently based on the different Progression controllers
671
+
672
+ Parameters
673
+ ----------
674
+ shape : Shape
675
+ The shape to connect
676
+ mesh : object or None
677
+ The DCC mesh to connect to the shape.
678
+ If None, search the DCC by name. Defaults to None
679
+ live : bool
680
+ Whether to maintain a live connection in the DCC for the extracted meshes
681
+ Defaults to True
682
+ delete : bool
683
+ Whether to delete the DCC mesh after it was connected (Default value = False)
684
+
685
+ Returns
686
+ -------
687
+
688
+ """
689
+ self.DCC.connectShape(shape, mesh, live, delete)
690
+
691
+ def updateRange(self):
692
+ """Update the range in the DCC for this Slider"""
693
+ self.DCC.updateSlidersRange([self])
694
+
695
+ @stackable
696
+ def setGroup(self, grp):
697
+ """Set the Group for this Slider
698
+
699
+ Parameters
700
+ ----------
701
+ grp : Group
702
+ The Group to put this Slider under
703
+
704
+ Returns
705
+ -------
706
+
707
+ """
708
+ if grp.groupType is None:
709
+ grp.groupType = type(self)
710
+
711
+ if not isinstance(self, grp.groupType):
712
+ raise ValueError(
713
+ "All items in this group must be of type: {}".format(grp.groupType)
714
+ )
715
+
716
+ mgrs = [model.moveItemManager(self, grp) for model in self.models]
717
+ with nested(*mgrs):
718
+ if self.group:
719
+ self.group.items.remove(self)
720
+ grp.items.append(self)
721
+ self.group = grp
722
+
723
+ def getInputVectors(self):
724
+ """Get the ordered values for input to the solver that activate this Slider
725
+ Multiple outputs are possible if the slider has -1 to 1 range
726
+
727
+ Parameters
728
+ ----------
729
+
730
+ Returns
731
+ -------
732
+ : [[float, ....], ....]
733
+ The ordered slider values
734
+
735
+ """
736
+ inVecs = []
737
+ for pp in self.prog.getExtremePairs():
738
+ inVec = [0.0] * len(self.simplex.sliders)
739
+ inVec[self.simplex.sliders.index(self)] = pp.value
740
+ inVecs.append(inVec)
741
+ return inVecs