Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Scene.Selection.Selection Class Reference

This class is responsible for keeping track of what objects are selected It uses signals to notify others of changes in the selection It also has a convenience function that allows it to apply a single operation to all selected objects. More...

Public Member Functions

 add (cls, object)
 
 remove (cls, object)
 
 getCount (cls)
 Get number of selected objects.
 
 getAllSelectedObjects (cls)
 
 getBoundingBox (cls)
 
 getSelectedObject (cls, index)
 Get selected object by index.
 
 isSelected (cls, object)
 
 clear (cls)
 
 hasSelection (cls)
 Check if anything is selected at all.
 
 getSelectionCenter (cls)
 
 applyOperation (cls, operation, *args, **kwargs)
 Apply an operation to the entire selection.
 

Static Public Attributes

 selectionChanged = Signal()
 
 selectionCenterChanged = Signal()
 

Protected Member Functions

 _onTransformationChanged (cls, node)
 

Protected Attributes

 _onTransformationChanged
 

Detailed Description

This class is responsible for keeping track of what objects are selected It uses signals to notify others of changes in the selection It also has a convenience function that allows it to apply a single operation to all selected objects.

Member Function Documentation

◆ applyOperation()

UM.Scene.Selection.Selection.applyOperation (   cls,
  operation,
args,
**  kwargs 
)

Apply an operation to the entire selection.

This will create and push an operation onto the operation stack. Dependent on whether there is one item selected or multiple it will be just the operation or a grouped operation containing the operation for each selected node.

Parameters
operationClass The operation to create and push. It should take a SceneNode as first positional parameter.
argsThe additional positional arguments passed along to the operation constructor.
kwargsThe additional keyword arguments that will be passed along to the operation constructor.
Returns
list of instantiated operations

◆ getSelectedObject()

UM.Scene.Selection.Selection.getSelectedObject (   cls,
  index 
)

Get selected object by index.

Parameters
indexindex of the object to return
Returns
selected object or None if index was incorrect / not found

The documentation for this class was generated from the following file: