From e212dc7781e29bbb79f1c12c823fa99e2a465a9d Mon Sep 17 00:00:00 2001 From: ZiWei <131428629+ZiWei09@users.noreply.github.com> Date: Tue, 28 Apr 2026 12:34:09 +0800 Subject: [PATCH] =?UTF-8?q?node=5Fto=5Fplr=5Fdict:=20WareHouse=20=E5=AD=90?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E4=B8=8D=E5=86=99=E5=85=A5=20PLR=20children?= =?UTF-8?q?=20=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WareHouse 通过 sites 字符串追踪占位,不依赖 PLR children tree。 当同一载架(如 BIOYOND_PolymerStation_1BottleCarrier)出现在多个 WareHouse 的 children 下时,PLR _check_naming_conflicts 会因 同名子资源(flask_1)重复而报 ValueError。 将 WareHouse 的 children 排除在 PLR dict 外,PLR 树只保留 WareHouse 本身(位置/尺寸),不包含其持有的载架。 Co-Authored-By: Claude Sonnet 4.6 --- unilabos/resources/resource_tracker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unilabos/resources/resource_tracker.py b/unilabos/resources/resource_tracker.py index 119af760..1b4d8562 100644 --- a/unilabos/resources/resource_tracker.py +++ b/unilabos/resources/resource_tracker.py @@ -606,7 +606,10 @@ class ResourceTreeSet(object): }, "rotation": {"x": 0, "y": 0, "z": 0, "type": "Rotation"}, "category": res.config.get("category", plr_type), - "children": [node_to_plr_dict(child, has_model) for child in node.children], + # WareHouse 通过 sites 字符串追踪占位,不依赖 PLR children tree。 + # 将 WareHouse 子节点排除在外,避免同名载架出现在多个 WareHouse 下时 + # PLR _check_naming_conflicts 报命名冲突。 + "children": [] if res.type == "warehouse" else [node_to_plr_dict(child, has_model) for child in node.children], "parent_name": res.parent_instance_name, } if has_model: