diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c6c77437..098dd48e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +* Fixed `GroupObject` `pointcolor` not found error with impliment `exclude_type_list`. + ### Removed diff --git a/src/compas_viewer/components/layout.py b/src/compas_viewer/components/layout.py index 7e49e0666..26d529ad3 100644 --- a/src/compas_viewer/components/layout.py +++ b/src/compas_viewer/components/layout.py @@ -93,6 +93,13 @@ def __init__( self.items = items self.type = type + @property + def exclude_type_list(self) -> tuple[type, ...]: + from compas_viewer.scene import GroupObject + from compas_viewer.scene import TagObject + + return (GroupObject, TagObject) + def generate_layout(self) -> None: self.layout = QVBoxLayout() self.widgets = {} @@ -106,7 +113,7 @@ def generate_layout(self) -> None: if obj.is_selected: obj_list.append(obj) - if not obj_list: + if not obj_list or isinstance(obj_list[0], self.exclude_type_list): return # Only support one item selected per time self.set_layout(self.items, obj_list[0])