From 2eafdd7fad94feb1b07b4f85c863660a180a8d7a Mon Sep 17 00:00:00 2001 From: Jeffreytsai1004 Date: Wed, 15 Jan 2025 23:17:52 +0800 Subject: [PATCH] Update --- JointTransformationTool.py | 4 ++-- MetaPipeFree.py | 3 +++ MetaPipeStudio.py | 5 ++++- Prepare.py | 3 +++ bsIndex.py | 5 ++++- correctiveBlendshape.py | 9 ++++++--- extractDeltas.py | 38 +++++++++++++++++++------------------- metapipe.py | 3 +++ 8 files changed, 44 insertions(+), 26 deletions(-) diff --git a/JointTransformationTool.py b/JointTransformationTool.py index cdb9b0a..c408e47 100644 --- a/JointTransformationTool.py +++ b/JointTransformationTool.py @@ -1,5 +1,5 @@ -#All Rights Belongs to Uzay CALISKAN -#Artstation Marketplace Standart License +#!/usr/bin/env python +# -*- coding: utf-8 -*- import maya.cmds as qqdgffvdrevd2121 import sys diff --git a/MetaPipeFree.py b/MetaPipeFree.py index 492f4ed..dedbed7 100644 --- a/MetaPipeFree.py +++ b/MetaPipeFree.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + import maya.cmds as cmds import os import os.path as ospathe diff --git a/MetaPipeStudio.py b/MetaPipeStudio.py index a15c407..55e263e 100644 --- a/MetaPipeStudio.py +++ b/MetaPipeStudio.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + import importlib import sys import maya.cmds as cmds @@ -23,7 +26,7 @@ else: "OS not supported, please compile dependencies and add value to LIB_DIR" ) -# Adds directories to path +# 将目录添加到路径中 syspath.insert(0, ROOT_DIR) sys.path.append(f"{ROOT_DIR}/examples") syspath.insert(0, LIB_DIR) diff --git a/Prepare.py b/Prepare.py index 7ec3f23..d8abf6a 100644 --- a/Prepare.py +++ b/Prepare.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + #All Rights Belongs to Uzay CALISKAN #Artstation Marketplace Standart License diff --git a/bsIndex.py b/bsIndex.py index 4a8d810..22abc75 100644 --- a/bsIndex.py +++ b/bsIndex.py @@ -1,4 +1,7 @@ -#GNU General Public License +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +#GPL通用公共许可证 import pymel.core as pm import maya.cmds as cmds import sys diff --git a/correctiveBlendshape.py b/correctiveBlendshape.py index 8251fa7..2345f48 100644 --- a/correctiveBlendshape.py +++ b/correctiveBlendshape.py @@ -3,6 +3,7 @@ import maya.cmds as cmds import sys +import os import importlib def run(): @@ -22,18 +23,20 @@ def run(): # 检查第一个对象是否绑定了蒙皮 shapes = cmds.listRelatives(selected[0], shapes=True) + # 获取蒙皮 skin = cmds.listConnections(shapes[0], type="skinCluster") if not skin: raise RuntimeError(f"第一个选中的对象没有绑定蒙皮簇!") - # 执行 extractDeltas 命令 + # 执行 extractDeltas 命令 从变形网格中提取建模的修正形状 cmds.extractDeltas(s=selected[0], c=selected[1]) # 选择第二个对象 cmds.select(selected[1], replace=True) - # 导入并运行 bsIndex - sys.path.append('C:/Arts and Spells/Metapipe Studio 1.3.0') + # 导入并运行 bsIndex 计算修正形状的索引, 指定 bsIndex 的路径为当前路径 + BSINDEX_PATH = os.path.dirname(os.path.abspath(__file__)) + sys.path.append(BSINDEX_PATH) import bsIndex importlib.reload(bsIndex) bsIndex.calc() diff --git a/extractDeltas.py b/extractDeltas.py index 1a2a589..17ccbc3 100644 --- a/extractDeltas.py +++ b/extractDeltas.py @@ -1,45 +1,45 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + # ---------------------------------------------------------------------------------------------- # # extractDeltas.py # v1.4 # -# extract a modeled corrective shape from a deformed skinned mesh +# 从变形的蒙皮网格中提取建模的修正形状 # -# original c++ extract deltas plugin by James Jacobs +# 原始 c++ extract deltas 插件作者:James Jacobs # -# python conversion, improvements and maintenance by Ingo Clemens +# Python 转换、改进和维护:Ingo Clemens # www.braverabbit.com # # brave rabbit, Ingo Clemens 2014 # -# versions: +# 版本历史: # -# 1.4 - included mel scripts -# 1.3 - improved shape comparison without the need of blendshapes -# 1.2 - added the vertex list flag to work only on a given component list -# 1.1 - optimized performance because it now works on sculpted points only -# (0.06 - c++ version, 1.88 - version 1.0, 0.14 - version 1.1) -# 1.0 - initial python conversion +# 1.4 - 包含了 mel 脚本 +# 1.3 - 改进了形状比较,无需使用混合变形 +# 1.2 - 添加了顶点列表标志,仅在给定的组件列表上工作 +# 1.1 - 优化了性能,因为现在只对雕刻的点进行处理 +# (0.06 - c++ 版本, 1.88 - 1.0版本, 0.14 - 1.1版本) +# 1.0 - 初始 Python 转换 # # ---------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------- # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. +# 本程序是自由软件;您可以根据自由软件基金会发布的 GNU 通用公共许可证 +# 第2版或(您可以选择)任何更新版本的条款重新发布和/或修改它。 # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# 本程序的发布是希望它能有用,但不提供任何保证;甚至没有 +# 适销性或特定用途适用性的暗示保证。详情请参阅 +# GNU 通用公共许可证。 # # ---------------------------------------------------------------------------------------------- # ---------------------------------------------------------------------------------------------- # -# USE AND MODIFY AT YOUR OWN RISK!! +# 使用和修改需自行承担风险!! # # ---------------------------------------------------------------------------------------------- diff --git a/metapipe.py b/metapipe.py index 30a3a58..8b6efb6 100644 --- a/metapipe.py +++ b/metapipe.py @@ -1,3 +1,6 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + import tkinter as tk from tkinter import ttk from tkinter.filedialog import askdirectory, askopenfilename