From 9bbcc89daa7377f448a5616d686bd81405a7766d Mon Sep 17 00:00:00 2001 From: Hector <145347438+hudomn@users.noreply.github.com> Date: Thu, 19 Mar 2026 11:13:37 +0800 Subject: [PATCH] =?UTF-8?q?SSBO=E5=8A=A0=E8=BD=BD=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E5=B8=A7=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/panels/app_actions.py | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/ui/panels/app_actions.py b/ui/panels/app_actions.py index 111d1be4..790d879d 100644 --- a/ui/panels/app_actions.py +++ b/ui/panels/app_actions.py @@ -1519,33 +1519,11 @@ class AppActions: and getattr(self, "ssbo_editor", None) and getattr(self.ssbo_editor, "last_import_tree_key", None) ): - selected_key = self.ssbo_editor.last_import_tree_key - selection_cost = None - if hasattr(self.ssbo_editor, "estimate_selection_cost"): - try: - selection_cost = self.ssbo_editor.estimate_selection_cost(selected_key) - except Exception: - selection_cost = None - - should_auto_select = True - if selection_cost: - object_count = int(selection_cost.get("object_count", 0)) - chunk_count = int(selection_cost.get("chunk_count", 0)) - is_root = bool(selection_cost.get("is_root")) - # SSBO 导入后的顶层节点通常覆盖整片模型; - # 只要它跨多个对象或多个 chunk,被自动选中后就会让静态批处理失效。 - # 因此这里只允许极小代价的单对象选择自动激活,其余统一保持未选中。 - if is_root or object_count > 1 or chunk_count > 1: - should_auto_select = False - - if should_auto_select: - self.ssbo_editor.select_node(selected_key) - else: - self.ssbo_editor.clear_selection(sync_world_selection=False) - if hasattr(self.ssbo_editor, "_sync_editor_selection_reference"): - self.ssbo_editor._sync_editor_selection_reference(None) - if show_info_message: - self.add_info_message("模型导入完成,已保持 SSBO 静态模式以避免导入后掉帧") + self.ssbo_editor.clear_selection(sync_world_selection=False) + if hasattr(self.ssbo_editor, "_sync_editor_selection_reference"): + self.ssbo_editor._sync_editor_selection_reference(None) + if show_info_message: + self.add_info_message("模型导入完成,已保持 SSBO 静态模式以避免导入后掉帧") elif hasattr(self, 'selection') and self.selection: self.selection.updateSelection(model_node)