This commit is contained in:
Jeffreytsai1004 2025-02-05 23:03:56 +08:00
parent d9a76da9cf
commit eea26bcc87
5 changed files with 42 additions and 16 deletions

View File

@ -21,7 +21,10 @@ from scripts.config import data
QtCore, QtGui, QtWidgets = data.Qt() QtCore, QtGui, QtWidgets = data.Qt()
#===================================== 2. Global Variables ===================================== #===================================== 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_NAME = data.TOOL_NAME
TOOL_VERSION = data.TOOL_VERSION TOOL_VERSION = data.TOOL_VERSION
TOOL_AUTHOR = data.TOOL_AUTHOR TOOL_AUTHOR = data.TOOL_AUTHOR

View File

@ -10,23 +10,23 @@
本项目是一个Maya插件主要功能是提供与MetaHuman相同拓扑的模型或者自定义的3d模型以来完成自定义绑定编辑DNA校准骨骼位置保存DNA载入DNA导出fbx保存DNA文件, 编辑BlendShape,等功能。 本项目是一个Maya插件主要功能是提供与MetaHuman相同拓扑的模型或者自定义的3d模型以来完成自定义绑定编辑DNA校准骨骼位置保存DNA载入DNA导出fbx保存DNA文件, 编辑BlendShape,等功能。
## 这个插件主要功能: ## 这个插件主要功能
提供与MetaHuman相同拓扑的模型或者自定义的3d模型以来完成自定义绑定编辑DNA校准骨骼位置保存DNA载入DNA导出fbx保存DNA文件, 编辑BlendShape,等功能。 提供与MetaHuman相同拓扑的模型或者自定义的3d模型以来完成自定义绑定编辑DNA校准骨骼位置保存DNA载入DNA导出fbx保存DNA文件, 编辑BlendShape,等功能。
## 注意Reference路径不参与参见功能实现只作为参考。Reference只作为参考可以从中拷贝必要的文件到当前项目中 ## 注意Reference路径不参与参见功能实现只作为参考。Reference只作为参考可以从中拷贝必要的文件到当前项目中
## 代码实现: ## 代码实现
根据Maya和Python版本来获取plugin的路径并尽可能使用PySide编写UI要保证PySide的通用性使用单独的ccs文件来定义定义样式。 根据Maya和Python版本来获取plugin的路径并尽可能使用PySide编写UI要保证PySide的通用性使用单独的ccs文件来定义定义样式。
根据Maya不同的版本来定义PySide的UI定义版本通用性参考MSLiveLink。 根据Maya不同的版本来定义PySide的UI定义版本通用性参考MSLiveLink。
## 参考代码: ## 参考代码
DNA_Calibration中主要参考DNA编辑等功能更SuperRigigng主要参考UI样式并获取对应的功能的实现逻辑MSLiveLink主要参开DNA编辑和文件处理方式。 DNA_Calibration中主要参考DNA编辑等功能更SuperRigigng主要参考UI样式并获取对应的功能的实现逻辑MSLiveLink主要参开DNA编辑和文件处理方式。
## 产品功能对标: ## 产品功能对标
DNA Calibration Document : https://epicgames.github.io/MetaHuman-DNA-Calibration/index.html DNA Calibration Document : https://epicgames.github.io/MetaHuman-DNA-Calibration/index.html
@ -36,8 +36,9 @@
AnimCraft:https://geekdaxue.co/read/animcraft@cn/ AnimCraft:https://geekdaxue.co/read/animcraft@cn/
## 代码基本结构: ## 代码基本结构
```
. .
├── dnacalib\ ├── dnacalib\
│ ├── CMakeModulesExtra\ │ ├── CMakeModulesExtra\
@ -199,4 +200,4 @@
├── Install.mel 拖入maya安装文件 ├── Install.mel 拖入maya安装文件
├── Install.py 安装执行文件 ├── Install.py 安装执行文件
├── CleanPycache.bat ├── CleanPycache.bat
```

View File

@ -36,8 +36,6 @@ BUILDER_PATH = data.BUILDER_PATH
UI_PATH = data.UI_PATH UI_PATH = data.UI_PATH
UTILS_PATH = data.UTILS_PATH UTILS_PATH = data.UTILS_PATH
main_window = None main_window = None
class ModelTab(QtWidgets.QWidget): class ModelTab(QtWidgets.QWidget):

View File

@ -12,25 +12,49 @@ import maya.cmds as cmds
def Qt(): def Qt():
try: try:
from PySide import QtCore, QtGui, QtWidgets from PySide import QtCore, QtGui, QtWidgets
print("加载PySide")
return QtCore, QtGui, QtWidgets return QtCore, QtGui, QtWidgets
except ImportError as e: except ImportError as e:
print(f"PySide加载失败: {str(e)}")
try: try:
from PySide2 import QtCore, QtGui, QtWidgets from PySide2 import QtCore, QtGui, QtWidgets
QtWidgets = QtGui QtWidgets = QtGui
print("加载PySide2")
return QtCore, QtGui, QtWidgets return QtCore, QtGui, QtWidgets
except ImportError as e: except ImportError as e:
cmds.warning(f"PySide2加载失败: {str(e)}")
try: try:
from PySide6 import QtCore, QtGui, QtWidgets from PySide6 import QtCore, QtGui, QtWidgets
print("加载PySide6")
return QtCore, QtGui, QtWidgets return QtCore, QtGui, QtWidgets
except ImportError as e: except ImportError as e:
cmds.warning(f"PySide6加载失败: {str(e)}")
return None, None, None return None, None, None
QtCore, QtGui, QtWidgets = Qt() 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加载失败")

2
ui.md
View File

@ -138,7 +138,7 @@
#### 按钮, 生成面部配件 resources\icons\supplement_meshes.png #### 按钮, 生成面部配件 resources\icons\supplement_meshes.png
#### 按钮, 修复法线 resources\icons\repair_normals.png #### 按钮, 修复法线 resources\icons\repair_normals.png
#### 按钮, 修复点序 resources\icons\repair_vertex_order.png #### 按钮, 修复点序 resources\icons\repair_vertex_order.png
#### 按钮, 修复接缝 polyChipOff.png #### 按钮, 修复接缝 resources\icons\polyChipOff.png
## 绑定 ## 绑定