[英]maya to fbx with custom attributes
我有一個maya場景,其中每個網格物體在形狀節點上都有一系列自定義屬性,這些屬性是使用python動態添加的。
import maya.cmds as cmds
import maya.mel as mm
#get mesh objects.
meshes = maya.cmds.ls(type="mesh")
for mesh in meshes:
cmds.select(mesh)
#check if attribute exists, if not, create.
if not mm.eval( 'attributeExists "test" "%s"' % mesh):
cmds.addAttr( shortName='tst', longName='test', dataType="string")
當我導出到.fbx並重新導入時,這些屬性及其值都消失了。
如何在導出時保留所有這些值?
不幸的是,你不能。 從maya docs中 :
您可以將Maya變換節點自定義屬性導出到FbxNode的用戶屬性。 但是,不能將Maya形狀節點自定義屬性(例如網格節點)導出到FbxGeometry。 這是因為FbxGeometry當前不支持用戶屬性。
最好的選擇也許是嘗試將自定義屬性放置在非形狀節點上,或者嘗試探索其他導出格式,例如紫蘇或您自己的自定義格式。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.