node_to_plr_dict: WareHouse 子节点不写入 PLR children 列表

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 <noreply@anthropic.com>
This commit is contained in:
ZiWei
2026-04-28 12:34:09 +08:00
parent 96c4be17dc
commit e212dc7781

View File

@@ -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: