Files
MetaFusion/.windsurfrules
2025-05-11 11:36:16 +08:00

204 lines
13 KiB
Plaintext
Raw Permalink 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.

# WindSurf Rules
## Global rules
- Comprehensive search: All questions must first retrieve all relevant documents in the project folder to obtain context.
- Web search: After retrieving local files, a web search must be conducted to obtain more information and the latest data.
- Use context7 as much as possible to reduce tokens
## MCP usage rules
Use the following MCP model context protocol to enhance responses:
1. markitdown mcp
- Purpose: Convert PDF files to Markdown format.
- Trigger conditions: Used when the user query contains information in the PDF file, or needs to convert the PDF content to a more readable format.
2. sequential-thinking mcp
- Purpose: Break down complex problems into smaller, more manageable parts, and reason step by step to ensure the logic and coherence of the answer.
- Trigger: Used when the user asks a question that requires multiple steps or relies on logical reasoning. This helps provide a clearer and more organized response.
## Dialogue rules
- Always respond in 中文 in Cascade chat an composer dialogue bar
## Code rules
- Code are always in English
- Comments are always in English
- Check code errors and correct them after each code update
- Check plugin integrity and optimize update development plans and next suggestions for each update
- The Reference path does not participate in the implementation of the reference function, but is only used as a reference. The Reference path is only used as a reference, and the necessary files can be copied from it to the current project
- The code must be compatible with Maya2022, Maya2023, Maya2024, Maya2025
- The code must be compatible with Python3.10, Python3.11, Python3.12
- All codes must be encoded in UTF-8
- All modules must be preceded by
```.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
```
## Code write steps rules
- Read https://github.com/EpicGames/MetaHuman-DNA-Calibration, to understand the code examples and basic rules of Metahuman DNA calibration, use context7;
- Read https://epicgames.github.io/MetaHuman-DNA-Calibration/index.html, to understand the code examples and basic rules of Metahuman DNA calibration, use context7;
- Read Readme.md to understand the plugin goals
- Read the code and examples in the Reference path
- The UI style must be implemented in a unified style file
- All UIs must be implemented using Qtscripts\Qt.py
- After each function is implemented, the document must be updated
## Project rules
### UI Styles
- Flat design style
- It should have a sense of luxury and sci-fi futurism
- Rounded corner design
- Chinese should be clear and elegant
- English should be concise and clear
- Colors should be uniform
- Fonts should be uniform
- Font size should be uniform
- Buttons should be uniform
- Input boxes should be uniform
- Labels should be uniform
### Project Goal
Make a Metahuman custom plugin for Maya, language: Python-based, Maya version: 2022, 2023, 2024, 2025
### Project Description
- This project is a Maya plugin, the main function is to provide a model with the same topology as MetaHuman or a custom 3D model to complete custom binding, edit DNA, calibrate bone position, save DNA, load DNA, export fbx, save DNA file, edit BlendShape, and other functions.
### Project Functions
- Provide a model with the same topology as MetaHuman or a custom 3D model to complete custom binding, edit DNA, calibrate bone position, save DNA, load DNA, export fbx, save DNA file, edit BlendShape, and other functions.
### Code structure
MetaHumanDNAPlugin/
├── Install.py # 安装脚本
├── config.py # 配置文件
├── Readme.md # 项目说明文档
├── Plan.md # 开发计划文档
├── scripts/ # 脚本目录
│ ├── Main.py # 主入口文件
│ ├── ReloadModules.py # 模块重载
│ │
│ ├── ui/ # UI模块目录
│ │ ├── Qt.py # Qt兼容模块
│ │ ├── style.qss # 统一样式文件
│ │ ├── ui_utils.py # UI通用功能
│ │ ├── geometry.py # 几何体UI
│ │ ├── rigging.py # 绑定UI
│ │ ├── behavior.py # 行为面板UI
│ │ └── definition.py # 定义面板UI
│ │
│ ├── utils/ # 工具函数目录
│ │ ├── utils_geometry.py # 几何体功能模块
│ │ ├── utils_rigging.py # 绑定功能模块
│ │ ├── utils_behaviour.py # 行为面板功能模块
│ │ └── utils_definition.py # 定义面板功能模块
│ │
├── Reference/ # 参考资料目录
├── DNA_Calibration/ # Epic官方DNA校准工具参考
├── MSLiveLink/ # MetaHuman LiveLink参考
├── SuperRigging/ # SuperRigging插件参考
│ ├── files/ # SuperRigging文件
│ ├── meta_anim/ # 动画相关参考
│ ├── meta_body_ctrl/ # 身体控制器参考
│ └── meta_motion_apply/ # 动作应用参考
├── SuperRiggingEditor/ # SuperRigging编辑器参考
├── Utils/ # 工具函数参考
└── UI/ # UI设计参考图
### TARGET FUNCTIONS
#### 1.1.1. Minimalist binding process
- One-button installation, one-button standardized model, one-button binding, one-button output FBX, use context7;
- https://pointart.oss-cn-hangzhou.aliyuncs.com/wp-content/uploads/2024/05/cut_1.mp4, use context7;
- Through our project experience and technical accumulation, we can shorten the technical process to the maximum, without complicated configuration process, and the technology is automatic and one-click processing, so that your energy can focus more on role modeling, expression and performance.
#### 1.1.2. Quickly adjust the expression
- The expression range is adjusted in batches, and the expression is quickly mirrored, use context7;
- https://pointart.oss-cn-hangzhou.aliyuncs.com/wp-content/uploads/2024/06/%E5%BF%AB%E9%80%9F%E8%B0%83%E6%95%B4.mp4, use context7;
- If the volume of some parts of your character (eyes/mouth/chin) is different from that of the standard Metahuman, you need to adjust the expression range of this area in batches to adapt to the correct expression, and you may need to adjust it one by one in the traditional process.
Now you can select these expressions in batches, and adjust the range with one button to quickly mirror the expressions, which will help you achieve the required facial expression quality faster and better.
#### 1.1.3. External expression import
- Support other expressions made by DCC to be imported into this role, use context7;
- https://pointart.oss-cn-hangzhou.aliyuncs.com/wp-content/uploads/2024/06/%E5%A4%96%E9%83%A8%E8%A1%A8%E6%83%85%E5%AF%BC%E5%85%A5.mp4, use context7;
- In the actual production process, expressions need to be carved with Zbrush or other software, or many people collaborate. We support exporting and carving some expressions in the form of model files, and then importing them into the role after carving is completed, which solves the problem of collaboration in the expression production process, and all this can be achieved without you studying the underlying expression architecture of Metahuman, just by exporting and importing with one key.
#### 1.1.4. Create a template preset
- One-click creation for the current role is a template preset, and similar roles can be quickly bound without repeated work! use context7;
- https://pointart.oss-cn-hangzhou.aliyuncs.com/wp-content/uploads/2024/06/%E5%88%9B%E5%BB%BA%E6%A8%A1%E6%9D%BF%E9%A2%84%E8%AE%BE.mp4, use context7;
- In the production process, we will encounter a batch of characters with similar faces, but if each one needs to be rebound and repaired, the workload of repetition is huge, so we support converting the current character into a template with one click, and similar characters can be directly and perfectly bound with one click.
Can also be used for your binding file needs to fine-tune the face, change the body posture and other needs, first create the role as a template, and then re-bind, saving work.
#### 1.1.5. Automatic role correction
- Automatic correction of joint axis-&Pose of role, use context7;
- https://pointart.oss-cn-hangzhou.aliyuncs.com/wp-content/uploads/2024/06/%E8%87%AA%E5%8A%A8%E6%A0%A1%E6%AD%A3%E8%A7%92%E8%89%B2.mp4, use context7;
- The role pose has different effects on the action capture and body modification of Metahuman. According to our experience, the role needs to fully conform to the pose of Metahuman, which can achieve higher data quality of dynamic capture and the correctness of finger axis.
We support one-click to correct the pose of the character to the correct pose, and set the axial direction of the joint correctly.
#### 1.1.6. Facial controller
- Face and panel controllers can be seamlessly switched, use context7;
- https://pointart.oss-cn-hangzhou.aliyuncs.com/wp-content/uploads/2024/06/%E9%9D%A2%E9%83%A8%E6%8E%A7%E5%88%B6%E5%99%A8.mp4, use context7;
- Aiming at the problem that Metahuman face control panel is not intuitive, we support the generation of a brand-new face controller, which can directly adjust the expression and muscles of the character on the face. If you contact Metahuman controller soon, it will greatly reduce your learning cost.
#### 1.1.7. Different topological binding
- Arbitrary model, without changing topology and UV, one-click binding, use context7;
- https://pointart.oss-cn-hangzhou.aliyuncs.com/wp-content/uploads/2024/06/%E4%BB%BB%E6%84%8F%E6%8B%93%E6%89%91%E4%B8%80%E9%94%AE%E7%BB%91%E5%AE%9A.mp4, use context7;
- In the asset production process of most companies, the model is a set of fixed topological structure. If you want to bind it into Metahuman, the traditional process needs to be wrapped, and changing the topological structure also needs to change UV and Wrap. This link is easy to cause asset migration problems (model deformation, inaccurate topology, unable to Wrap the mapping format, UV layout does not meet asset characteristics and many other problems).
#### 1.1.8. Adapting UE specification
- The animation assets of UE, Animator and hair & clothing can be used seamlessly, use context7;
- https://pointart.oss-cn-hangzhou.aliyuncs.com/wp-content/uploads/2024/06/%E5%AE%8C%E7%BE%8E%E9%80%82%E9%85%8DUE%E8%A7%84%E8%8C%83.mp4, use context7;
- Using the official code as the underlying framework, it is perfectly compatible with UE, and can seamlessly use all kinds of assets created by UE for Metahuman, so that your role can perform easily or perfectly.
## Reference
### Code reference (do not modify)
├── Reference/ # 参考资料目录 (不要修改)
├── DNA_Calibration/ # Epic官方DNA校准工具参考
├── MSLiveLink/ # MetaHuman LiveLink参考
├── SuperRigging/ # SuperRigging插件参考
│ ├── files/ # SuperRigging文件
│ ├── meta_anim/ # 动画相关参考
│ ├── meta_body_ctrl/ # 身体控制器参考
│ └── meta_motion_apply/ # 动作应用参考
├── SuperRiggingEditor/ # SuperRigging编辑器参考
├── Utils/ # 工具函数参考
└── UI/ # UI设计参考图
### Doc reference Do not modify
- [DNA_Calibration在线文档](https://epicgames.github.io/MetaHuman-DNA-Calibration), use context7;
- [MetaHuman DNA Calibration White Paper](https://cdn2.unrealengine.com/rig-logic-whitepaper-v2-zhcn-5860d80f8357.pdf), use context7;
- [MetaHuman DNA Calibration Code](https://github.com/EpicGames/MetaHuman-DNA-Calibration), use context7;
- [MetaHuman DNA Calibration Documents](https://github.com/EpicGames/MetaHuman-DNA-Calibration/tree/main/docs), use context7;
- [MetaHuman DNA Calibration Tools](https://dev.epicgames.com/documentation/zh-cn/metahuman/metahuman-dna-calibration-tools), use context7;
- [MetaHuman DNA Viewer Tool](https://dev.epicgames.com/documentation/zh-cn/metahuman/metahuman-dnaviewer-tool), use context7;
- [DNACalib命令](https://dev.epicgames.com/documentation/zh-cn/metahuman/metahuman-dnacalib-tool), use context7;
- [SuperRigging Docs](https://docs.pointart.net/), use context7;
- [Metapipe Originsdocs](https://www.artsandspells.com/originsdocs), use context7;
- [Metapipe Nitrous](https://www.artsandspells.com/nitrous), use context7;
- [Metapipe Genetics](https://www.artsandspells.com/genetics), use context7;
- [Metapipe Synapses](https://www.artsandspells.com/synapses), use context7;
- [FACS面部表情编码系统](https://www.artsandspells.com/synapses), use context7;
- [MetaHuman 实时环境面部装配逻辑](https://zhuanlan.zhihu.com/p/511001493), use context7;
- [MetaHuman Principle](https://zhuanlan.zhihu.com/p/673471863), use context7;
- [Metahuman 蒙皮、骨骼、驱动](https://blog.csdn.net/qq_28976599/article/details/130849821), use context7;
- [MetaHuman DNA Calibration Deep Dive](https://dev.epicgames.com/community/learning/tutorials/EoPj/metahuman-dna-calibration-deep-dive), use context7;