2010-04-09 5 views
1

안녕하세요, 시간이 지남에 따라 움직이는 스킨 된 메쉬가 있습니다. 내 vertitud를 내보내려면 빠른 내보내기 스크립트를 작성하고 있습니다.MaxScript 시간별 정점 내보내기

프레임 당 정점을 어떻게 출력합니까?

getVert를 사용하여 vertitudes를 가져 오지만, 정점을 가져올 프레임을 어떻게 지정합니까?

감사 ASH

답변

0

당신은 전체 메쉬은 "시"를 사용할 수 있습니다. 예 : "시간 i에서 mmesh = snapshotAsMesh obj"

여기서 "i"는 원하는 프레임이고 "obj"는 기존 객체이고 "mmesh"는 결과 메시입니다. mmesh에 을 사용하면 일반적인 getvert 기능을 사용할 수 있습니다.

1

다음 코드는 테스트되지 않았지만 제대로 작동해야합니다. 변경해야 할 사항이 있으면 알려주십시오.

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