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,1585 @@
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=invalid-name, unused-argument
19
+ """A placeholder interface that takes arguments and does nothing with them"""
20
+
21
+ import copy
22
+ from contextlib import contextmanager
23
+ from functools import wraps
24
+
25
+ from Qt import QtCore
26
+ from Qt.QtCore import Signal
27
+
28
+ try:
29
+ import numpy as np
30
+ except ImportError:
31
+ np = None
32
+
33
+ from alembic.AbcGeom import OPolyMeshSchemaSample
34
+
35
+ from ..commands.alembicCommon import (
36
+ getSampleArray,
37
+ getStaticMeshData,
38
+ getUvSample,
39
+ mkSampleIntArray,
40
+ mkSampleVertexPoints,
41
+ mkUvSample,
42
+ )
43
+ from Qt.QtWidgets import QApplication
44
+
45
+
46
+ # UNDO STACK INTEGRATION
47
+ @contextmanager
48
+ def undoContext(inst=None):
49
+ """A context that wraps undo chunks
50
+
51
+ Parameters
52
+ ----------
53
+ inst : DCC
54
+ An instantiated DCC if available. (Default value = None)
55
+
56
+ """
57
+ if inst is None:
58
+ DCC.staticUndoOpen()
59
+ else:
60
+ inst.undoOpen()
61
+ try:
62
+ yield
63
+ finally:
64
+ if inst is None:
65
+ DCC.staticUndoClose()
66
+ else:
67
+ inst.undoClose()
68
+
69
+
70
+ def undoable(f):
71
+ """A decorator that wraps a function in an undoContext"""
72
+
73
+ @wraps(f)
74
+ def stacker(self, *args, **kwargs):
75
+ """The wrapper closure"""
76
+ with undoContext():
77
+ return f(self, *args, **kwargs)
78
+
79
+ return stacker
80
+
81
+
82
+ class DummyScene(object):
83
+ """A dcc scene containing existing dummy objects"""
84
+
85
+ def __init__(self):
86
+ self.items = {}
87
+
88
+ def get(self, tpe, name):
89
+ return self.items.get(tpe, {}).get(name)
90
+
91
+ def add(self, item):
92
+ typeDict = self.items.setdefault(type(item), {})
93
+ typeDict[item.name] = item
94
+
95
+ def remove(self, item):
96
+ typeDict = self.items.setdefault(type(item), {})
97
+ typeDict.pop(item.name, None)
98
+
99
+
100
+ DB = DummyScene() # Default module level dummy scene
101
+
102
+
103
+ class DummyAttr(object):
104
+ """A generic named object attribute"""
105
+
106
+ def __init__(self, name, value, parent):
107
+ self.name = name
108
+ self.value = value
109
+ self.parent = parent
110
+ parent.attrs[name] = self
111
+
112
+
113
+ class DummyNode(object):
114
+ """A generic DCC node"""
115
+
116
+ def __init__(self, name, db=DB):
117
+ self.name = name
118
+ self.attrs = {}
119
+ self.ops = []
120
+ if db is not None:
121
+ db.add(self)
122
+
123
+
124
+ class DummySimplex(DummyNode):
125
+ """A generic simplex node"""
126
+
127
+ def __init__(self, name, parent, db=DB):
128
+ super(DummySimplex, self).__init__(name, db)
129
+ self.definition = ""
130
+ parent.ops.append(self)
131
+
132
+
133
+ class DummyFalloff(DummyNode):
134
+ """A generic simplex node"""
135
+
136
+ def __init__(self, name, parent, db=DB):
137
+ super(DummyFalloff, self).__init__(name, db)
138
+ self.weightmap = None
139
+
140
+
141
+ class DummyShape(object):
142
+ """A generic named blendshape shape"""
143
+
144
+ def __init__(self, name, shapeNode):
145
+ self.name = name
146
+ self.value = 0.0
147
+ self.points = None
148
+ self.shapeNode = shapeNode
149
+ shapeNode.shapes[name] = self
150
+
151
+
152
+ class DummyBlendshape(DummyNode):
153
+ """A generic blendshape node"""
154
+
155
+ def __init__(self, name, parent, db=DB):
156
+ # TODO: Just reuse the DummyAttr instead of making an equivalent
157
+ super(DummyBlendshape, self).__init__(name, db)
158
+ self.shapes = {}
159
+ parent.ops.append(self)
160
+
161
+
162
+ class DummyMesh(DummyNode):
163
+ """A generic mesh"""
164
+
165
+ def __init__(self, name, db=DB):
166
+ super(DummyMesh, self).__init__(name, db)
167
+ self.importPath = ""
168
+ self.faces = None
169
+ self.counts = None
170
+ self.uvs = None
171
+ self.uvFaces = None
172
+ self.verts = None
173
+
174
+
175
+ class DCC(object):
176
+ """ """
177
+
178
+ program = "dummy"
179
+
180
+ def __init__(self, simplex, stack=None):
181
+ self.simplex = simplex # the abstract representation of the setup
182
+ self.name = simplex.name
183
+
184
+ self.scene = DummyScene()
185
+ self.mesh = None
186
+ self.ctrl = None
187
+ self.shapeNode = None
188
+ self.op = None
189
+
190
+ self._live = True
191
+ self._revision = 0
192
+ # self._shapes = {} # hold the shapes from the .smpx file as a dict
193
+ # self._faces = None # Faces for the mesh (Alembic-style)
194
+ # self._counts = None # Face counts for the mesh (Alembic-style)
195
+ # self._uvs = None # UV data for the mesh
196
+ # self._numVerts = None
197
+ self._falloffs = {} # weightPerVert values
198
+ self.sliderMul = self.simplex.sliderMul
199
+
200
+ def dummyLoad(self, other, pBar=None):
201
+ """Method to copy the information in a DCC to a DummyDCC
202
+
203
+ Parameters
204
+ ----------
205
+ other : DCC
206
+ The DCC to load into the dummy
207
+ pBar : QProgressDialog, optional
208
+ An optional progress dialog (Default value = None)
209
+
210
+ Returns
211
+ -------
212
+ : DummyDCC :
213
+ The new DummyDCC
214
+ """
215
+ other.getAllShapeVertices(other.simplex.shapes, pBar=pBar)
216
+
217
+ # Load all the data onto the new dummy mesh
218
+ points, faces, counts, uvs, uvFaces = other.getMeshTopology(other.mesh)
219
+ dummyMesh = self.buildRawTopology(
220
+ other.name, points, faces, counts, uvs, uvFaces
221
+ )
222
+ self.loadNodes(self.simplex, dummyMesh)
223
+
224
+ # Re-create the dummy shapes and sliders
225
+ for shape in self.simplex.shapes:
226
+ shape.thing = DummyShape(shape.name, self.shapeNode)
227
+
228
+ for oShape, nShape in zip(other.simplex.shapes, self.simplex.shapes):
229
+ nShape.verts = copy.copy(oShape.verts)
230
+
231
+ self.pushAllShapeVertices(self.simplex.shapes)
232
+ restVerts = self.simplex.restShape.verts
233
+
234
+ for slider in self.simplex.sliders:
235
+ slider.thing = DummyAttr(slider.name, 0.0, self.ctrl)
236
+
237
+ for fo in self.simplex.falloffs:
238
+ fo.thing = DummyFalloff(fo.name, self.scene)
239
+ fo.verts = restVerts
240
+
241
+ def preLoad(self, simp, simpDict, create=True, pBar=None):
242
+ """Code to execute before loading a simplex system into a dcc
243
+
244
+ Parameters
245
+ ----------
246
+ simp : Simplex
247
+ The simplex system that will be created
248
+ simpDict : dict
249
+ The dictionary definition of the simplex to be created
250
+ create : bool
251
+ Whether to create the missing objects in the DCC (Default value = True)
252
+ pBar : QProgressDialog, optional
253
+ An optional progress dialog (Default value = None)
254
+
255
+ Returns
256
+ -------
257
+ : object :
258
+ A generic python object to be used in the post-load
259
+ """
260
+ return None
261
+
262
+ def postLoad(self, simp, preRet):
263
+ """Code to execute after loading a simplex system into a dcc
264
+
265
+ Parameters
266
+ ----------
267
+ simp : Simplex
268
+ The simplex system that was created
269
+ preRet : object
270
+ The object returnd from the preload method
271
+
272
+ """
273
+ pass
274
+
275
+ def checkForErrors(self, window):
276
+ """Check for any DCC specific errors
277
+
278
+ Parameters
279
+ ----------
280
+ window : QMainWindow
281
+ The simplex window
282
+ """
283
+ pass
284
+
285
+ # System IO
286
+ @undoable
287
+ def loadNodes(self, simp, thing, create=True, pBar=None):
288
+ """Load the nodes from a simplex system onto a thing
289
+
290
+ Parameters
291
+ ----------
292
+ simp : Simplex
293
+ The system we're loading for
294
+ thing : object
295
+ The DCC thing we're reading
296
+ create : bool
297
+ Whether to create the missing nodes (Default value = True)
298
+ pBar : QProgressDialog, optional
299
+ An optional progress dialog (Default value = None)
300
+
301
+ """
302
+ if thing is None:
303
+ thing = DummyMesh(simp.name)
304
+
305
+ self.name = simp.name
306
+ self.mesh = thing
307
+ self.scene.add(self.mesh)
308
+
309
+ self.shapeNode = self.scene.get(DummyBlendshape, self.name)
310
+
311
+ if self.shapeNode is None:
312
+ if not create:
313
+ raise RuntimeError(
314
+ "Blendshape operator not found with creation turned off: {0}".format(
315
+ self.name
316
+ )
317
+ )
318
+ self.shapeNode = DummyBlendshape(self.name, self.mesh, self.scene)
319
+
320
+ self.op = self.scene.get(DummySimplex, self.name)
321
+ if self.op is None:
322
+ if not create:
323
+ raise RuntimeError(
324
+ "Simplex operator not found with creation turned off"
325
+ )
326
+ self.op = DummySimplex(self.name, self.mesh, self.scene)
327
+
328
+ self.ctrl = self.scene.get(DummyNode, self.name)
329
+ if self.ctrl is None:
330
+ if not create:
331
+ raise RuntimeError("Control object not found with creation turned off")
332
+ self.ctrl = DummyNode(self.name, self.scene)
333
+
334
+ def loadConnections(self, simp, pBar=None):
335
+ """Load the connections that exist in a simplex system
336
+
337
+ Parameters
338
+ ----------
339
+ simp : Simplex
340
+ The simplex system to load connections for
341
+ pBar : QProgressDialog, optional
342
+ An optional progress dialog (Default value = None)
343
+
344
+ """
345
+ pass
346
+
347
+ def getShapeThing(self, shapeName):
348
+ """Get the DCC Thing for a given shape name
349
+
350
+ Parameters
351
+ ----------
352
+ shapeName : str
353
+ The name of the shape to get
354
+
355
+ Returns
356
+ -------
357
+ : object :
358
+ The DCC Thing
359
+
360
+ """
361
+ return self.shapeNode.shapes.get(shapeName)
362
+
363
+ def getSliderThing(self, sliderName):
364
+ """Get the DCC Thing for a given slider name
365
+
366
+ Parameters
367
+ ----------
368
+ sliderName : str
369
+ The name of the slider to get
370
+
371
+ Returns
372
+ -------
373
+ : object :
374
+ The DCC Thing
375
+ """
376
+ return self.ctrl.attrs.get(sliderName)
377
+
378
+ @staticmethod
379
+ @undoable
380
+ def buildRestAbc(abcMesh, name):
381
+ """Build the rest Alembic node in the dcc
382
+
383
+ Parameters
384
+ ----------
385
+ abcMesh : IPolyMesh
386
+ The Alembic mesh object
387
+ name : str
388
+ The name of the object to create
389
+
390
+ """
391
+ mesh = DummyMesh(name) # don't add it to a scene
392
+
393
+ sa = getSampleArray(abcMesh)
394
+ if len(sa.shape) == 3:
395
+ sa = sa[0]
396
+ mesh.verts = sa
397
+ faces, counts = getStaticMeshData(abcMesh)
398
+ uvs = getUvSample(abcMesh)
399
+
400
+ aryType = list if np is None else np.array
401
+ if uvs is not None:
402
+ mesh.uvs = aryType(uvs.getVals())
403
+ mesh.uvFaces = aryType(uvs.getIndices())
404
+ mesh.faces = aryType(faces)
405
+ mesh.counts = aryType(counts)
406
+
407
+ return mesh
408
+
409
+ @staticmethod
410
+ @undoable
411
+ def buildRawTopology(name, points, faces, counts, uvs=None, uvFaces=None):
412
+ """Build a mesh directly from raw numerical data"""
413
+ # TODO: Move this guy out to the rest of the DCC's
414
+ mesh = DummyMesh(name) # don't add it to a scene
415
+
416
+ aryType = list if np is None else np.array
417
+ mesh.points = aryType(points)
418
+ mesh.faces = aryType(faces)
419
+ mesh.counts = aryType(counts)
420
+ if uvs is not None and uvFaces is not None:
421
+ mesh.uvs = aryType(uvs)
422
+ mesh.uvFaces = aryType(uvFaces)
423
+ return mesh
424
+
425
+ @staticmethod
426
+ def vertCount(mesh):
427
+ """Get the vert count of the given DCC Object
428
+
429
+ Parameters
430
+ ----------
431
+ mesh : object
432
+ The mesh to check
433
+
434
+ Returns
435
+ -------
436
+ : int :
437
+ The Number of verts
438
+ """
439
+ return len(mesh.verts)
440
+
441
+ @undoable
442
+ def loadAbcPoses(self, abcMesh, js, pBar=None):
443
+ """Load the joints/skin from an alembic file onto an already-created system
444
+
445
+ Parameters
446
+ ----------
447
+ abcMesh : IPolyMesh
448
+ The Alembic mesh to load shapes from
449
+ js : dict
450
+ The simplex definition dictionary
451
+ pBar : QProgressDialog, optional
452
+ An optional progress dialog (Default value = None)
453
+
454
+ """
455
+ pass
456
+
457
+ @undoable
458
+ def loadAbc(self, abcMesh, js, pBar=None):
459
+ """Load the shapes from an alembic file onto an already-created system
460
+
461
+ Parameters
462
+ ----------
463
+ abcMesh : IPolyMesh
464
+ The Alembic mesh to load shapes from
465
+ js : dict
466
+ The simplex definition dictionary
467
+ pBar : QProgressDialog, optional
468
+ An optional progress dialog (Default value = None)
469
+
470
+ """
471
+ shapes = js["shapes"]
472
+ if js["encodingVersion"] > 1:
473
+ shapes = [i["name"] for i in shapes]
474
+ pointPositions = getSampleArray(abcMesh)
475
+ for name, ppos in zip(shapes, pointPositions):
476
+ dummyShape = self.shapeNode.shapes[name]
477
+ dummyShape.points = ppos
478
+
479
+ def getAllShapeVertices(self, shapes, pBar=None):
480
+ """Load all shape vertices into the simplex system for processing
481
+
482
+ Parameters
483
+ ----------
484
+ shapes : [Shape, ...]
485
+ A list of simplex Shape objects to get positions for
486
+
487
+ pBar : QProgressDialog, optional
488
+ An optional progress dialog (Default value = None)
489
+
490
+ """
491
+ for shape in shapes:
492
+ verts = self.getShapeVertices(shape)
493
+ shape.verts = verts
494
+
495
+ def getShapeVertices(self, shape):
496
+ """Get the point positions of a shape
497
+
498
+ Parameters
499
+ ----------
500
+ shape : Shape
501
+ A simplex Shape object to get the vertices for
502
+
503
+ Returns
504
+ -------
505
+ : np.array :
506
+ A numpy array of the point positions
507
+
508
+ """
509
+ return shape.thing.points
510
+
511
+ def pushAllShapeVertices(self, shapes, pBar=None):
512
+ """Push the computed vertex positions for the given shapes back to the DCC
513
+
514
+ Parameters
515
+ ----------
516
+ shapes : [Shape, ...]
517
+ A list of simplex Shape objects
518
+
519
+ pBar : QProgressDialog, optional
520
+ An optional progress dialog (Default value = None)
521
+
522
+ """
523
+ for shape in shapes:
524
+ self.pushShapeVertices(shape)
525
+
526
+ def pushShapeVertices(self, shape):
527
+ """Push the computed vertex positions for the given shape back to the DCC
528
+ Parameters
529
+ ----------
530
+ shape : Shape
531
+ The Simplex Shape object to update
532
+
533
+ """
534
+ shape.thing.points = shape.verts
535
+
536
+ def loadMeshTopology(self):
537
+ """Load the mesh topology from the DCC into the simplex interface"""
538
+ # Here in Dummy I either have the data already or I don't, So nothing to do
539
+ pass
540
+
541
+ @staticmethod
542
+ def getMeshTopology(mesh, uvName=None):
543
+ """Get the topology of a mesh
544
+
545
+ Parameters
546
+ ----------
547
+ mesh : object
548
+ The DCC Mesh to read
549
+ uvName : str, optional
550
+ The name of the uv set to read
551
+
552
+ Returns
553
+ -------
554
+ : np.array :
555
+ The vertex array
556
+ : np.array :
557
+ The "faces" array
558
+ : np.array :
559
+ The "counts" array
560
+ : np.array :
561
+ The uv positions
562
+ : np.array :
563
+ The "uvFaces" array
564
+ """
565
+ return mesh.verts, mesh.faces, mesh.counts, mesh.uvs, mesh.uvFaces
566
+
567
+ def exportAbc(
568
+ self, dccMesh, abcMesh, js, world=False, ensureCorrect=False, pBar=None
569
+ ):
570
+ """Export a .smpx file
571
+
572
+ Parameters
573
+ ----------
574
+ dccMesh : object
575
+ The DCC Mesh to export
576
+ abcMesh : OPolyMesh
577
+ The Alembic output mesh
578
+ js : dict
579
+ The definition dictionary
580
+ world : bool
581
+ Do the export in worldspace (Default value = False)
582
+ pBar : QProgressDialog, optional
583
+ An optional progress dialog (Default value = None)
584
+
585
+ """
586
+ # export the data to alembic
587
+ if dccMesh is None:
588
+ dccMesh = self.mesh
589
+
590
+ shapeDict = {i.name: i for i in self.simplex.shapes}
591
+
592
+ shapeNames = js["shapes"]
593
+ if js["encodingVersion"] > 1:
594
+ shapeNames = [i["name"] for i in shapeNames]
595
+ shapes = [shapeDict[i] for i in shapeNames]
596
+ schema = abcMesh.getSchema()
597
+
598
+ if pBar is not None:
599
+ pBar.show()
600
+ pBar.setMaximum(len(shapes))
601
+ spacerName = "_" * max(list(map(len, shapeNames)))
602
+ pBar.setLabelText("Exporting:\n{0}".format(spacerName))
603
+ QApplication.processEvents()
604
+
605
+ faces = mkSampleIntArray(self.mesh.faces)
606
+ counts = mkSampleIntArray(self.mesh.counts)
607
+ uvs = None
608
+ if self.mesh.uvs is not None and self.mesh.uvFaces is not None:
609
+ uvs = mkUvSample(self.mesh.uvs, self.mesh.uvFaces)
610
+
611
+ for i, shape in enumerate(shapes):
612
+ if pBar is not None:
613
+ pBar.setLabelText("Exporting:\n{0}".format(shape.name))
614
+ pBar.setValue(i)
615
+ QApplication.processEvents()
616
+ if pBar.wasCanceled():
617
+ return
618
+ verts = mkSampleVertexPoints(shape.thing.points)
619
+ if uvs is not None:
620
+ # Alembic doesn't allow for uvs=None for some reason
621
+ abcSample = OPolyMeshSchemaSample(verts, faces, counts, uvs)
622
+ else:
623
+ abcSample = OPolyMeshSchemaSample(verts, faces, counts)
624
+ schema.set(abcSample)
625
+
626
+ def exportOtherAbc(self, dccMesh, abcMesh, js, world=False, pBar=None):
627
+ """Export a .smpx file of a mesh other than self.mesh
628
+
629
+ Parameters
630
+ ----------
631
+ dccMesh : object
632
+ The DCC Mesh to export
633
+ abcMesh : OPolyMesh
634
+ The Alembic output mesh
635
+ js : dict
636
+ The definition dictionary
637
+ world : bool
638
+ Do the export in worldspace (Default value = False)
639
+ pBar : QProgressDialog, optional
640
+ An optional progress dialog (Default value = None)
641
+
642
+ """
643
+ if dccMesh is None:
644
+ raise ValueError(
645
+ "Export Other requires an explicitly defined mesh to export"
646
+ )
647
+ self.exportAbc(
648
+ dccMesh, abcMesh, js, world=world, ensureCorrect=False, pBar=pBar
649
+ )
650
+
651
+ def deleteObj(self, dccMesh, path):
652
+ """Export a mesh to the given path"""
653
+ pass
654
+
655
+ def exportMesh(self, dccMesh, path):
656
+ """Export a mesh to the given path"""
657
+ pass
658
+
659
+ # Revision tracking
660
+ def getRevision(self):
661
+ """Get the simplex revision number"""
662
+ return self._revision
663
+
664
+ def incrementRevision(self):
665
+ """Increment the revision number"""
666
+ self._revision += 1
667
+ return self._revision
668
+
669
+ def setRevision(self, val):
670
+ """Manually set the revision numer
671
+
672
+ Parameters
673
+ ----------
674
+ val : int
675
+ The value to set
676
+
677
+ """
678
+ self._revision = val
679
+
680
+ # System level
681
+ @undoable
682
+ def renameSystem(self, name):
683
+ """Rename a simplex system
684
+
685
+ Parameters
686
+ ----------
687
+ name : str
688
+ The new name
689
+
690
+ """
691
+ # TODO
692
+ # oldName = self.name
693
+ self.name = name
694
+ # for dd in (DB.nodes, DB.ops, DB.bss, DB.meshes):
695
+ # oo = dd.get(oldName)
696
+ # if oo is not None:
697
+ # oo.name = self.name
698
+ # dd[self.name] = oo
699
+ # dd.pop(oldName, None)
700
+
701
+ @undoable
702
+ def deleteSystem(self):
703
+ """Delete the current system"""
704
+ # for dd in (DB.nodes, DB.ops, DB.bss, DB.meshes):
705
+ # if self.name in dd:
706
+ # dd.pop(self.name, None)
707
+ # TODO
708
+ self.name = None
709
+ self.simplex = None
710
+
711
+ # Shapes
712
+ @undoable
713
+ def createShape(self, shape, live=False, offset=10):
714
+ """Create a dcc shape
715
+
716
+ Parameters
717
+ ----------
718
+ shape : Shape
719
+ A simplex shape object
720
+ live : bool
721
+ Whether this shape is live-connected (Default value = False)
722
+ offset : float
723
+ The offset of the created shape (Default value = 10)
724
+
725
+ """
726
+ newShape = DummyShape(shape.name, self.shapeNode)
727
+ newShape.points = copy.copy(self.mesh.verts)
728
+ return newShape
729
+
730
+ @undoable
731
+ def extractWithDeltaShape(self, shape, live=True, offset=10.0):
732
+ """Make a mesh representing a shape. Can be live or not.
733
+ Also, make a shapenode that is the delta of the change being made
734
+
735
+ Parameters
736
+ ----------
737
+ shape :
738
+
739
+ live :
740
+ (Default value = True)
741
+ offset :
742
+ (Default value = 10.0)
743
+
744
+ """
745
+ pass
746
+
747
+ @undoable
748
+ def extractWithDeltaConnection(self, shape, delta, value, live=True, offset=10.0):
749
+ """Extract a shape with a live partial delta added in.
750
+ Useful for updating progressive shapes
751
+
752
+ Parameters
753
+ ----------
754
+ shape :
755
+
756
+ delta :
757
+
758
+ value :
759
+
760
+ live :
761
+ (Default value = True)
762
+ offset :
763
+ (Default value = 10.0)
764
+
765
+ """
766
+ pass
767
+
768
+ @undoable
769
+ def extractShape(self, shape, live=True, offset=10.0):
770
+ """Make a mesh representing a shape. Can be live or not.
771
+ Can also store its starting shape and delta data
772
+
773
+ Parameters
774
+ ----------
775
+ shape :
776
+
777
+ live :
778
+ (Default value = True)
779
+ offset :
780
+ (Default value = 10.0)
781
+
782
+ """
783
+ pass
784
+
785
+ @undoable
786
+ def connectShape(self, shape, mesh=None, live=False, delete=False):
787
+ """Force a shape to match a mesh
788
+ The "connect shape" button is:
789
+ mesh=None, delete=True
790
+ The "match shape" button is:
791
+ mesh=someMesh, delete=False
792
+ There is a possibility of a "make live" button:
793
+ live=True, delete=False
794
+
795
+ Parameters
796
+ ----------
797
+ shape :
798
+
799
+ mesh :
800
+ (Default value = None)
801
+ live :
802
+ (Default value = False)
803
+ delete :
804
+ (Default value = False)
805
+
806
+ """
807
+ pass
808
+
809
+ @undoable
810
+ def extractPosedShape(self, shape):
811
+ """???
812
+
813
+ Parameters
814
+ ----------
815
+ shape :
816
+
817
+ """
818
+ pass
819
+
820
+ @undoable
821
+ def zeroShape(self, shape):
822
+ """Set a shape back to rest
823
+
824
+ Parameters
825
+ ----------
826
+ shape : Shape
827
+ The simplex shpae to zero out
828
+
829
+ """
830
+ shape.thing.points = self.getShapeVertices(self.simplex.restShape)
831
+
832
+ @undoable
833
+ def deleteShape(self, toDelShape):
834
+ """Delete a shape from the system
835
+
836
+ Parameters
837
+ ----------
838
+ toDelShape :
839
+
840
+ """
841
+ self.shapeNode.shapes.pop(toDelShape.name, None)
842
+
843
+ @undoable
844
+ def renameShape(self, shape, name):
845
+ """Rename a shape
846
+
847
+ Parameters
848
+ ----------
849
+ shape : Shape
850
+ The simplex Shape object to rename
851
+ name : str
852
+ The new name
853
+
854
+ """
855
+ self.shapeNode.shapes.pop(shape.thing.name, None)
856
+ shape.thing.name = name
857
+ self.shapeNode.shapes[name] = shape.thing
858
+
859
+ @undoable
860
+ def convertShapeToCorrective(self, shape):
861
+ """???
862
+
863
+ Parameters
864
+ ----------
865
+ shape :
866
+
867
+ """
868
+ pass
869
+
870
+ # Falloffs
871
+ def createFalloff(self, falloff):
872
+ """Create a per-vert falloff weightmap
873
+
874
+ Parameters
875
+ ----------
876
+ falloff : Falloff
877
+ The simplex Falloff object to create
878
+
879
+ """
880
+ fo = DummyFalloff(falloff.name, self.scene)
881
+ fo.weights = np.zeros(len(self.mesh.verts))
882
+
883
+ def duplicateFalloff(self, falloff, newFalloff):
884
+ """Create a new falloff from an already existing one
885
+
886
+ Parameters
887
+ ----------
888
+ falloff : Falloff
889
+ The already existing falloff
890
+ newFalloff : Falloff
891
+ The newly created falloff to store the newly duplicated data
892
+
893
+ """
894
+ fo = DummyFalloff(newFalloff.name, self.scene)
895
+ fo.weights = copy.copy(falloff.thing.weights)
896
+
897
+ def deleteFalloff(self, falloff):
898
+ """Delete a falloff object
899
+
900
+ Parameters
901
+ ----------
902
+ falloff : Falloff
903
+ The Falloff object to delete
904
+
905
+ """
906
+ self.scene.remove(falloff.thing)
907
+
908
+ def setFalloffData(
909
+ self, falloff, splitType, axis, minVal, minHandle, maxHandle, maxVal, mapName
910
+ ):
911
+ """Set the data of a falloff object
912
+
913
+ Parameters
914
+ ----------
915
+ falloff :
916
+
917
+ splitType :
918
+
919
+ axis :
920
+
921
+ minVal :
922
+
923
+ minHandle :
924
+
925
+ maxHandle :
926
+
927
+ maxVal :
928
+
929
+ mapName :
930
+
931
+ """
932
+ # TODO: set the per-vert falloffs
933
+ pass # for eventual live splits
934
+
935
+ def getFalloffThing(self, falloff):
936
+ """Get the thing for a given falloff
937
+
938
+ Parameters
939
+ ----------
940
+ falloff : Falloff
941
+ The simplex falloff object to get
942
+
943
+ """
944
+ return self.scene.get(DummyFalloff, falloff.name)
945
+
946
+ # Sliders
947
+ @undoable
948
+ def createSlider(self, slider):
949
+ """Create a slider object
950
+
951
+ Parameters
952
+ ----------
953
+ slider : Slider
954
+ The simplex slider object to create
955
+
956
+ """
957
+ return DummyAttr(slider.name, 0.0, self.ctrl)
958
+
959
+ @undoable
960
+ def renameSlider(self, slider, name):
961
+ """Rename a slider
962
+
963
+ Parameters
964
+ ----------
965
+ slider : Slider
966
+ The slider to rename
967
+ name : str
968
+ The new name
969
+
970
+ """
971
+ self.ctrl.attrs.pop(slider.thing.name, None)
972
+ self.ctrl.attrs[name] = slider.thing
973
+ slider.thing.name = name
974
+
975
+ @undoable
976
+ def setSliderRange(self, slider):
977
+ """Set the min and max of a slider
978
+
979
+ Parameters
980
+ ----------
981
+ slider : Slider
982
+ The slider to set
983
+
984
+ """
985
+ pass
986
+
987
+ @undoable
988
+ def deleteSlider(self, toDelSlider):
989
+ """Delete a slider
990
+
991
+ Parameters
992
+ ----------
993
+ toDelSlider : Slider
994
+ The slider to delete
995
+
996
+ """
997
+ self.ctrl.attrs.pop(toDelSlider.name, None)
998
+
999
+ @undoable
1000
+ def addProgFalloff(self, prog, falloff):
1001
+ """
1002
+
1003
+ Parameters
1004
+ ----------
1005
+ prog :
1006
+
1007
+ falloff :
1008
+
1009
+ """
1010
+ pass # for eventual live splits
1011
+
1012
+ @undoable
1013
+ def removeProgFalloff(self, prog, falloff):
1014
+ """
1015
+
1016
+ Parameters
1017
+ ----------
1018
+ prog :
1019
+
1020
+ falloff :
1021
+
1022
+ """
1023
+ pass # for eventual live splits
1024
+
1025
+ @undoable
1026
+ def setSlidersWeights(self, sliders, weights):
1027
+ """Set the values for the given sliders
1028
+
1029
+ Parameters
1030
+ ----------
1031
+ sliders : [Slider, ...]
1032
+ The sliders to set values for
1033
+ weights : [float, ...]
1034
+ The values to set
1035
+
1036
+ """
1037
+ for slider, val in zip(sliders, weights):
1038
+ slider.thing.value = val
1039
+
1040
+ @undoable
1041
+ def setSliderWeight(self, slider, weight):
1042
+ """Set the value for a given slider
1043
+
1044
+ Parameters
1045
+ ----------
1046
+ slider : Slider
1047
+ The slider
1048
+ weight : float
1049
+ The value
1050
+
1051
+ """
1052
+ slider.thing.value = weight
1053
+
1054
+ @undoable
1055
+ def updateSlidersRange(self, sliders):
1056
+ """Update the range of the given sliders
1057
+
1058
+ Parameters
1059
+ ----------
1060
+ sliders :
1061
+
1062
+ """
1063
+ pass
1064
+
1065
+ @undoable
1066
+ def extractTraversalShape(self, trav, shape, live=True, offset=10.0):
1067
+ """Extract a shape from a traversal progression
1068
+
1069
+ Parameters
1070
+ ----------
1071
+ trav :
1072
+
1073
+ shape :
1074
+
1075
+ live :
1076
+ (Default value = True)
1077
+ offset :
1078
+ (Default value = 10.0)
1079
+
1080
+ """
1081
+ pass
1082
+
1083
+ @undoable
1084
+ def connectTraversalShape(self, trav, shape, mesh=None, live=True, delete=False):
1085
+ """Connect a shape to a traversal progression
1086
+
1087
+ Parameters
1088
+ ----------
1089
+ trav :
1090
+
1091
+ shape :
1092
+
1093
+ mesh :
1094
+ (Default value = None)
1095
+ live :
1096
+ (Default value = True)
1097
+ delete :
1098
+ (Default value = False)
1099
+
1100
+ """
1101
+ pass
1102
+
1103
+ # Combos
1104
+ @undoable
1105
+ def extractComboShape(self, combo, shape, live=True, offset=10.0):
1106
+ """Extract a shape from a combo progression
1107
+
1108
+ Parameters
1109
+ ----------
1110
+ combo :
1111
+
1112
+ shape :
1113
+
1114
+ live :
1115
+ (Default value = True)
1116
+ offset :
1117
+ (Default value = 10.0)
1118
+
1119
+ """
1120
+ pass
1121
+
1122
+ @undoable
1123
+ def connectComboShape(self, combo, shape, mesh=None, live=True, delete=False):
1124
+ """Connect a shape to a combo progression
1125
+
1126
+ Parameters
1127
+ ----------
1128
+ combo :
1129
+
1130
+ shape :
1131
+
1132
+ mesh :
1133
+ (Default value = None)
1134
+ live :
1135
+ (Default value = True)
1136
+ delete :
1137
+ (Default value = False)
1138
+
1139
+ """
1140
+ pass
1141
+
1142
+ @staticmethod
1143
+ def setDisabled(op):
1144
+ """Disable the output of any simplex systems
1145
+
1146
+ Parameters
1147
+ ----------
1148
+ op : The operator to disable
1149
+
1150
+
1151
+ Returns
1152
+ -------
1153
+ : object :
1154
+ Some object that will allow us to re-enable the system
1155
+
1156
+ """
1157
+ return None
1158
+
1159
+ @staticmethod
1160
+ def reEnable(helpers):
1161
+ """Re-enable a simplex system
1162
+
1163
+ Parameters
1164
+ ----------
1165
+ helpers : object
1166
+ The helper object returned from setDisabled
1167
+
1168
+ """
1169
+ pass
1170
+
1171
+ @undoable
1172
+ def renameCombo(self, combo, name):
1173
+ """Set the name of a Combo
1174
+
1175
+ Parameters
1176
+ ----------
1177
+ combo : Combo
1178
+ The combo to rename
1179
+ name : str
1180
+ The new name
1181
+
1182
+ """
1183
+ pass
1184
+
1185
+ # Data Access
1186
+ @staticmethod
1187
+ def getSimplexOperators():
1188
+ """Get all simplex operators in the DCC"""
1189
+ return list(DB.ops.values())
1190
+
1191
+ @staticmethod
1192
+ def getSimplexOperatorsByName(name):
1193
+ """Get a simplex operator
1194
+
1195
+ Parameters
1196
+ ----------
1197
+ name : str
1198
+ The name to search for
1199
+
1200
+
1201
+ Returns
1202
+ -------
1203
+ : object :
1204
+ The simplex operator for the DCC
1205
+
1206
+ """
1207
+ return DB.ops.get(name)
1208
+
1209
+ @staticmethod
1210
+ def getSimplexOperatorsOnObject(thing):
1211
+ """Get all simplex operators controlling an object
1212
+
1213
+ Parameters
1214
+ ----------
1215
+ thing : object
1216
+ A dcc object to check for simplex operators
1217
+
1218
+ Returns
1219
+ -------
1220
+ : [object, ...] :
1221
+ A list of simplex operators
1222
+
1223
+ """
1224
+ return [o for o in thing.ops if isinstance(o, DummySimplex)]
1225
+
1226
+ @staticmethod
1227
+ def getSimplexString(op):
1228
+ """Get the simplex string from the given operator
1229
+
1230
+ Parameters
1231
+ ----------
1232
+ op : object
1233
+ The Simplex operator to get the definition from
1234
+
1235
+ Returns
1236
+ -------
1237
+ : str :
1238
+ The simplex definition
1239
+
1240
+ """
1241
+ return op.definition
1242
+
1243
+ @staticmethod
1244
+ def getSimplexStringOnThing(thing, systemName):
1245
+ """Get the definition on an object by name
1246
+
1247
+ Parameters
1248
+ ----------
1249
+ thing : object
1250
+ The DCC object to check for a simplex operator
1251
+ systemName : str
1252
+ The system name to check for
1253
+
1254
+ Returns
1255
+ -------
1256
+ : str :
1257
+ The simplex definition
1258
+
1259
+ """
1260
+ for op in thing.ops:
1261
+ if op.name == systemName:
1262
+ return op.definition
1263
+ return None
1264
+
1265
+ @staticmethod
1266
+ def setSimplexString(op, val):
1267
+ """Set the definition string on an object
1268
+
1269
+ Parameters
1270
+ ----------
1271
+ op : object
1272
+ The operator to set the definition on
1273
+ val : str
1274
+ The definition to set
1275
+
1276
+ Returns
1277
+ -------
1278
+
1279
+ """
1280
+ op.definition = val
1281
+
1282
+ @staticmethod
1283
+ def selectObject(thing):
1284
+ """Select an object in the DCC
1285
+
1286
+ Parameters
1287
+ ----------
1288
+ thing :
1289
+
1290
+ """
1291
+ pass
1292
+
1293
+ def selectCtrl(self):
1294
+ """Select the system's control object"""
1295
+ pass
1296
+
1297
+ @staticmethod
1298
+ def getObjectByName(name):
1299
+ """Get an object by name
1300
+
1301
+ Parameters
1302
+ ----------
1303
+ name : str
1304
+ The name to search for
1305
+
1306
+ Returns
1307
+ -------
1308
+ : object :
1309
+ The found object
1310
+
1311
+ """
1312
+ # TODO: maybe also filter by type??
1313
+ # return DB.meshes.get(name)
1314
+ return DB.get(DummyMesh, name)
1315
+
1316
+ @staticmethod
1317
+ def getObjectName(thing):
1318
+ """Get the name of an object
1319
+
1320
+ Parameters
1321
+ ----------
1322
+ thing : object
1323
+ The dcc object to get the name for
1324
+
1325
+
1326
+ Returns
1327
+ -------
1328
+ : str :
1329
+ The Object Name
1330
+
1331
+ """
1332
+ return thing.name
1333
+
1334
+ @staticmethod
1335
+ def staticUndoOpen():
1336
+ """Open an undo chunk without knowledge of Simplex"""
1337
+ pass
1338
+
1339
+ @staticmethod
1340
+ def staticUndoClose():
1341
+ """Close an undo chunk without knowledge of Simplex"""
1342
+ pass
1343
+
1344
+ def undoOpen(self):
1345
+ """Open an undo chunk with knowledge of Simplex"""
1346
+ pass
1347
+
1348
+ def undoClose(self):
1349
+ """Close an undo chunk with knowledge of Simplex"""
1350
+ pass
1351
+
1352
+ @classmethod
1353
+ def getPersistentFalloff(cls, thing):
1354
+ """Get a representation of the given object that won't get deleted or garbage collected
1355
+
1356
+ Parameters
1357
+ ----------
1358
+ thing : object
1359
+ The thing to get a persistent representation of
1360
+
1361
+ Returns
1362
+ -------
1363
+ : object :
1364
+ The requested persistent object
1365
+
1366
+ """
1367
+ return cls.getObjectName(thing)
1368
+
1369
+ @classmethod
1370
+ def loadPersistentFalloff(cls, thing):
1371
+ """Get the usable representation of the given persistent thing
1372
+
1373
+ Parameters
1374
+ ----------
1375
+ thing : object
1376
+ A persistent representation
1377
+
1378
+ Returns
1379
+ -------
1380
+ : object :
1381
+ The requested volatile object
1382
+
1383
+ """
1384
+ return cls.getObjectByName(thing)
1385
+
1386
+ @classmethod
1387
+ def getPersistentShape(cls, thing):
1388
+ """Get a representation of the given object that won't get deleted or garbage collected
1389
+
1390
+ Parameters
1391
+ ----------
1392
+ thing : object
1393
+ The thing to get a persistent representation of
1394
+
1395
+ Returns
1396
+ -------
1397
+ : object :
1398
+ The requested persistent object
1399
+
1400
+ """
1401
+ return cls.getObjectName(thing)
1402
+
1403
+ @classmethod
1404
+ def loadPersistentShape(cls, thing):
1405
+ """Get the usable representation of the given persistent thing
1406
+
1407
+ Parameters
1408
+ ----------
1409
+ thing : object
1410
+ A persistent representation
1411
+
1412
+ Returns
1413
+ -------
1414
+ : object :
1415
+ The requested volatile object
1416
+
1417
+ """
1418
+ return cls.getObjectByName(thing)
1419
+
1420
+ @classmethod
1421
+ def getPersistentSlider(cls, thing):
1422
+ """Get a representation of the given object that won't get deleted or garbage collected
1423
+
1424
+ Parameters
1425
+ ----------
1426
+ thing : object
1427
+ The thing to get a persistent representation of
1428
+
1429
+ Returns
1430
+ -------
1431
+ : object :
1432
+ The requested persistent object
1433
+
1434
+ """
1435
+ return cls.getObjectName(thing)
1436
+
1437
+ @classmethod
1438
+ def loadPersistentSlider(cls, thing):
1439
+ """Get the usable representation of the given persistent thing
1440
+
1441
+ Parameters
1442
+ ----------
1443
+ thing : object
1444
+ A persistent representation
1445
+
1446
+ Returns
1447
+ -------
1448
+ : object :
1449
+ The requested volatile object
1450
+
1451
+ """
1452
+ return cls.getObjectByName(thing)
1453
+
1454
+ @staticmethod
1455
+ def getSelectedObjects():
1456
+ """Get the selected objects"""
1457
+ # Here in the dummy interface, we short-circuit this
1458
+ # And return a default selected object called "thing"
1459
+ return [DummyNode("thing")]
1460
+
1461
+ def getFreezeThing(self, combo):
1462
+ return []
1463
+
1464
+
1465
+ class SliderDispatch(QtCore.QObject):
1466
+ """ """
1467
+
1468
+ valueChanged = Signal()
1469
+
1470
+ def __init__(self, node, parent=None):
1471
+ super(SliderDispatch, self).__init__(parent)
1472
+
1473
+ def emitValueChanged(self, *args, **kwargs):
1474
+ """
1475
+
1476
+ Parameters
1477
+ ----------
1478
+ *args :
1479
+
1480
+ **kwargs :
1481
+
1482
+ """
1483
+ self.valueChanged.emit()
1484
+
1485
+
1486
+ class Dispatch(QtCore.QObject):
1487
+ """ """
1488
+
1489
+ beforeNew = Signal()
1490
+ afterNew = Signal()
1491
+ beforeOpen = Signal()
1492
+ afterOpen = Signal()
1493
+ undo = Signal()
1494
+ redo = Signal()
1495
+
1496
+ def __init__(self, parent=None):
1497
+ super(Dispatch, self).__init__(parent)
1498
+
1499
+ def connectCallbacks(self):
1500
+ """ """
1501
+ pass
1502
+
1503
+ def disconnectCallbacks(self):
1504
+ """ """
1505
+ pass
1506
+
1507
+ def emitBeforeNew(self, *args, **kwargs):
1508
+ """
1509
+
1510
+ Parameters
1511
+ ----------
1512
+ *args :
1513
+
1514
+ **kwargs :
1515
+
1516
+ """
1517
+ self.beforeNew.emit()
1518
+
1519
+ def emitAfterNew(self, *args, **kwargs):
1520
+ """
1521
+
1522
+ Parameters
1523
+ ----------
1524
+ *args :
1525
+
1526
+ **kwargs :
1527
+
1528
+ """
1529
+ self.afterNew.emit()
1530
+
1531
+ def emitBeforeOpen(self, *args, **kwargs):
1532
+ """
1533
+
1534
+ Parameters
1535
+ ----------
1536
+ *args :
1537
+
1538
+ **kwargs :
1539
+
1540
+ """
1541
+ self.beforeOpen.emit()
1542
+
1543
+ def emitAfterOpen(self, *args, **kwargs):
1544
+ """
1545
+
1546
+ Parameters
1547
+ ----------
1548
+ *args :
1549
+
1550
+ **kwargs :
1551
+
1552
+ """
1553
+ self.afterOpen.emit()
1554
+
1555
+ def emitUndo(self, *args, **kwargs):
1556
+ """
1557
+
1558
+ Parameters
1559
+ ----------
1560
+ *args :
1561
+
1562
+ **kwargs :
1563
+
1564
+ """
1565
+ self.undo.emit()
1566
+
1567
+ def emitRedo(self, *args, **kwargs):
1568
+ """
1569
+
1570
+ Parameters
1571
+ ----------
1572
+ *args :
1573
+
1574
+ **kwargs :
1575
+
1576
+ """
1577
+ self.redo.emit()
1578
+
1579
+
1580
+ DISPATCH = Dispatch()
1581
+
1582
+
1583
+ def rootWindow():
1584
+ """ """
1585
+ return None