From eea26bcc872ab946c78463d7e1ed22ebe3fe87ed Mon Sep 17 00:00:00 2001 From: Jeffreytsai1004 Date: Wed, 5 Feb 2025 23:03:56 +0800 Subject: [PATCH] Update --- Install.py | 5 ++++- goals.md | 13 +++++++------ scripts/MetaFusion.py | 2 -- scripts/ui/Qt.py | 36 ++++++++++++++++++++++++++++++------ ui.md | 2 +- 5 files changed, 42 insertions(+), 16 deletions(-) diff --git a/Install.py b/Install.py index 99b957e..fe0367b 100644 --- a/Install.py +++ b/Install.py @@ -21,7 +21,10 @@ from scripts.config import data QtCore, QtGui, QtWidgets = data.Qt() #===================================== 2. Global Variables ===================================== -ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) +try: + ROOT_PATH = data.ROOT_PATH +except NameError: + ROOT_PATH = os.path.abspath(os.path.dirname(__file__)).replace("\\", "/") TOOL_NAME = data.TOOL_NAME TOOL_VERSION = data.TOOL_VERSION TOOL_AUTHOR = data.TOOL_AUTHOR diff --git a/goals.md b/goals.md index 3c33bf0..f95849c 100644 --- a/goals.md +++ b/goals.md @@ -10,23 +10,23 @@ 本项目是一个Maya插件,主要功能是提供与MetaHuman相同拓扑的模型或者自定义的3d模型以来完成自定义绑定,编辑DNA,校准骨骼位置,保存DNA,载入DNA,导出fbx,保存DNA文件, 编辑BlendShape,等功能。 -## 这个插件主要功能: +## 这个插件主要功能 提供与MetaHuman相同拓扑的模型或者自定义的3d模型以来完成自定义绑定,编辑DNA,校准骨骼位置,保存DNA,载入DNA,导出fbx,保存DNA文件, 编辑BlendShape,等功能。 ## 注意Reference路径不参与参见功能实现,只作为参考。Reference只作为参考,可以从中拷贝必要的文件到当前项目中 -## 代码实现: +## 代码实现 根据Maya和Python版本来获取plugin的路径,并尽可能使用PySide编写UI,要保证PySide的通用性,使用单独的ccs文件来定义定义样式。 根据Maya不同的版本来定义PySide的UI定义,版本通用性参考MSLiveLink。 -## 参考代码: +## 参考代码 DNA_Calibration中主要参考DNA编辑等功能更,SuperRigigng主要参考UI样式并获取对应的功能的实现逻辑,MSLiveLink主要参开DNA编辑和文件处理方式。 -## 产品功能对标: +## 产品功能对标 DNA Calibration Document : https://epicgames.github.io/MetaHuman-DNA-Calibration/index.html @@ -36,8 +36,9 @@ AnimCraft:https://geekdaxue.co/read/animcraft@cn/ -## 代码基本结构: +## 代码基本结构 +``` . ├── dnacalib\ │ ├── CMakeModulesExtra\ @@ -199,4 +200,4 @@ ├── Install.mel 拖入maya安装文件 ├── Install.py 安装执行文件 ├── CleanPycache.bat - +``` \ No newline at end of file diff --git a/scripts/MetaFusion.py b/scripts/MetaFusion.py index 29923cb..48df25f 100644 --- a/scripts/MetaFusion.py +++ b/scripts/MetaFusion.py @@ -36,8 +36,6 @@ BUILDER_PATH = data.BUILDER_PATH UI_PATH = data.UI_PATH UTILS_PATH = data.UTILS_PATH - - main_window = None class ModelTab(QtWidgets.QWidget): diff --git a/scripts/ui/Qt.py b/scripts/ui/Qt.py index 5650466..0f9d1c9 100644 --- a/scripts/ui/Qt.py +++ b/scripts/ui/Qt.py @@ -12,25 +12,49 @@ import maya.cmds as cmds def Qt(): try: from PySide import QtCore, QtGui, QtWidgets - print("加载PySide") return QtCore, QtGui, QtWidgets except ImportError as e: - print(f"PySide加载失败: {str(e)}") try: from PySide2 import QtCore, QtGui, QtWidgets QtWidgets = QtGui - print("加载PySide2") return QtCore, QtGui, QtWidgets except ImportError as e: - cmds.warning(f"PySide2加载失败: {str(e)}") try: from PySide6 import QtCore, QtGui, QtWidgets - print("加载PySide6") return QtCore, QtGui, QtWidgets except ImportError as e: - cmds.warning(f"PySide6加载失败: {str(e)}") return None, None, None QtCore, QtGui, QtWidgets = Qt() +if QtCore is None: + cmds.warning("QtCore加载失败") +if QtGui is None: + cmds.warning("QtGui加载失败") +if QtWidgets is None: + cmds.warning("QtWidgets加载失败") +def get_wrapInstance(): + try: + from shiboken import wrapInstance + print("从shiboken加载wrapInstance") + return wrapInstance + except ImportError as e: + cmds.warning(f"shiboken加载失败: {str(e)}") + try: + from shiboken2 import wrapInstance + print("从shiboken2加载wrapInstance") + return wrapInstance + except ImportError as e: + cmds.warning(f"shiboken2加载失败: {str(e)}") + try: + from shiboken6 import wrapInstance + print("从shiboken6加载wrapInstance") + return wrapInstance + except ImportError as e: + cmds.warning(f"shiboken6加载失败: {str(e)}") + return None + +wrapInstance = get_wrapInstance() +if wrapInstance is None: + cmds.warning("wrapInstance加载失败") diff --git a/ui.md b/ui.md index 45dd057..b2e6582 100644 --- a/ui.md +++ b/ui.md @@ -138,7 +138,7 @@ #### 按钮, 生成面部配件 resources\icons\supplement_meshes.png #### 按钮, 修复法线 resources\icons\repair_normals.png #### 按钮, 修复点序 resources\icons\repair_vertex_order.png -#### 按钮, 修复接缝 polyChipOff.png +#### 按钮, 修复接缝 resources\icons\polyChipOff.png ## 绑定