EG/PROJECT_TASK_CHECKLIST.md

278 lines
13 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 项目任务清单Project Task Checklist
更新时间2026-03-01
适用范围:`d:\IMGUI\EG` 本地工作区(不含远程仓库内容)
## 目标
- 保持编辑器主路径稳定运行在 ImGui + Panda3D。
- 持续收敛历史兼容耦合(`interface_manager/treeWidget/gui_manager`)。
- 基于可执行任务包推进非 VR 优化重构。
## 当前状态总览
- Qt 运行依赖主路径已清理完成(排除 `RenderPipelineFile`)。
- 项目已进入“非 VR 结构优化阶段”。
- `_getActor`、`updateGizmoDrag`、`_update_drag` 第一轮拆分已完成。
- `资源管理器面板` 已完成“保留原布局/样式/交互”的第二轮拆分收敛。
- `_draw_component_properties` 已完成第一轮“编排入口 + 子流程”拆分(入口 `1441 -> 3` 行)。
- `_handle_resize_drag` 已完成第三轮“边界计算 / 更新应用”细拆(核心 `44` 行)。
- `_draw_video_source_and_audio_controls` 已完成第三轮“音频/视频源/加载应用”拆分(`231 -> 4` 行)。
- `_draw_text_and_button_properties` 已完成第四轮“文本/颜色/按钮贴图”拆分(`216 -> 14` 行)。
- `_set_parent_child_relationship` 已完成第四轮“关系编排 + 可见层级”拆分(`234 -> 43` 行)。
- `_draw_layout_transform_properties` 已完成第四轮“布局/尺寸/Z-Offset”拆分`200 -> 10` 行)。
## 已完成Done
### A. Qt 清理与迁移完成
- [x] 清理主路径 Qt 直接依赖:`PyQt/PySide/Qt` 扫描主路径为 `0`
- [x] `core/InfoPanelManager.py`:去除 Qt 直接导入。
- [x] `core/selection.py`:光标逻辑改为 Panda3D 路径。
- [x] `scene/scene_manager_convert_tiles_mixin.py`:移除 `QProgressDialog`
- [x] `ui/widgets.py`:替换为 legacy 占位模块。
- [x] `ui/icon_manager.py`:替换为无 Qt 兼容实现。
- [x] `core/world.py` / `core/vr_manager.py` / `core/vr/testing/test_mode.py`:清理 `qtWidget` 语义依赖。
- [x] `requirements/*`:移除 Qt/PySide 运行依赖。
### B. 上下文收敛与基础重构完成
- [x] 建立 `core/editor_context.py`,并完成第一批接入:
- `core/event_handler.py`
- `core/selection.py`
- `core/InfoPanelManager.py`
- `ui/panels/runtime_actions.py`
- `core/terrain_manager.py`
- `scene/scene_manager_convert_tiles_mixin.py`
- `scene/scene_manager_serialization_mixin.py`
- `scene/scene_manager_model_mixin.py`
- [x] `scene/scene_manager_io_mixin.py::loadScene` 完成两轮拆分(`556 -> 74` 行)。
- [x] `main.py::__init__` 第一轮拆分完成(`375 -> 27` 行VR 初始化逻辑保持原样)。
### C. 面板模块化完成
- [x] `ui/panels/editor_panels.py` 按布局拆分为 4 个模块:
- `editor_panels_top.py`
- `editor_panels_left.py`
- `editor_panels_center.py`
- `editor_panels_right.py`
- [x] `editor_panels_right.py` 再拆分为 3 个子 mixin
- `editor_panels_right_transform.py`
- `editor_panels_right_material.py`
- `editor_panels_right_collision.py`
### D. 动画加载入口拆分完成(第一轮)
- [x] `ui/panels/animation_tools.py::_getActor` 第一轮拆分完成:
- 行数:`510 -> 39`
- 新增 helper`_sync_owner_model_path_tags`、`_get_valid_cached_actor`、`_try_memory_fallback_actor`、`_collect_actor_candidate_paths`、`_try_actor_from_path` 等
- 保持策略:文件路径优先,失败后内存/autoBind 兜底
### E. Gizmo 拖拽拆分完成(第一轮)
- [x] `core/selection.py::updateGizmoDrag` 第一轮拆分完成:
- 行数:`278 -> 32`
- 近似圈复杂度:`65 -> 10`
- 新增 helper`_validate_gizmo_drag_state`、`_apply_scale_drag`、`_apply_rotate_drag`、`_compute_axis_movement_distance`、`_apply_translate_drag`
- 保持目标gizmo 缩放/旋转/平移行为不变
### F. LUI 拖拽链路拆分完成(第一轮)
- [x] `ui/LUI/lui_manager_interaction.py::_update_drag` 第一轮拆分完成:
- 行数:`348 -> 28`
- 近似圈复杂度:`79 -> 7`
- 新增 helper`_process_canvas_drag`、`_try_start_pending_component_drag`、`_finish_component_drag_if_released`、`_update_active_component_drag`
- 保持目标Canvas/组件拖拽、吸附与释放语义不变
### G. 资源管理器面板拆分完成(保留布局版)
- [x] 第一轮低侵入优化:
- 行数:`310 -> 163`
- 近似圈复杂度:`88 -> 41`
- 新增 helper`_draw_resource_toolbar_and_filters`、`_load_resource_icon`、`_handle_resource_item_selection`、`_open_resource_item_context_menu`、`_handle_resource_file_double_click`、`_draw_resource_context_menu`
- [x] 第二轮(按当前标准重启,保持布局/样式/文案/交互顺序):
- 入口函数行数:`163 -> 23`(相对原始 `310 -> 23`
- 新增 helper`_update_resource_manager_window_rect`、`_draw_resource_directory_entries`、`_draw_resource_directory_entry`、`_draw_resource_directory_children`、`_draw_resource_subdir_entry`、`_draw_resource_subfile_entry`、`_draw_resource_file_entries`、`_draw_resource_file_entry`
- 保持目标:不改视觉布局,不改交互语义,仅做结构分解
### H. LUI 属性面板拆分完成(第一轮编排)
- [x] `ui/LUI/lui_function_properties.py::_draw_component_properties` 第一轮拆分完成:
- 入口函数行数:`1441 -> 3`
- 编排主流程函数:`_draw_component_properties_core = 34` 行
- 新增 helper
- `_draw_text_and_button_properties``216` 行)
- `_draw_layout_transform_properties``200` 行)
- `_draw_type_specific_properties``835` 行)
- `_draw_anchor_and_hierarchy_properties``168` 行)
- 保持目标:属性面板行为不变,先完成入口和流程层收敛
### I. LUI 缩放链路拆分完成(第二轮)
- [x] `ui/LUI/lui_manager_interaction.py::_handle_resize_drag` 第二轮拆分完成:
- 入口函数行数:`257 -> 3`
- 编排主流程函数:`_handle_resize_drag_core = 44` 行
- 新增 helper
- `_finish_resize_drag_if_released``19` 行)
- `_compute_resize_drag_bounds``109` 行)
- `_apply_resize_drag_updates``110` 行)
- 保持目标:缩放手柄行为与边界语义保持一致
### J. LUI 属性类型分支拆分完成(第二轮)
- [x] `ui/LUI/lui_function_properties.py::_draw_type_specific_properties` 第二轮拆分完成:
- 主函数行数:`835 -> 25`(类型分发入口)
- 新增类型 helper
- `_draw_type_props_input_field``91` 行)
- `_draw_type_props_slider``11` 行)
- `_draw_type_props_checkbox``19` 行)
- `_draw_type_props_plane_image``152` 行)
- `_draw_type_props_frame``14` 行)
- `_draw_type_props_selectbox``84` 行)
- `_draw_type_props_http_text``72` 行)
- `_draw_type_props_video``10` 行)
- `_draw_video_source_and_audio_controls``231` 行)
- `_draw_video_playback_controls``147` 行)
- 保持目标:各组件类型交互语义保持一致,先完成类型分发层收敛
### K. LUI 视频属性段拆分完成(第三轮)
- [x] `ui/LUI/lui_function_properties.py::_draw_video_source_and_audio_controls` 第三轮拆分完成:
- 主函数行数:`231 -> 4`(编排入口)
- 新增 helper
- `_draw_video_audio_controls``26` 行)
- `_draw_video_source_controls``19` 行)
- `_process_pending_video_source``22` 行)
- `_load_video_texture_from_source``21` 行)
- `_apply_loaded_video_texture``14` 行)
- `_sync_video_size_and_sprite``28` 行)
- `_replace_video_sprite``23` 行)
- `_refresh_video_keep_alive_node``22` 行)
- `_load_audio_for_component``22` 行)
- `_start_video_texture_playback``7` 行)
- 保持目标:本地视频加载/URL加载回退/音频联动语义保持一致
### L. LUI 缩放链路细拆完成(第三轮)
- [x] `ui/LUI/lui_manager_interaction.py::_compute_resize_drag_bounds` / `_apply_resize_drag_updates` 第三轮细拆完成:
- 主函数行数:`109 -> 27` / `110 -> 21`
- 新增 helper
- `_get_resize_start_values``7` 行)
- `_apply_resize_handle_delta``36` 行)
- `_apply_resize_min_size_clamp``15` 行)
- `_apply_shift_keep_ratio_resize``17` 行)
- `_apply_alt_center_resize``22` 行)
- `_cache_resize_canvas_bounds``8` 行)
- `_sanitize_resize_dimensions``6` 行)
- `_resolve_resize_parent_context``13` 行)
- `_write_resize_component_data``5` 行)
- `_apply_resize_component_position``9` 行)
- `_apply_resize_component_size_by_type``24` 行)
- `_apply_button_resize_size``7` 行)
- `_apply_input_field_resize_size``10` 行)
- `_sync_input_field_layout_stretch``22` 行)
- `_post_resize_component_sync``7` 行)
- `_get_resize_modifier_info``7` 行)
- 保持目标:缩放手柄行为与边界语义保持一致
### M. LUI 文本按钮属性段拆分完成(第四轮)
- [x] `ui/LUI/lui_function_properties.py::_draw_text_and_button_properties` 第四轮拆分完成:
- 主函数行数:`216 -> 14`
- 新增 helper
- `_draw_text_content_editor``13` 行)
- `_draw_text_font_size_editor``18` 行)
- `_draw_text_color_editor``11` 行)
- `_sync_text_or_button_color``10` 行)
- `_apply_button_layout_color``12` 行)
- `_apply_text_color``3` 行)
- `_draw_button_texture_controls``19` 行)
- `_draw_button_texture_pick_button``22` 行)
- `_apply_button_texture_variant``28` 行)
- `_unpack_button_atlas_result``9` 行)
- `_apply_button_custom_textures``11` 行)
- `_fit_button_to_default_texture_size``22` 行)
- `_clear_button_custom_textures``13` 行)
- `_draw_button_texture_path_labels``7` 行)
- 保持目标:文本/按钮编辑行为与贴图切换语义保持一致
### N. LUI 层级编辑父子关系拆分完成(第四轮)
- [x] `ui/LUI/lui_manager_editor.py::_set_parent_child_relationship` 第四轮拆分完成:
- 主函数行数:`234 -> 43`
- 新增 helper
- `_is_valid_relationship_index``5` 行)
- `_prepare_parent_child_link``8` 行)
- `_remove_child_from_old_parent``8` 行)
- `_attach_child_to_new_parent``6` 行)
- `_compute_new_child_local_position``7` 行)
- `_resolve_parent_visual_object``10` 行)
- `_set_child_visual_parent_policy``12` 行)
- `_clamp_child_local_within_parent``27` 行)
- `_sync_child_canvas_index_with_parent``7` 行)
- `_apply_child_absolute_position``10` 行)
- `_ensure_child_visibility_and_layer``19` 行)
- `_ensure_button_child_visibility``15` 行)
- `_ensure_frame_child_visibility``9` 行)
- `_ensure_media_child_visibility``13` 行)
- `_ensure_child_sprite_visibility_and_layer``24` 行)
- `_finalize_parent_child_link``9` 行)
- 保持目标:逻辑父子关系/可见层级/画布索引同步语义保持一致
### O. LUI 布局变换属性段拆分完成(第四轮)
- [x] `ui/LUI/lui_function_properties.py::_draw_layout_transform_properties` 第四轮拆分完成:
- 主函数行数:`200 -> 10`
- 新增 helper
- `_draw_fill_layout_controls``37` 行)
- `_draw_position_controls``18` 行)
- `_draw_size_controls``17` 行)
- `_draw_width_control``23` 行)
- `_draw_height_control``19` 行)
- `_post_size_control_sync``9` 行)
- `_draw_layout_group_controls``53` 行)
- `_draw_z_offset_controls``27` 行)
- 保持目标:填充模式/尺寸联动/Layout Group/Z-Offset 行为一致
## 下一步Next
### N1 `顶部菜单栏` 拆分(最高优先级,非 VR
- 目标文件:`ui/panels/editor_panels_top.py::draw_menu_bar`
- 当前规模:`227` 行
- 验收目标:
- 拆分为“菜单组渲染 / 行为分发 / 状态同步”子流程
- 单函数规模收敛到 `<= 170`
- 保持现有菜单项顺序与功能一致
### N2 `场景保存链路` 拆分(高优先级,非 VR
- 目标文件:`scene/scene_manager_io_mixin.py::saveScene`
- 当前规模:`222` 行
- 验收目标:
- 拆分为“保存前校验 / 节点序列化 / 后处理”子流程
- 单函数规模收敛到 `<= 170`
- 保持保存行为与输出格式一致
### N3 `属性面板方法注入` 拆分(中优先级,非 VR
- 目标文件:`core/InfoPanelManager.py::add_methods_to_property_panel`
- 当前规模:`209` 行
- 验收目标:
- 拆分为“能力绑定 / 兼容兜底 / 日志分层”子流程
- 单函数规模收敛到 `<= 170`
- 保持属性面板行为一致
## 验收标准(阶段)
- 不安装 PyQt/PySide 时,`python main.py` 可进入编辑器主界面。
- 非 VR 主流程(导入/选择/变换/保存/加载)无 Qt 残余异常。
- 每轮重构后可通过最小回归(启动、导入、播放动画、保存加载)。
## 关联文档
- 优化分析:`PROJECT_OPTIMIZATION_ANALYSIS.md`
- 模块索引:`PROJECT_MODULE_INDEX.md`
- 全量目录:`PROJECT_FULL_CATALOG.md`
- 历史分析:`IMGUI_MODULE_ANALYSIS.md`