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