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

Public Member Functions

None add (cls, SceneNode object)
None remove (cls, SceneNode object)
bool getFaceSelectMode (cls)
None setFaceSelectMode (cls, bool select)
None setFace (cls, SceneNode object, int face_id)
None unsetFace (cls, Optional["SceneNode"] object=None)
None toggleFace (cls, SceneNode object, int face_id)
None hoverFace (cls, SceneNode object, int face_id)
None unhoverFace (cls, Optional["SceneNode"] object=None)
int getCount (cls)
List[SceneNodegetAllSelectedObjects (cls)
Optional[Tuple[SceneNode, int]] getSelectedFace (cls)
Optional[Tuple[SceneNode, int]] getHoverFace (cls)
AxisAlignedBox getBoundingBox (cls)
Optional[SceneNodegetSelectedObject (cls, int index)
bool isSelected (cls, SceneNode object)
None clear (cls)
None clearFace (cls)
bool hasSelection (cls)
Vector getSelectionCenter (cls)
 applyOperation (cls, operation, *args, **kwargs)

Static Public Attributes

 selectionChanged = Signal()
 selectionCenterChanged = Signal()
 selectedFaceChanged = Signal()
 hoverFaceChanged = Signal()

Protected Member Functions

None _onTransformationChanged (cls, _)

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.

:param operation: :type{Class} The operation to create and push. It should take a SceneNode as first positional parameter.
:param args: The additional positional arguments passed along to the operation constructor.
:param kwargs: The additional keyword arguments that will be passed along to the operation constructor.

:return: list of instantiated operations

◆ getCount()

int UM.Scene.Selection.Selection.getCount ( cls)
Get number of selected objects

◆ getSelectedObject()

Optional[SceneNode] UM.Scene.Selection.Selection.getSelectedObject ( cls,
int index )
Get selected object by index

:param index: index of the object to return
:returns: selected object or None if index was incorrect / not found

◆ hasSelection()

bool UM.Scene.Selection.Selection.hasSelection ( cls)
Check if anything is selected at all.

The documentation for this class was generated from the following file:
  • UM/Scene/Selection.py