Skip to content

Commit 75f49bb

Browse files
committed
add SceneObject.scene
1 parent ded6987 commit 75f49bb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
* Added `compas.colors.Color.contrast`.
1616
* Added `compas.geometry.Brep.from_plane`.
1717
* Added `compas.tolerance.Tolerance.angulardeflection`.
18+
* Added `compas.scene.SceneObject.scene` attribute.
1819

1920
### Changed
2021

src/compas/scene/sceneobject.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ class SceneObject(TreeNode):
7272
The settings including necessary attributes for reconstructing the scene object besides the Data item.
7373
context : str
7474
The context in which the scene object is created.
75+
scene : :class:`compas.scene.Scene`
76+
The scene to which the scene object belongs.
7577
7678
"""
7779

@@ -120,6 +122,11 @@ def __repr__(self):
120122
# type: () -> str
121123
return "<{}: {}>".format(self.__class__.__name__, self.name)
122124

125+
@property
126+
def scene(self):
127+
# type: () -> compas.scene.Scene
128+
return self.tree
129+
123130
@property
124131
def item(self):
125132
# type: () -> compas.geometry.Geometry | compas.datastructures.Datastructure

0 commit comments

Comments
 (0)