Skip to content

Commit

Permalink
Merge pull request #195 from compas-dev/fix/group_obj_type_error
Browse files Browse the repository at this point in the history
exclude_type_list
  • Loading branch information
PingHsunTsai authored Aug 8, 2024
2 parents b942be5 + 6c57aa0 commit 3b09834
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
9 changes: 8 additions & 1 deletion src/compas_viewer/components/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand All @@ -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])
Expand Down

0 comments on commit 3b09834

Please sign in to comment.