@@ -23,9 +23,7 @@ def __init__(self, obj: Object, instance_objects: List[Object], matrix_world: Ma
2323 @property
2424 def is_visible (self ) -> bool :
2525 """
26- Check if the object is visible.
27-
28- @return: True if the object is visible, False otherwise.
26+ Return whether the object is visible.
2927 """
3028 if self .instance_objects :
3129 return self .instance_objects [- 1 ].visible_get ()
@@ -34,13 +32,19 @@ def is_visible(self) -> bool:
3432 @property
3533 def is_selected (self ) -> bool :
3634 """
37- Check if the object is selected.
38- @return: True if the object is selected, False otherwise.
35+ Return whether the object is selected.
3936 """
4037 if self .instance_objects :
4138 return self .instance_objects [- 1 ].select_get ()
4239 return self .obj .select_get ()
4340
41+ @property
42+ def is_instanced (self ) -> bool :
43+ """
44+ Return whether the object is part of an instance.
45+ """
46+ return len (self .instance_objects ) > 0
47+
4448
4549def _dfs_object_children (obj : Object , collection : Collection ) -> Iterable [Object ]:
4650 """
@@ -85,9 +89,9 @@ def dfs_collection_objects(collection: Collection) -> Iterable[DfsObject]:
8589
8690def _dfs_collection_objects_recursive (
8791 collection : Collection ,
88- instance_objects : Optional [ List [ Object ]] = None ,
92+ instance_objects : list [ Object ] | None = None ,
8993 matrix_world : Matrix = Matrix .Identity (4 ),
90- visited : Optional [ Set [ Object ]] = None
94+ visited : set [ Object ] | None = None
9195) -> Iterable [DfsObject ]:
9296 """
9397 Depth-first search of objects in a collection, including recursing into instances.
0 commit comments