본문 바로가기
3DMAX/Setup

MAX의 캐릭터 셋업을 스크립트 코드로 처리하는 방식 정리(스크립트 컨트롤러)

by tartist 2015. 12. 14.

스크립트컨트롤러가 필요한 이유

게임계에 일하는 애니메이터라면 매일 봐야 하는 바이패드..
본으로 셋팅해야 하는 불편을 없애줘
인간형 애니를 잡을때는 정말 훌륭한 툴이지만 인간의 형태를 벗어날수록
한계점이 많은 녀석입니다..


 

 

예를 들면 켄타로우스 처럼 발은 사족이고 상체는 인간형 같은..

 

 

그런 한계점을 없애기 위해서는 바이패드를 여러개 사용하여 다양한 셋팅을 할수 있습니다.
하지만, 바이패드끼리 링크를 걸면 여러가지 버그가 많이 생깁니다.
링크걸린 바이패드가 위치값을 잘못계산하여 다른 위치로 튀는 현상이 매우 빈번히 발생합니다.
또한 링크된 두번째 바이패드에는 IK(Inverse Kinematic)애니를 줄수 없어 모션 작업이 어렵습니다.
(애니메이션 작업을 해보면 알수 있는..)

그 외에도 엄청나게 많은 문제들이 생깁니다.
바이패드 특성상 맥스와 좀 따로 노는 느낌이라 그런지 맥스에서 사용하는 기능들과 상충할때가 많습니다.

이러한 문제를 스크립트 컨트롤러를 활용하여 멀티 바이패드의 여러 문제를 해결할 수 있습니다.

 

스크립트 컨트롤러 셋팅한 바이패드



영상 

 

 

- 바이패드를 세개 이용하여 제작된 셋팅입니다. 뒷다리쪽이 bip01 , 몸통이 bip02, 추가팔이 bip03입니다.

서로 다른 바이패드끼리 한개의 바이패드처럼 작동이 됩니다.

 

위 그림에 셋팅된 스크립트 컨트롤러 정리

if bip01 != undefined and bip02 != undefined then
(
 if bip01.controller.figureMode then
 (
  bip02.controller.figureMode = true
  bip03.controller.figureMode = true
  
  biped.setTransform bip02 #pos dm.transform.pos false
  biped.setTransform bip02 #rotation dm.transform.rotation false
  biped.setTransform bip02 #scale dm.transform.scale false
  
  biped.setTransform bip03 #pos (biped.getTransform bip02 #pos) false
  biped.setTransform bip03 #rotation (biped.getTransform bip02 #rotation) false
  biped.setTransform bip03 #scale (biped.getTransform bip02 #scale) false
  
  biped.setTransform bip03Spine00 #pos (biped.getTransform bip02Spine00 #pos) false
  biped.setTransform bip03Spine00 #rotation (biped.getTransform bip02Spine00 #rotation) false
  biped.setTransform bip03Spine00 #scale (biped.getTransform bip02Spine00 #scale) false
  biped.setTransform bip03Spine01 #rotation (biped.getTransform bip02Spine01 #rotation) false
  biped.setTransform bip03Spine01 #scale (biped.getTransform bip02Spine01 #scale) false
  biped.setTransform bip03Spine02 #rotation (biped.getTransform bip02Spine02 #rotation) false
  biped.setTransform bip03Spine02 #scale (biped.getTransform bip02Spine02 #scale) false
  
 
 )
 else
 (
  bip02.controller.figureMode = false
  bip03.controller.figureMode = false
 )

 bip02.transform = dm.transform
 bip03.transform = bip02.transform
 bip03Spine00.transform = bip02Spine00.transform
 bip03Spine01.transform = bip02Spine01.transform
 bip03Spine02.transform = bip02Spine02.transform 
)

 

 

스크립트 콘트롤러 제어를 통해 배운점

1. 손으로만 가능할거라 생각했던 바이패드 셋팅을 스크립트를 활용한 특수 셋팅을 알게됐습니다.

2. 중간더미를 적절히 사용하지 않으면 여전히 오류가 발생할수 있습니다. 이것은 손으로 셋팅할때도 마찬가지였습니다.