Update
This commit is contained in:
54
2023/scripts/animation_tools/studiolibrary/launcher.py
Normal file
54
2023/scripts/animation_tools/studiolibrary/launcher.py
Normal file
@@ -0,0 +1,54 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
Studio Library Launcher
|
||||
用于从工具架快速启动 Studio Library
|
||||
支持所有 Maya 版本
|
||||
"""
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
|
||||
def LaunchStudioLibrary():
|
||||
"""
|
||||
启动 Studio Library 主界面
|
||||
自动检测 Maya 版本和 Qt 绑定
|
||||
"""
|
||||
try:
|
||||
# 获取 Studio Library 路径
|
||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
# 确保路径在 sys.path 中
|
||||
if current_dir not in sys.path:
|
||||
sys.path.insert(0, current_dir)
|
||||
|
||||
# 导入并启动 Studio Library
|
||||
import studiolibrary
|
||||
|
||||
# 打印版本信息
|
||||
print(f"Studio Library version: {studiolibrary.version()}")
|
||||
|
||||
# 检测 Maya 环境
|
||||
if studiolibrary.isMaya():
|
||||
print("Running in Maya environment")
|
||||
else:
|
||||
print("Running in standalone mode")
|
||||
|
||||
# 启动主窗口
|
||||
window = studiolibrary.main()
|
||||
|
||||
print("Studio Library launched successfully")
|
||||
|
||||
return window
|
||||
|
||||
except Exception as e:
|
||||
print(f"Failed to launch Studio Library: {e}")
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
return None
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
LaunchStudioLibrary()
|
||||
Reference in New Issue
Block a user