EG/PROJECT_TASK_CHECKLIST.md

13 KiB
Raw Blame History

项目任务清单Project Task Checklist

更新时间2026-03-01
适用范围:d:\IMGUI\EG 本地工作区(不含远程仓库内容)

目标

  • 保持编辑器主路径稳定运行在 ImGui + Panda3D。
  • 持续收敛历史兼容耦合(interface_manager/treeWidget/gui_manager)。
  • 基于可执行任务包推进非 VR 优化重构。

当前状态总览

  • Qt 运行依赖主路径已清理完成(排除 RenderPipelineFile)。
  • 项目已进入“非 VR 结构优化阶段”。
  • _getActorupdateGizmoDrag_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 清理与迁移完成

  • 清理主路径 Qt 直接依赖:PyQt/PySide/Qt 扫描主路径为 0
  • core/InfoPanelManager.py:去除 Qt 直接导入。
  • core/selection.py:光标逻辑改为 Panda3D 路径。
  • scene/scene_manager_convert_tiles_mixin.py:移除 QProgressDialog
  • ui/widgets.py:替换为 legacy 占位模块。
  • ui/icon_manager.py:替换为无 Qt 兼容实现。
  • core/world.py / core/vr_manager.py / core/vr/testing/test_mode.py:清理 qtWidget 语义依赖。
  • requirements/*:移除 Qt/PySide 运行依赖。

B. 上下文收敛与基础重构完成

  • 建立 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
  • scene/scene_manager_io_mixin.py::loadScene 完成两轮拆分(556 -> 74 行)。
  • main.py::__init__ 第一轮拆分完成(375 -> 27VR 初始化逻辑保持原样)。

C. 面板模块化完成

  • ui/panels/editor_panels.py 按布局拆分为 4 个模块:
    • editor_panels_top.py
    • editor_panels_left.py
    • editor_panels_center.py
    • editor_panels_right.py
  • editor_panels_right.py 再拆分为 3 个子 mixin
    • editor_panels_right_transform.py
    • editor_panels_right_material.py
    • editor_panels_right_collision.py

D. 动画加载入口拆分完成(第一轮)

  • 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 拖拽拆分完成(第一轮)

  • 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 拖拽链路拆分完成(第一轮)

  • 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. 资源管理器面板拆分完成(保留布局版)

  • 第一轮低侵入优化:
    • 行数: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
  • 第二轮(按当前标准重启,保持布局/样式/文案/交互顺序):
    • 入口函数行数: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 属性面板拆分完成(第一轮编排)

  • ui/LUI/lui_function_properties.py::_draw_component_properties 第一轮拆分完成:
    • 入口函数行数:1441 -> 3
    • 编排主流程函数:_draw_component_properties_core = 34
    • 新增 helper
      • _draw_text_and_button_properties216 行)
      • _draw_layout_transform_properties200 行)
      • _draw_type_specific_properties835 行)
      • _draw_anchor_and_hierarchy_properties168 行)
    • 保持目标:属性面板行为不变,先完成入口和流程层收敛

I. LUI 缩放链路拆分完成(第二轮)

  • ui/LUI/lui_manager_interaction.py::_handle_resize_drag 第二轮拆分完成:
    • 入口函数行数:257 -> 3
    • 编排主流程函数:_handle_resize_drag_core = 44
    • 新增 helper
      • _finish_resize_drag_if_released19 行)
      • _compute_resize_drag_bounds109 行)
      • _apply_resize_drag_updates110 行)
    • 保持目标:缩放手柄行为与边界语义保持一致

J. LUI 属性类型分支拆分完成(第二轮)

  • ui/LUI/lui_function_properties.py::_draw_type_specific_properties 第二轮拆分完成:
    • 主函数行数:835 -> 25(类型分发入口)
    • 新增类型 helper
      • _draw_type_props_input_field91 行)
      • _draw_type_props_slider11 行)
      • _draw_type_props_checkbox19 行)
      • _draw_type_props_plane_image152 行)
      • _draw_type_props_frame14 行)
      • _draw_type_props_selectbox84 行)
      • _draw_type_props_http_text72 行)
      • _draw_type_props_video10 行)
      • _draw_video_source_and_audio_controls231 行)
      • _draw_video_playback_controls147 行)
    • 保持目标:各组件类型交互语义保持一致,先完成类型分发层收敛

K. LUI 视频属性段拆分完成(第三轮)

  • ui/LUI/lui_function_properties.py::_draw_video_source_and_audio_controls 第三轮拆分完成:
    • 主函数行数:231 -> 4(编排入口)
    • 新增 helper
      • _draw_video_audio_controls26 行)
      • _draw_video_source_controls19 行)
      • _process_pending_video_source22 行)
      • _load_video_texture_from_source21 行)
      • _apply_loaded_video_texture14 行)
      • _sync_video_size_and_sprite28 行)
      • _replace_video_sprite23 行)
      • _refresh_video_keep_alive_node22 行)
      • _load_audio_for_component22 行)
      • _start_video_texture_playback7 行)
    • 保持目标:本地视频加载/URL加载回退/音频联动语义保持一致

L. LUI 缩放链路细拆完成(第三轮)

  • ui/LUI/lui_manager_interaction.py::_compute_resize_drag_bounds / _apply_resize_drag_updates 第三轮细拆完成:
    • 主函数行数:109 -> 27 / 110 -> 21
    • 新增 helper
      • _get_resize_start_values7 行)
      • _apply_resize_handle_delta36 行)
      • _apply_resize_min_size_clamp15 行)
      • _apply_shift_keep_ratio_resize17 行)
      • _apply_alt_center_resize22 行)
      • _cache_resize_canvas_bounds8 行)
      • _sanitize_resize_dimensions6 行)
      • _resolve_resize_parent_context13 行)
      • _write_resize_component_data5 行)
      • _apply_resize_component_position9 行)
      • _apply_resize_component_size_by_type24 行)
      • _apply_button_resize_size7 行)
      • _apply_input_field_resize_size10 行)
      • _sync_input_field_layout_stretch22 行)
      • _post_resize_component_sync7 行)
      • _get_resize_modifier_info7 行)
    • 保持目标:缩放手柄行为与边界语义保持一致

M. LUI 文本按钮属性段拆分完成(第四轮)

  • ui/LUI/lui_function_properties.py::_draw_text_and_button_properties 第四轮拆分完成:
    • 主函数行数:216 -> 14
    • 新增 helper
      • _draw_text_content_editor13 行)
      • _draw_text_font_size_editor18 行)
      • _draw_text_color_editor11 行)
      • _sync_text_or_button_color10 行)
      • _apply_button_layout_color12 行)
      • _apply_text_color3 行)
      • _draw_button_texture_controls19 行)
      • _draw_button_texture_pick_button22 行)
      • _apply_button_texture_variant28 行)
      • _unpack_button_atlas_result9 行)
      • _apply_button_custom_textures11 行)
      • _fit_button_to_default_texture_size22 行)
      • _clear_button_custom_textures13 行)
      • _draw_button_texture_path_labels7 行)
    • 保持目标:文本/按钮编辑行为与贴图切换语义保持一致

N. LUI 层级编辑父子关系拆分完成(第四轮)

  • ui/LUI/lui_manager_editor.py::_set_parent_child_relationship 第四轮拆分完成:
    • 主函数行数:234 -> 43
    • 新增 helper
      • _is_valid_relationship_index5 行)
      • _prepare_parent_child_link8 行)
      • _remove_child_from_old_parent8 行)
      • _attach_child_to_new_parent6 行)
      • _compute_new_child_local_position7 行)
      • _resolve_parent_visual_object10 行)
      • _set_child_visual_parent_policy12 行)
      • _clamp_child_local_within_parent27 行)
      • _sync_child_canvas_index_with_parent7 行)
      • _apply_child_absolute_position10 行)
      • _ensure_child_visibility_and_layer19 行)
      • _ensure_button_child_visibility15 行)
      • _ensure_frame_child_visibility9 行)
      • _ensure_media_child_visibility13 行)
      • _ensure_child_sprite_visibility_and_layer24 行)
      • _finalize_parent_child_link9 行)
    • 保持目标:逻辑父子关系/可见层级/画布索引同步语义保持一致

O. LUI 布局变换属性段拆分完成(第四轮)

  • ui/LUI/lui_function_properties.py::_draw_layout_transform_properties 第四轮拆分完成:
    • 主函数行数:200 -> 10
    • 新增 helper
      • _draw_fill_layout_controls37 行)
      • _draw_position_controls18 行)
      • _draw_size_controls17 行)
      • _draw_width_control23 行)
      • _draw_height_control19 行)
      • _post_size_control_sync9 行)
      • _draw_layout_group_controls53 行)
      • _draw_z_offset_controls27 行)
    • 保持目标:填充模式/尺寸联动/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