This commit is contained in:
Jeffrey 2025-05-16 14:01:01 +08:00
parent 9985b73dc1
commit 1e3a2f6379
8 changed files with 280 additions and 245 deletions

View File

@ -12,33 +12,37 @@ import maya.mel as mel
import maya.cmds as cmds
import maya.OpenMayaUI as omui
from Scripts.Qt import QtWidgets, QtCore, QtGui
from Scripts.Qt.QtCompat import wrapInstance
from Scripts import config
# Qt imports
try:
from PySide2 import QtWidgets, QtCore, QtGui
from shiboken2 import wrapInstance
except:
from PySide6 import QtWidgets, QtCore, QtGui
from shiboken6 import wrapInstance
# try:
# from PySide2 import QtWidgets, QtCore, QtGui
# from shiboken2 import wrapInstance
# except:
# from PySide6 import QtWidgets, QtCore, QtGui
# from shiboken6 import wrapInstance
#===================================== 2. Global Variables =====================================
# Path configurations
try:
ROOT_PATH = os.path.dirname(INSTALL_PATH)
except NameError:
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
ROOT_PATH = config.ROOT_PATH
# Tool information
TOOL_NAME = "MetaBox"
TOOL_VERSION = "Beta v1.0.0"
TOOL_AUTHOR = "CGNICO"
TOOL_LANG = 'en_US'
SCRIPTS_PATH = os.path.join(ROOT_PATH, "Scripts")
ICONS_PATH = os.path.join(ROOT_PATH, "icons")
TOOL_ICON = os.path.join(ICONS_PATH, "mtblogo.png")
DEFAULT_ICON = "commandButton.png"
TOOL_HELP_URL = "http://10.72.61.59:3000/ArtGroup/{}/wiki".format(TOOL_NAME)
TOOL_WSCL_NAME = "ToolBoxWorkSpaceControl"
MOD_FILE_NAME = "{}.mod".format(TOOL_NAME)
MAIN_SCRIPT_NAME = "{}.py".format(TOOL_NAME)
TOOL_NAME = config.TOOL_NAME
TOOL_VERSION = config.TOOL_VERSION
TOOL_AUTHOR = config.TOOL_AUTHOR
TOOL_LANG = config.TOOL_LANG
SCRIPTS_PATH = config.SCRIPTS_PATH
ICONS_PATH = config.ICONS_PATH
TOOL_ICON = config.TOOL_ICON
DEFAULT_ICON = config.DEFAULT_ICON
TOOL_HELP_URL = config.TOOL_HELP_URL
TOOL_WSCL_NAME = config.TOOL_WSCL_NAME
MOD_FILE_NAME = config.MOD_FILE_NAME
MAIN_SCRIPT_NAME = config.MAIN_SCRIPT_NAME
# UI Style configurations
BUTTON_STYLE = """

View File

@ -2,8 +2,8 @@
# -*- coding: utf-8 -*-
#===================================== IMPORT MODULES =====================================
from Qt import QtWidgets, QtCore, QtGui
from Qt.QtCompat import wrapInstance
from Scripts.Qt import QtWidgets, QtCore, QtGui
from Scripts.Qt.QtCompat import wrapInstance
from maya import OpenMayaUI as omui
import maya.cmds as cmds
import maya.mel as mel
@ -14,6 +14,7 @@ import webbrowser
import locale
import sys
import os, subprocess
from Scripts import config
from TaskReporter import task_reporter_decorator
#===================================== IMPORT FUNCTIONS ===================================
@ -29,27 +30,28 @@ from Metahuman.Custom import BodyPrep
from Animation.Blendshape import MorphShape
from Animation import UniversalRigAdapter
from Dev import mayaiconview
from Scripts import localization
# #importlib.reload(CreasePlus)
# #importlib.reload(gs_curvetools)
#===================================== VARIABLES =====================================
debug_mode = False
TOOL_PATH = os.path.dirname(os.path.abspath(__file__)).replace("\\", "/")
TOOL_PATH = config.TOOL_PATH
TOOL_NAME = config.TOOL_NAME
TOOL_VERSION = config.TOOL_VERSION
TOOL_AUTHOR = config.TOOL_AUTHOR
TOOL_LANG = config.TOOL_LANG
SCRIPTS_PATH = config.SCRIPTS_PATH
ICONS_PATH = config.ICONS_PATH
TOOL_ICON = config.TOOL_ICON
DEFAULT_ICON = config.DEFAULT_ICON
TOOL_HELP_URL = config.TOOL_HELP_URL
TOOL_WSCL_NAME = config.TOOL_WSCL_NAME
MOD_FILE_NAME = config.MOD_FILE_NAME
MAIN_SCRIPT_NAME = config.MAIN_SCRIPT_NAME
LDMT_PATH = config.LDMT_PATH
sys.path.append(TOOL_PATH)
TOOL_NAME = "MetaBox"
TOOL_VERSION = "Beta v1.0.0"
TOOL_AUTHOR = "CGNICO"
TOOL_LANG = 'en_US'
SCRIPTS_PATH = os.path.join(TOOL_PATH, "Scripts").replace("\\", "/")
ICONS_PATH = os.path.join(os.path.dirname(TOOL_PATH), "icons").replace("\\", "/")
TOOL_ICON = os.path.join(ICONS_PATH, "mtblogo.png").replace("\\", "/")
DEFAULT_ICON = "commandButton.png"
TOOL_HELP_URL = "http://10.72.61.59:3000/ArtGroup/{TOOL_NAME}/wiki".format(TOOL_NAME=TOOL_NAME)
TOOL_WSCL_NAME = "ToolBoxWorkSpaceControl"
MOD_FILE_NAME = "{TOOL_NAME}.mod".format(TOOL_NAME=TOOL_NAME)
MAIN_SCRIPT_NAME = "{TOOL_NAME}.py".format(TOOL_NAME=TOOL_NAME)
LDMT_PATH = os.path.join(TOOL_PATH, "Modeling", "Edit", "LDMT").replace("\\", "/")
#===================================== UI BUTTONS COMPONENTS =====================================
class RoundedButton(QtWidgets.QPushButton):
@ -90,216 +92,7 @@ def maya_main_window():
main_window_ptr = omui.MQtUtil.mainWindow()
return wrapInstance(int(main_window_ptr), QtWidgets.QWidget)
LANG = {
'en_US': {
"DOCUMENT": "DOCUMENT",
"Help": "Help",
"EN": "EN",
"ZH": "ZH",
"zh_CN": "zh_CN",
"Switch Language": "Switch Language",
"Modeling": "Modeling",
"Metahuman": "Metahuman",
"Rigging": "Rigging",
"Animation": "Animation",
"Display": "Display",
"Xray": "Xray",
"Joint Xray": "Joint Xray",
"Manage": "Manage",
"Rename": "Rename",
"Batch Import": "Batch Import",
"Select": "Select",
"Interval Select Edge": "Interval Select Edge",
"Same Position Selector": "Same Position Selector",
"Edge Loop Smart Select": "Edge Loop Smart Select",
"Even Edge Loop": "Even Edge Loop",
"Tools": "Tools",
"Crease Plus": "Crease Plus",
"Speed Cut": "Speed Cut",
"ModIt": "ModIt",
"PlugIt": "PlugIt",
"Zirail": "Zirail",
"Groomer`s Tool": "Groomer`s Tool",
"Edge Sensei": "Edge Sensei",
"Round Inset": "Round Inset",
"Arc Deformer": "Arc Deformer",
"Instant Drag": "Instant Drag",
"Un Bevel": "Un Bevel",
"Align Edge": "Align Edge",
"Extra Curve": "Extra Curve",
"Auto Snap": "Auto Snap",
"Xgen Controller": "Xgen Controller",
"Speed Bend": "Speed Bend",
"Hair Tools": "Hair Tools",
"GS Curve Tools": "GS Curve Tools",
"GS Curve Tools Reset": "GS Curve Tools Reset",
"GS Curve Tools Close": "GS Curve Tools Close",
"Export XGen to Groom": "Export XGen to Groom",
"Export XGen Description": "Export XGen Description",
"UV": "UV",
"UVDeluxe": "UVDeluxe",
"RizomUV Bridge": "RizomUV Bridge",
"UV Set Editor": "UV Set Editor",
"Preparation": "Preparation",
"Body Prepare": "Body Prepare",
"Setup": "Setup",
"Advanced Skeleton": "Advanced Skeleton",
"Weight Export": "Weight Export",
"Weight Import": "Weight Import",
"Unbind Skin": "Unbind Skin",
"Select": "Select",
"Anim School Picker": "Anim School Picker",
"DWPicker": "DWPicker",
"Tools": "Tools",
"bhGhost": "bhGhost",
"IK/FK Switch": "IK/FK Switch",
"aTools": "aTools",
"Keyframe Pro": "Keyframe Pro",
"Studio Library": "Studio Library",
"Pose Tools": "Pose Tools",
"Epic Pose Wrangler": "Epic Pose Wrangler",
"Morph Shape": "Morph Shape",
"Universal Rig Adapter": "Universal Rig Adapter",
"Dev": "Dev",
"Dev Tool": "Dev Tool",
"Icon Viewer": "Icon Viewer",
"Import": "Import",
"IK/FK Mocap": "IK/FK Mocap Tool",
"MotionCapHelper": "MotionCap Helper",
"SpringMagic": "Spring Magic",
"Ahoge": "Ahoge",
"QuadRemesher": "Quad Remesher",
"LDMT": "LDMT",
"Simplify": "Simplify",
'Deformer': 'Deformer',
'Instant Meshes': 'Instant Meshes',
'Topo Blendshape': 'Topo Blendshape',
'Face Transfer': 'Face Transfer',
'Cloth Transfer': 'Cloth Transfer',
'Marvelous Tool': 'Marvelous Tool',
"Morph to UV": "Morph to UV",
"Quick Export": "Quick Export",
"Check UV Bleed":"Check UV Bleed",
"Overlap UV Out":"Overlap UV Out",
"Overlap UV In":"Overlap UV In",
"Switch UV Set":"Switch UV Set",
"Debug Tools": "Debug Tools",
"Scene": "Scene",
"CleanM": "CleanM",
"Normal": "Normal",
"KeepHS": "KeepHS",
"Rename": "Rename",
"DelName": "DelName",
"Ungroup": "Ungroup",
"Reverse": "Reverse",
"XgenVis": "XgenVis",
"Task Path Builder": "TaskPathBuilder"
},
'zh_CN': {
"DOCUMENT": "说明文档",
"Help": "帮助",
"EN": "EN",
"ZH": "ZH",
"zh_CN": "zh_CN",
"Switch Language": "切换语言",
"Modeling": "建模",
"Metahuman": "Metahuman",
"Rigging": "绑定",
"Animation": "动画",
"Display": "显示",
"Xray": "X光显示",
"Joint Xray": "关节X光显示",
"Manage": "管理",
"Rename": "重命名",
"Batch Import": "批量导入",
"Select": "选择",
"Interval Select Edge": "间隔选择边",
"Same Position Selector": "相同位置物体选择器",
"Edge Loop Smart Select": "边缘循环智能选择",
"Even Edge Loop": "等边循环",
"Tools": "工具",
"Crease Plus": "Crease ++",
"Speed Cut": "快速切割",
"ModIt": "ModIt",
"PlugIt": "PlugIt",
"Zirail": "Zirail 拓扑工具",
"Groomer`s Tool": "Groomer 工具",
"Edge Sensei": "边线大师",
"Round Inset": "圆角插入",
"Arc Deformer": "弧形变形器",
"Instant Drag": "吸附放置",
"Un Bevel": "去除倒角",
"Align Edge": "对齐到边",
"Extra Curve": "提取曲线",
"Auto Snap": "自动吸附",
"Xgen Controller": "Xgen 控制器",
"Speed Bend": "快速弯曲",
"Hair Tools": "毛发工具",
"GS Curve Tools": "GS曲线工具",
"GS Curve Tools Reset": "重置",
"GS Curve Tools Close": "关闭",
"Export XGen to Groom": "导出 XGen 到 Groom",
"Export XGen Description": "导出 XGen Description",
"UV": "UV",
"UVDeluxe": "UVDeluxe",
"RizomUV Bridge": "RizomUV Bridge",
"UV Set Editor": "UV 编辑器",
"Preparation": "准备",
"Body Prepare": "身体准备",
"Setup": "设置",
"Advanced Skeleton": "高级骨骼",
"Weight Export": "权重导出",
"Weight Import": "权重导入",
"Unbind Skin": "取消蒙皮",
"Select": "选择",
"Anim School Picker": "Anim School 拾取器",
"DWPicker": "DW 拾取器",
"Tools": "工具",
"bhGhost": "洋葱皮",
"IK/FK Switch": "IK/FK 切换",
"aTools": "aTools",
"Keyframe Pro": "关键帧大师",
"Studio Library": "工作室库",
"Pose Tools": "姿势工具",
"Epic Pose Wrangler": "Epic 姿势变形器",
"Morph Shape": "变形工具",
"Universal Rig Adapter": "通用绑定适配器",
"Dev": "开发",
"Dev Tool": "开发工具",
"Icon Viewer": "图标查看器",
"Import": "导入",
"IK/FK Mocap": "IK/FK 动捕工具",
"MotionCapHelper": "动捕助手",
"SpringMagic": "飘带插件",
"Ahoge": "Ahoge工具",
"QuadRemesher": "重拓扑工具",
"LDMT": "LDMT",
"Simplify": "减面工具",
'Deformer': '变形器',
'Instant Meshes': '快速重拓扑',
'Topo Blendshape': '拓扑变形器',
'Face Transfer': '面部传递',
'Cloth Transfer': '服装传递',
'Marvelous Tool': 'MD工具集',
"Morph to UV": "模型 to UV",
"Quick Export": "快速导出",
"Check UV Bleed":"检查 UV 溢出",
"Overlap UV Out":"重叠 UV 修复",
"Overlap UV In":"重叠 UV 合并",
"Switch UV Set":"切换 UV Set",
"Debug Tools": "Debug 工具",
"Scene": "场景优化",
"CleanM": "清理模型",
"Normal": "面法线",
"KeepHS": "保留平滑组",
"Rename": "重命名",
"DelName": "删除命名空间",
"Ungroup": "取消打组",
"Reverse": "翻转",
"XgenVis": "Xgen 显示",
"Task Path Builder": "任务路径构建"
}
}
LANG = localization.LANG
#===================================== UI MAIN WINDOW COMPONENTS ===================================
class MainWindow(QtWidgets.QWidget):
def __init__(self, parent=maya_main_window()):

Binary file not shown.

View File

@ -0,0 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import *

4
Scripts/__init__.py Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import *

20
Scripts/config.py Normal file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
SCRIPTS_PATH = os.path.dirname(os.path.abspath(__file__)).replace("\\", "/")
ROOT_PATH = os.path.dirname(SCRIPTS_PATH).replace("\\", "/")
TOOL_PATH = ROOT_PATH
TOOL_NAME = "MetaBox"
TOOL_VERSION = "Beta v1.0.0"
TOOL_AUTHOR = "Virtuos Games"
TOOL_LANG = 'en_US'
ICONS_PATH = os.path.join(ROOT_PATH, "icons").replace("\\", "/")
TOOL_ICON = os.path.join(ICONS_PATH, "mtblogo.png").replace("\\", "/")
DEFAULT_ICON = "commandButton.png"
TOOL_HELP_URL = f"http://10.72.61.59:3000/ArtGroup/{TOOL_NAME}/wiki"
TOOL_WSCL_NAME = "ToolBoxWorkSpaceControl"
MOD_FILE_NAME = f"{TOOL_NAME}.mod".replace("\\", "/")
MAIN_SCRIPT_NAME = f"{TOOL_NAME}.py".replace("\\", "/")
LDMT_PATH = os.path.join(SCRIPTS_PATH, "Modeling", "Edit", "LDMT").replace("\\", "/")

210
Scripts/localization.py Normal file
View File

@ -0,0 +1,210 @@
LANG = {
'en_US': {
"DOCUMENT": "DOCUMENT",
"Help": "Help",
"EN": "EN",
"ZH": "ZH",
"zh_CN": "zh_CN",
"Switch Language": "Switch Language",
"Modeling": "Modeling",
"Metahuman": "Metahuman",
"Rigging": "Rigging",
"Animation": "Animation",
"Display": "Display",
"Xray": "Xray",
"Joint Xray": "Joint Xray",
"Manage": "Manage",
"Rename": "Rename",
"Batch Import": "Batch Import",
"Select": "Select",
"Interval Select Edge": "Interval Select Edge",
"Same Position Selector": "Same Position Selector",
"Edge Loop Smart Select": "Edge Loop Smart Select",
"Even Edge Loop": "Even Edge Loop",
"Tools": "Tools",
"Crease Plus": "Crease Plus",
"Speed Cut": "Speed Cut",
"ModIt": "ModIt",
"PlugIt": "PlugIt",
"Zirail": "Zirail",
"Groomer`s Tool": "Groomer`s Tool",
"Edge Sensei": "Edge Sensei",
"Round Inset": "Round Inset",
"Arc Deformer": "Arc Deformer",
"Instant Drag": "Instant Drag",
"Un Bevel": "Un Bevel",
"Align Edge": "Align Edge",
"Extra Curve": "Extra Curve",
"Auto Snap": "Auto Snap",
"Xgen Controller": "Xgen Controller",
"Speed Bend": "Speed Bend",
"Hair Tools": "Hair Tools",
"GS Curve Tools": "GS Curve Tools",
"GS Curve Tools Reset": "GS Curve Tools Reset",
"GS Curve Tools Close": "GS Curve Tools Close",
"Export XGen to Groom": "Export XGen to Groom",
"Export XGen Description": "Export XGen Description",
"UV": "UV",
"UVDeluxe": "UVDeluxe",
"RizomUV Bridge": "RizomUV Bridge",
"UV Set Editor": "UV Set Editor",
"Preparation": "Preparation",
"Body Prepare": "Body Prepare",
"Setup": "Setup",
"Advanced Skeleton": "Advanced Skeleton",
"Weight Export": "Weight Export",
"Weight Import": "Weight Import",
"Unbind Skin": "Unbind Skin",
"Select": "Select",
"Anim School Picker": "Anim School Picker",
"DWPicker": "DWPicker",
"Tools": "Tools",
"bhGhost": "bhGhost",
"IK/FK Switch": "IK/FK Switch",
"aTools": "aTools",
"Keyframe Pro": "Keyframe Pro",
"Studio Library": "Studio Library",
"Pose Tools": "Pose Tools",
"Epic Pose Wrangler": "Epic Pose Wrangler",
"Morph Shape": "Morph Shape",
"Universal Rig Adapter": "Universal Rig Adapter",
"Dev": "Dev",
"Dev Tool": "Dev Tool",
"Icon Viewer": "Icon Viewer",
"Import": "Import",
"IK/FK Mocap": "IK/FK Mocap Tool",
"MotionCapHelper": "MotionCap Helper",
"SpringMagic": "Spring Magic",
"Ahoge": "Ahoge",
"QuadRemesher": "Quad Remesher",
"LDMT": "LDMT",
"Simplify": "Simplify",
'Deformer': 'Deformer',
'Instant Meshes': 'Instant Meshes',
'Topo Blendshape': 'Topo Blendshape',
'Face Transfer': 'Face Transfer',
'Cloth Transfer': 'Cloth Transfer',
'Marvelous Tool': 'Marvelous Tool',
"Morph to UV": "Morph to UV",
"Quick Export": "Quick Export",
"Check UV Bleed":"Check UV Bleed",
"Overlap UV Out":"Overlap UV Out",
"Overlap UV In":"Overlap UV In",
"Switch UV Set":"Switch UV Set",
"Debug Tools": "Debug Tools",
"Scene": "Scene",
"CleanM": "CleanM",
"Normal": "Normal",
"KeepHS": "KeepHS",
"Rename": "Rename",
"DelName": "DelName",
"Ungroup": "Ungroup",
"Reverse": "Reverse",
"XgenVis": "XgenVis",
"Task Path Builder": "TaskPathBuilder"
},
'zh_CN': {
"DOCUMENT": "说明文档",
"Help": "帮助",
"EN": "EN",
"ZH": "ZH",
"zh_CN": "zh_CN",
"Switch Language": "切换语言",
"Modeling": "建模",
"Metahuman": "Metahuman",
"Rigging": "绑定",
"Animation": "动画",
"Display": "显示",
"Xray": "X光显示",
"Joint Xray": "关节X光显示",
"Manage": "管理",
"Rename": "重命名",
"Batch Import": "批量导入",
"Select": "选择",
"Interval Select Edge": "间隔选择边",
"Same Position Selector": "相同位置物体选择器",
"Edge Loop Smart Select": "边缘循环智能选择",
"Even Edge Loop": "等边循环",
"Tools": "工具",
"Crease Plus": "Crease ++",
"Speed Cut": "快速切割",
"ModIt": "ModIt",
"PlugIt": "PlugIt",
"Zirail": "Zirail 拓扑工具",
"Groomer`s Tool": "Groomer 工具",
"Edge Sensei": "边线大师",
"Round Inset": "圆角插入",
"Arc Deformer": "弧形变形器",
"Instant Drag": "吸附放置",
"Un Bevel": "去除倒角",
"Align Edge": "对齐到边",
"Extra Curve": "提取曲线",
"Auto Snap": "自动吸附",
"Xgen Controller": "Xgen 控制器",
"Speed Bend": "快速弯曲",
"Hair Tools": "毛发工具",
"GS Curve Tools": "GS曲线工具",
"GS Curve Tools Reset": "重置",
"GS Curve Tools Close": "关闭",
"Export XGen to Groom": "导出 XGen 到 Groom",
"Export XGen Description": "导出 XGen Description",
"UV": "UV",
"UVDeluxe": "UVDeluxe",
"RizomUV Bridge": "RizomUV Bridge",
"UV Set Editor": "UV 编辑器",
"Preparation": "准备",
"Body Prepare": "身体准备",
"Setup": "设置",
"Advanced Skeleton": "高级骨骼",
"Weight Export": "权重导出",
"Weight Import": "权重导入",
"Unbind Skin": "取消蒙皮",
"Select": "选择",
"Anim School Picker": "Anim School 拾取器",
"DWPicker": "DW 拾取器",
"Tools": "工具",
"bhGhost": "洋葱皮",
"IK/FK Switch": "IK/FK 切换",
"aTools": "aTools",
"Keyframe Pro": "关键帧大师",
"Studio Library": "工作室库",
"Pose Tools": "姿势工具",
"Epic Pose Wrangler": "Epic 姿势变形器",
"Morph Shape": "变形工具",
"Universal Rig Adapter": "通用绑定适配器",
"Dev": "开发",
"Dev Tool": "开发工具",
"Icon Viewer": "图标查看器",
"Import": "导入",
"IK/FK Mocap": "IK/FK 动捕工具",
"MotionCapHelper": "动捕助手",
"SpringMagic": "飘带插件",
"Ahoge": "Ahoge工具",
"QuadRemesher": "重拓扑工具",
"LDMT": "LDMT",
"Simplify": "减面工具",
'Deformer': '变形器',
'Instant Meshes': '快速重拓扑',
'Topo Blendshape': '拓扑变形器',
'Face Transfer': '面部传递',
'Cloth Transfer': '服装传递',
'Marvelous Tool': 'MD工具集',
"Morph to UV": "模型 to UV",
"Quick Export": "快速导出",
"Check UV Bleed":"检查 UV 溢出",
"Overlap UV Out":"重叠 UV 修复",
"Overlap UV In":"重叠 UV 合并",
"Switch UV Set":"切换 UV Set",
"Debug Tools": "Debug 工具",
"Scene": "场景优化",
"CleanM": "清理模型",
"Normal": "面法线",
"KeepHS": "保留平滑组",
"Rename": "重命名",
"DelName": "删除命名空间",
"Ungroup": "取消打组",
"Reverse": "翻转",
"XgenVis": "Xgen 显示",
"Task Path Builder": "任务路径构建"
}
}

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB