From 2f5c7233af6dc591ef2eb6066e4fe03d924a4c40 Mon Sep 17 00:00:00 2001 From: Jeffreytsai1004 Date: Mon, 20 Jan 2025 23:01:48 +0800 Subject: [PATCH] Update Export_FBX.py --- Export_FBX.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Export_FBX.py b/Export_FBX.py index 091f1ef..cddcf6b 100644 --- a/Export_FBX.py +++ b/Export_FBX.py @@ -9,35 +9,35 @@ def export_fbx(ROOT_DIR): - # Set the path and filename for the FBX file + # 设置FBX文件的路径和文件名 path = f"{ROOT_DIR}/output" filename = "body.fbx" filepath = path + "/" + filename cmds.select(clear=True) cmds.select("body_rig", add=True) cmds.select("DHIbody:root", add=True) - # Export the selected objects as FBX + # 导出选定的对象为FBX cmds.file(filepath, force=True, options="groups=0;ptgroups=0;materials=0;smoothing=1;normals=1", type='FBX export', exportSelected=True) filename = "head.fbx" filepath = path + "/" + filename - cmds.select("DHIbody:spine_04", hi=True) # Select "DHIbody:spine_04" and its children - cmds.delete() # Delete the selected objects - cmds.select("DHIbody:thigh_r", hi=True) # Select "DHIbody:spine_04" and its children - cmds.delete() # Delete the selected objects - cmds.select("DHIbody:thigh_l", hi=True) # Select "DHIbody:spine_04" and its children - cmds.delete() # Delete the selected objects + cmds.select("DHIbody:spine_04", hi=True) # 选择"DHIbody:spine_04"及其子对象 + cmds.delete() # 删除选定的对象 + cmds.select("DHIbody:thigh_r", hi=True) # 选择"DHIbody:spine_04"及其子对象 + cmds.delete() # 删除选定的对象 + cmds.select("DHIbody:thigh_l", hi=True) # 选择"DHIbody:spine_04"及其子对象 + cmds.delete() # 删除选定的对象 - # Parent "DHIhead:spine_04" under "DHIbody:spine_03" + # 将"DHIhead:spine_04"作为"DHIbody:spine_03"的子对象 cmds.parent("DHIhead:spine_04", "DHIbody:spine_03") - # Print the new parent of "DHIhead:spine_04" + # 打印"DHIhead:spine_04"的新父对象 print(cmds.listRelatives("DHIhead:spine_04", parent=True)) cmds.select(clear=True) cmds.select("head_grp", add=True) cmds.select("DHIbody:root", add=True) - # Export the selected objects as FBX + # 导出选定的对象为FBX cmds.file(filepath, force=True, options="groups=0;ptgroups=0;materials=0;smoothing=1;normals=1", type='FBX export', exportSelected=True) cmds.undo()