Animation MaxScript随时间导出顶点
嘿,我有一个蒙皮网格,随着时间的推移会产生动画。 我正在写一个快速导出脚本来导出我的垂直图像 如何输出每帧的顶点 我使用getVert获取垂直,但是如何指定从哪个帧获取顶点 谢谢 ASH您可以对整个网格使用“在时间”。 e、 g.“在时间i mmesh=快照asmesh obj” 其中“i”是所需的帧,“obj”是现有对象,“mmesh”是生成的网格。 在mmesh上,您可以执行通常的getvert功能。您可以对整个网格使用“在时间”。 e、 g.“在时间i mmesh=快照asmesh obj” 其中“i”是所需的帧,“obj”是现有对象,“mmesh”是生成的网格。Animation MaxScript随时间导出顶点,animation,export,skinning,mesh,maxscript,Animation,Export,Skinning,Mesh,Maxscript,嘿,我有一个蒙皮网格,随着时间的推移会产生动画。 我正在写一个快速导出脚本来导出我的垂直图像 如何输出每帧的顶点 我使用getVert获取垂直,但是如何指定从哪个帧获取顶点 谢谢 ASH您可以对整个网格使用“在时间”。 e、 g.“在时间i mmesh=快照asmesh obj” 其中“i”是所需的帧,“obj”是现有对象,“mmesh”是生成的网格。 在mmesh上,您可以执行通常的getvert功能。您可以对整个网格使用“在时间”。 e、 g.“在时间i mmesh=快照asmesh obj
在mmesh上,您可以执行常用的getvert函数。以下代码未经测试,但类似的代码应该适合您。如果您需要做任何更改,请告诉我
/* Exports mesh data 'm' to file 'f' */
def exportData m f = (
format "%,%\n" m.numverts m.numfaces to:f
for i = 1 to m.numverts do
format "%," (getVert m i) to:f
format "\n" to:f
for i = 1 to m.numfaces do
format "%," (getFace m i) to:f
)
/* Exports mesh data from a node 'n' at time 't' to file 'f' */
def exportNodeMeshAtTime t n f =
(
at time t
m = snapshotAsMesh n
exportMesh m f
)
/* Create a text file for receiving the data */
out_file = createfile ((GetDir #export)+"/testmesh.dat")
/* Enumerate all times in the animation range, exporting
the mesh data from the selected node at time t. */
for t = animationRange.start to animationRange.end do (
exportNodeMeshAtTime t selection[1] out_file
)
/* Close the text file */
close out_file
以下代码未经测试,但类似的代码应该适合您。如果您需要做任何更改,请告诉我
/* Exports mesh data 'm' to file 'f' */
def exportData m f = (
format "%,%\n" m.numverts m.numfaces to:f
for i = 1 to m.numverts do
format "%," (getVert m i) to:f
format "\n" to:f
for i = 1 to m.numfaces do
format "%," (getFace m i) to:f
)
/* Exports mesh data from a node 'n' at time 't' to file 'f' */
def exportNodeMeshAtTime t n f =
(
at time t
m = snapshotAsMesh n
exportMesh m f
)
/* Create a text file for receiving the data */
out_file = createfile ((GetDir #export)+"/testmesh.dat")
/* Enumerate all times in the animation range, exporting
the mesh data from the selected node at time t. */
for t = animationRange.start to animationRange.end do (
exportNodeMeshAtTime t selection[1] out_file
)
/* Close the text file */
close out_file