This commit is contained in:
2025-11-24 22:26:56 +08:00
parent e4c713035b
commit 719058ff01
8 changed files with 310 additions and 33 deletions

View File

@@ -25,20 +25,42 @@ Studio Library 2.20.2
## 使用方法
### 在 Python 中启动
### 方式 1使用 launcher推荐
```python
from animation_tools.studiolibrary import launcher
launcher.LaunchStudioLibrary()
```
### 方式 2直接导入
```python
# 需要先添加路径到 sys.path
import sys
import os
studiolibrary_path = r'h:\Workspace\Raw\Tools\Plugins\Maya\2023\scripts\animation_tools\studiolibrary'
if studiolibrary_path not in sys.path:
sys.path.insert(0, studiolibrary_path)
# 然后导入并启动
import studiolibrary
studiolibrary.main()
```
### 方式 3从 animation_tools 导入
```python
# 如果 animation_tools 已在 PYTHONPATH 中
from animation_tools import studiolibrary
studiolibrary.main()
```
### 在 MEL 中启动
```mel
python("from animation_tools.studiolibrary import launcher; launcher.LaunchStudioLibrary()");
```
### 从工具架启动
点击动画工具架上的 **StudioLib** 按钮即可启动。
@@ -62,9 +84,15 @@ studiolibrary.main()
## 🔧 版本兼容性
### 支持的 Maya 版本
- **Maya 2017+** - 支持所有现代版本的 Maya
- **Maya 2017-2024** - 使用 PySide2
- **Maya 2025+** - 使用 PySide6
- **自动适配** - 运行时自动检测 Maya 环境和 Qt 版本
### Maya 2025 特别说明
- ✅ 已创建外层 `__init__.py` 文件,解决模块导入问题
- ✅ 自动检测并使用 PySide6
- ✅ 完全兼容新版本的 Python 3.11
### Qt 兼容性
Studio Library 使用 `Qt.py` 兼容层,支持多种 Qt 绑定:
- **PySide6** - Maya 2025+ (优先)