From 0dfdfb646393107e332eb3214ece2b9c253cd207 Mon Sep 17 00:00:00 2001 From: rileywong311 Date: Tue, 15 Aug 2023 21:53:37 -0700 Subject: [PATCH] Rework "view brick item" conditional access Change from never show the operator if the relation is "type" to not showing it only if the "type" is the current class being viewed. This may come in handy if other list views other than hierarchy are implemented. It also implies why we don't want to show "view brick item" here: because we already viewing it. --- src/blenderbim/blenderbim/bim/module/brick/ui.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/bim/module/brick/ui.py b/src/blenderbim/blenderbim/bim/module/brick/ui.py index ccc065b47b..0191173bb2 100644 --- a/src/blenderbim/blenderbim/bim/module/brick/ui.py +++ b/src/blenderbim/blenderbim/bim/module/brick/ui.py @@ -187,7 +187,7 @@ class BIM_PT_brickschema(Panel): op = row.operator("bim.remove_brick_relation", text="", icon="UNLINKED") op.predicate = relation["predicate"] op.object = relation["object"] - if relation["is_uri"] and relation["predicate_name"] != "type": + if relation["is_uri"] and relation["object_name"] != self.props.active_brick_class: op = row.operator("bim.view_brick_item", text="", icon="DISCLOSURE_TRI_RIGHT") op.item = relation["object_uri"] if relation["is_globalid"]: