멀티미디어
3D 아바타 blendshape coefficient 데이터
바이수
2021. 3. 27. 18:11
- Blendshape Coefficient 란?
- blendshape = 형태를 썩다? 3D 업계 특정 업체에서... 표정을 다룰때 사용하는 용어.
- coefficient = 계수
- 예) https://github.com/facemoji/facemoji-kit
- Input(RGB Video) -> Output(FACS and ARKit-compatible blendshapes)
- (담당자 @로빈이... 답장이 없었다... 18)
- 즉, 표정을 이루는 각 요소들의 움직임을 계수화 하여~ 이를 활용하는것 같다...
- Blendshape Coefficient 데이터 추출
- (안드로이드 : 제공안됨...)
- 아이폰 ARKit :
- https://developer.apple.com/documentation/arkit/arfaceanchor
- https://developer.apple.com/documentation/arkit/arfaceanchor/blendshapelocation
- 코드 예)
- // TODO : ...
- xcode 코딩후... App에 실행뒤~ 카메라에 인식된 얼굴의 데이터가 잘 뽑혔다.
- 17:48:15.812491+0900 iOS FaceTrack for Maya - jawOpen 0.158771
- 17:48:15.812817+0900 iOS FaceTrack for Maya - mouthLeft 0.180734
- 17:48:15.812996+0900 iOS FaceTrack for Maya - mouthRight 0.000000
- 17:48:15.813170+0900 iOS FaceTrack for Maya - jawLeft 0.400107
- 17:48:15.813345+0900 iOS FaceTrack for Maya - jawRight 0.000000
- 17:48:15.813521+0900 iOS FaceTrack for Maya - eyeBlinkLeft 0.037611
- 17:48:15.813696+0900 iOS FaceTrack for Maya - eyeBlinkRight 0.040259
- ......
- 얼굴인식 튜토리얼
- https://github.com/mhammoud/iOS-FaceTrack-for-Maya
- https://www.raywenderlich.com/5491-ar-face-tracking-tutorial-for-ios-getting-started
- MAYA(마야) 3D 모델 컨트롤러에 적용
- 모델링된 maya.mb 파일에서 '컨트롤러'를 제공하면... (1:1 대응관계를 찾아서)
- 추출한 blendshape 데이터를 -> 매칭되는 요소에 대입하여! 애니메이트 시킬수 있겠죠?ㅋ
- (Script Editor -> Python -> 실행)
- 스크립트 예)
-
import maya.mel as mel import maya.cmds as cmds import time list = [ "CTL_R_eye", "CTL_L_eye", ... "CTL_C_mouth", "CTL_C_jaw" ] data_list = [ ... ] for data in data_list: mel.eval( "setAttr {0}.translateY {1}".format(list[0], data) ) ... cmds.refresh() time.sleep(0.01)
- // TODO : ...
-
- 번외) Morph targets(?) 데이터
- 3D 아바타 관련 리서치를 하면서...
- 이 업계의 다른진영? 업체에서는 이런류의 데이터를 Morph-targets 라고 하는것 같기도? 하다.
- ( https://en.wikipedia.org/wiki/Morph_target_animation )
- https://github.com/rwsarmstrong/strongtrack 우연히 이런 소스코드를 보았는데...
- 개 허접하긴 하지만, 뭔가 깔끔한(?) 느낌이 좋았다.
- strongtrack.exe 에 동영상을 불러와서, 몇장의 프레임을 노가다(?) 학습시키면... 데이터를 뽑을수 있다.
- 번외) Blend 에 적용
- 예제로 제공되는 .blend 파일로 테스트를 해 볼 수 있다.
- 어어어
-끝-