EG/CLAUDE.md
2025-09-15 10:03:47 +08:00

112 lines
3.2 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.

# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## 项目概述
这是一个基于Panda3D的3D渲染引擎和场景编辑器集成了PyQt5界面和多种高级功能
- 3D场景编辑器模型导入、材质系统、碰撞检测
- GUI元素管理2D/3D GUI组件
- 项目管理系统(场景保存/加载、项目打包)
- Cesium地图集成
- 渲染管线增强RenderPipelineFile
## 运行和构建命令
### 启动应用程序
```bash
python Start_Run.py [project_path]
```
或者直接:
```bash
python main.py
```
### 依赖安装
```bash
# 主要依赖
pip install -r requirements/requirements.txt
# Conda环境依赖
pip install -r requirements/conda-requirements.txt
```
### 工具脚本
```bash
# 安装FBX到GLTF转换工具
./install_fbx2gltf.sh
```
## 核心架构
### 主要模块结构
```
EG/
├── main.py # 应用程序入口点
├── Start_Run.py # 启动脚本(路径配置)
├── core/ # 核心功能模块
│ ├── world.py # 3D世界核心继承Panda3DWorld
│ ├── scene_manager.py # 场景和模型管理
│ ├── selection.py # 对象选择系统
│ ├── event_handler.py # 事件处理
│ └── tool_manager.py # 工具系统
├── gui/ # GUI元素管理
│ └── gui_manager.py # 2D/3D GUI组件
├── ui/ # 用户界面
│ ├── widgets.py # 自定义Qt组件
│ ├── property_panel.py # 属性面板
│ └── interface_manager.py # 界面管理
├── scene/ # 场景相关
│ └── scene_manager.py # 场景管理器
├── project/ # 项目管理
│ └── project_manager.py # 项目生命周期
├── RenderPipelineFile/ # 渲染管线扩展
└── QPanda3D/ # Panda3D Qt集成
```
### 核心设计模式
1. **模块化架构**: 每个功能模块独立,通过管理器类协调
2. **事件驱动**: EventHandler统一处理用户交互和系统事件
3. **组件系统**: SelectionSystem、ToolManager等可插拔组件
4. **MVC分离**: UI组件、核心逻辑和数据管理分离
### 主要依赖集成
- **Panda3D 1.10.15**: 3D渲染引擎
- **PyQt5**: GUI框架
- **QPanda3D**: Panda3D的Qt集成
- **RenderPipeline**: 高级渲染功能
## 开发指南
### 添加新功能模块
1. 在对应目录下创建新的Python文件
2. 继承相应的基类如Panda3DWorld用于3D功能
3. 在main.py中集成新模块
4. 更新界面管理器以添加UI控制
### 材质和渲染
- 材质系统集成在scene/scene_manager.py
- 支持PBR材质和自定义着色器
- RenderPipelineFile提供高级渲染特性
### GUI开发
- 使用PyQt5构建主界面
- 3D GUI元素通过gui/gui_manager.py管理
- 自定义组件在ui/widgets.py中定义
## 文件约定
- Python文件使用UTF-8编码
- 中文注释和文档字符串
- 模块顶部包含功能描述注释
- 类和方法使用描述性命名
## 注意事项
- 项目依赖多个大型库Panda3D、PyQt5、RenderPipeline
- Cesium集成需要WebEngine支持
- 某些功能可能需要特定的系统配置