SceneObject

class compas.scene.SceneObject[source]

Bases: object

Base class for all scene objects.

Parameters:
itemAny

The item which should be visualized using the created SceneObject.

**kwargsdict

Additional keyword arguments for constructing SceneObject.

Attributes:
itemcompas.data.Data

The item which should be visualized using the created SceneObject.

namestr

The name of the scene object. Note that is is not the same as the name of underlying data item, since different scene objects can refer to the same data item.

nodecompas.scene.SceneObjectNode

The node in the scene tree which represents the scene object.

guidslist[object]

The GUIDs of the items drawn in the visualization context.

parentcompas.scene.SceneObject

The parent scene object.

childrenlist[compas.scene.SceneObject]

The child scene objects.

framecompas.geometry.Frame

The local frame of the scene object, in relation to its parent frame.

transformationcompas.geometry.Transformation

The local transformation of the scene object in relation to its frame.

worldtransformationcompas.geometry.Transformation

The transformation of the scene object in world coordinates.

colorcompas.colors.Color

The color of the object.

contrastcolorcompas.colors.Color, readon-only

The contrastcolor wrt to the color. This is a 50% darket or lighter version of the color, depending on whether the color is light or dark.

opacityfloat

The opacity of the object.

showbool

Flag for showing or hiding the object. Default is True.

settingsdict

The settings including necessary attributes for reconstructing the scene object.

Methods

add

Add a child item to the scene object.

clear

The main clearing method.

draw

The main drawing method.