MaxScript 随着时间的推移导出顶点

发布于 2024-08-27 23:04:40 字数 125 浏览 8 评论 0原文

嘿,我有一个随着时间的推移而产生动画的蒙皮网格。 我正在编写一个快速导出脚本来导出我的顶点。

如何输出每帧的顶点?

我使用 getVert 获取顶点,但如何指定从哪个帧获取顶点?

谢谢 灰

Hey, I have a skinned mesh that animates over time.
I'm writing a quick export script to export out my verticies.

How do I output the vertices per frame?

I'm getting the verticies using getVert, but how do I specify which frame to get the vertex from?

Thanks
ASH

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏至、离别 2024-09-03 23:04:40

以下代码未经测试,但类似的代码应该适合您。如果您需要进行任何更改,请告诉我。

/* 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

The following code is untested, but something like it should work for you. Please let me know if there are any changes you need to make.

/* 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
浅沫记忆 2024-09-03 23:04:40

您可以对整个网格使用“at time”。
例如“at time i mmesh=snapshotAsMesh obj”,

其中“i”是您想要的框架,“obj”是现有对象,“mmesh”是生成的网格。
在 mmesh 上,您可以执行常用的 getvert 功能。

you can use "at time" for the whole mesh.
e.g. "at time i mmesh=snapshotAsMesh obj"

where "i" is the frame you want, "obj" the existing object and "mmesh" the resulting mesh.
on mmesh you can do your usual getvert functions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文