修复导入

This commit is contained in:
Rowland 2026-03-05 09:22:50 +08:00
parent 37b3cc30dc
commit d2cfc77fc6
2 changed files with 15 additions and 32 deletions

View File

@ -25,25 +25,25 @@ Collapsed=0
[Window][工具栏]
Pos=278,20
Size=1373,32
Size=1303,32
Collapsed=0
DockId=0x0000000D,0
[Window][场景树]
Pos=0,20
Size=276,634
Size=276,638
Collapsed=0
DockId=0x00000007,0
[Window][属性面板]
Pos=1653,20
Size=267,989
Pos=1583,20
Size=267,996
Collapsed=0
DockId=0x00000003,0
[Window][控制台]
Pos=0,656
Size=276,353
Pos=0,660
Size=276,356
Collapsed=0
DockId=0x00000008,0
@ -60,7 +60,7 @@ Collapsed=0
[Window][WindowOverViewport_11111111]
Pos=0,20
Size=1920,989
Size=1850,996
Collapsed=0
[Window][测试窗口1]
@ -99,8 +99,8 @@ Size=600,500
Collapsed=0
[Window][资源管理器]
Pos=278,675
Size=1373,334
Pos=278,682
Size=1303,334
Collapsed=0
DockId=0x00000006,0
@ -201,7 +201,7 @@ Size=600,400
Collapsed=0
[Docking][Data]
DockSpace ID=0x08BD597D Window=0x1BBC0F80 Pos=0,20 Size=1920,989 Split=X
DockSpace ID=0x08BD597D Window=0x1BBC0F80 Pos=0,20 Size=1850,996 Split=X
DockNode ID=0x00000001 Parent=0x08BD597D SizeRef=1651,989 Split=X
DockNode ID=0x00000009 Parent=0x00000001 SizeRef=276,989 Split=Y Selected=0xE0015051
DockNode ID=0x00000007 Parent=0x00000009 SizeRef=271,634 Selected=0xE0015051
@ -210,7 +210,7 @@ DockSpace ID=0x08BD597D Window=0x1BBC0F80 Pos=0,20 Size=1920,989 Split=X
DockNode ID=0x0000000D Parent=0x0000000A SizeRef=1318,32 HiddenTabBar=1 Selected=0x43A39006
DockNode ID=0x0000000E Parent=0x0000000A SizeRef=1318,937 Split=Y
DockNode ID=0x00000005 Parent=0x0000000E SizeRef=1341,601 CentralNode=1
DockNode ID=0x00000006 Parent=0x0000000E SizeRef=1341,334 Selected=0x3A2E05C3
DockNode ID=0x00000006 Parent=0x0000000E SizeRef=1341,334 HiddenTabBar=1 Selected=0x3A2E05C3
DockNode ID=0x00000002 Parent=0x08BD597D SizeRef=267,989 Split=Y Selected=0x3188AB8D
DockNode ID=0x00000003 Parent=0x00000002 SizeRef=351,390 Selected=0x5DB6FF37
DockNode ID=0x00000004 Parent=0x00000002 SizeRef=351,597 Selected=0x1EB923B7

View File

@ -1043,7 +1043,7 @@ class AppActions:
"""
if self.use_ssbo_mouse_picking and getattr(self, 'ssbo_editor', None):
try:
# Clear selection/gizmo first to avoid dangling references to soon-to-be removed nodes.
# Clear selection/gizmo first, then import as an additional scene model.
if hasattr(self, 'selection') and self.selection:
try:
self.selection.clearSelection()
@ -1053,25 +1053,6 @@ class AppActions:
except Exception:
pass
# Remove legacy scene-manager models to avoid duplicate rendering
if hasattr(self, 'scene_manager') and self.scene_manager and hasattr(self.scene_manager, 'models'):
for m in list(self.scene_manager.models):
try:
if m and not m.isEmpty():
m.removeNode()
except Exception:
pass
self.scene_manager.models = []
# Replace previous SSBO model
old_model = getattr(self.ssbo_editor, 'model', None)
if old_model is not None:
try:
if not old_model.isEmpty():
old_model.removeNode()
except Exception:
pass
self.ssbo_editor.load_model(file_path)
model_np = getattr(self.ssbo_editor, 'model', None)
# Keep legacy ray-pick fallback usable by adding a collision body.
@ -1094,6 +1075,8 @@ class AppActions:
try:
self.scene_manager.setupCollision(model_np)
self.scene_manager._processModelAnimations(model_np)
if hasattr(self.scene_manager, "models") and model_np not in self.scene_manager.models:
self.scene_manager.models.append(model_np)
except Exception as e:
print(f"[SSBO] setup components failed: {e}")
return model_np
@ -1171,7 +1154,7 @@ class AppActions:
if set_origin:
model_node.setPos(0, 0, 0)
if hasattr(self.scene_manager, 'models'):
if hasattr(self.scene_manager, 'models') and model_node not in self.scene_manager.models:
self.scene_manager.models.append(model_node)
if select_model and hasattr(self, 'selection') and self.selection: