This commit is contained in:
Jeffreytsai1004 2025-01-15 04:31:58 +08:00
parent d9a4c4946d
commit ce81fa16fc
2 changed files with 44 additions and 2 deletions

View File

@ -36,7 +36,7 @@
```
import sys
sys.path.append("c:/Arts and Spells/Scripts")
sys.path.append("C:/Arts and Spells/Metapipe Studo 1.3.0")
import Body_Prep
Body_Prep.run()
```
@ -46,7 +46,7 @@ Body_Prep.run()
```
import sys
sys.path.append("c:/Arts and Spells/Scripts")
sys.path.append("C:/Arts and Spells/Metapipe Studo 1.3.0")
import MetaPipeStudio
MetaPipeStudio.show_dna_edit_window()
```

42
correctiveBlendshape.py Normal file
View File

@ -0,0 +1,42 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import maya.cmds as cmds
import sys
import importlib
def run():
# 获取选中的对象
selected = cmds.ls(selection=True, transforms=True)
# 检查是否选择了两个对象
if len(selected) != 2:
raise RuntimeError(f"请选择两个多边形对象!")
# 检查每个选中对象的类型
for obj in selected:
shapes = cmds.listRelatives(obj, shapes=True)
for shape in shapes:
if cmds.nodeType(shape) != "mesh":
raise RuntimeError(f"选中的几何体不是多边形对象!")
# 检查第一个对象是否绑定了蒙皮
shapes = cmds.listRelatives(selected[0], shapes=True)
skin = cmds.listConnections(shapes[0], type="skinCluster")
if not skin:
raise RuntimeError(f"第一个选中的对象没有绑定蒙皮簇!")
# 执行 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')
import bsIndex
importlib.reload(bsIndex)
bsIndex.calc()
if __name__ == "__main__":
run()