From 784415e464e87a752e5da4d8811513b749583723 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 21 Jan 2026 16:44:07 +0500 Subject: [PATCH] ifcsverchok bonsai integration - support editing parametric properties from UI Demo - https://files.catbox.moe/extsxf.mp4 But now it requires ifcsverchok graph to be nested inside a subgroup because we need a way to indicate which graph parameters are important, so user can modify them from Parametric Geometry tab without actually explicitly opening sverchok graph. --- src/bonsai/bonsai/bim/module/model/ui.py | 9 +++++++++ src/bonsai/bonsai/tool/model.py | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/bonsai/bonsai/bim/module/model/ui.py b/src/bonsai/bonsai/bim/module/model/ui.py index 86beea6079..ab528fb0fc 100644 --- a/src/bonsai/bonsai/bim/module/model/ui.py +++ b/src/bonsai/bonsai/bim/module/model/ui.py @@ -694,6 +694,15 @@ class BIM_PT_external_parametric_geometry(bpy.types.Panel): print(res) layout.label(text=f"Error Updating from Graph, See System Console", icon="ERROR") + layout.label(text="Parameters:") + box = layout.box() + + group_node = tool.Model.get_ifcsverchok_group_node(props.sverchok_nodes) + node_tree = group_node.node_tree + + for socket, interface_socket in zip(group_node.inputs, node_tree.sockets("INPUT")): + socket.draw_group_property(box, socket.name, interface_socket) + def draw_door_properties(layout: bpy.types.UILayout, props: module_prop.BIMDoorProperties) -> None: """Draw door properties UI (shared between properties panel and preferences).""" diff --git a/src/bonsai/bonsai/tool/model.py b/src/bonsai/bonsai/tool/model.py index a81681652c..28506bd8db 100644 --- a/src/bonsai/bonsai/tool/model.py +++ b/src/bonsai/bonsai/tool/model.py @@ -67,6 +67,7 @@ if TYPE_CHECKING: BIMExternalParametricGeometryProperties, BIMPolylineProperties, ) + from sverchok.core.node_group import SvGroupTreeNode class Model(bonsai.core.tool.Model): @@ -2565,13 +2566,21 @@ class Model(bonsai.core.tool.Model): return [s for s in group_node.inputs if s.type != "GEOMETRY"] + @classmethod + def get_ifcsverchok_group_node(cls, node_tree: sverchok.node_tree.SverchCustomTree) -> SvGroupTreeNode: + from sverchok.core.node_group import SvGroupTreeNode + + return next(n for n in node_tree.nodes if isinstance(n, SvGroupTreeNode) and n.label == "BBIM_EPG") + @classmethod def get_ifcsverchok_shape_output( cls, node_tree: sverchok.node_tree.SverchCustomTree ) -> ifcsverchok.nodes.ifc.shape_builder.shape_output.SvSbShapeOutput: from ifcsverchok.nodes.ifc.shape_builder.shape_output import SvSbShapeOutput - return next(n for n in node_tree.nodes if isinstance(n, SvSbShapeOutput)) + group_node = cls.get_ifcsverchok_group_node(node_tree) + subtree = group_node.node_tree + return next(n for n in subtree.nodes if isinstance(n, SvSbShapeOutput)) @classmethod def update_mesh_from_sverchok(