Monday, August 3, 2009

Texture File Node 등의 absolute Path를 MEL로 일괄 변경하기

다른 사람이 작업하던 프로젝트 파일을 받아보면 path 가 Relative 아 아니라 absolute path 로 들어가 있는 경우가 종종 있다. 이를 원하는 path 로 convert 하는 MEL 을 다음과 같은 함수로 구현해보았다.

global proc NodeUtil_ChangePathAttrDir(string $nodeType, string $filepathAttr, string $prefixBefore, string $prefixAfter);

실제사례 1) 
illustrator로 뽑은 커브로 단면을 묘사한 파일에서 모든 illustrator 외부파일이 D:/ 밑에 있는걸로 돼있는데, D:/ 가 없는 다른 PC에서는 열수조차 없다. 따라서 D:/ 가 있는 컴에서 다음과 같이 실행해서 파일을 변환해주었다.

NodeUtil_ChangePathAttrDir("makeIllustratorCurves", "illustratorFilename", "D:/", "C:/Alba/"); 

실제사례 2) 
텍스처에 사용된 file 노드의 패스가 예전 작업자의 절대패스로 되어 있어서 현재 작업자의 패스로 변환해주었다.

NodeUtil_ChangePathAttrDir("file", "fileTextureName", "C:/maya/dream/house in/", "G:/me/new/Bunny cur 090525/dream/house in/");

No comments:

Post a Comment