anatawa12 / AvatarOptimizer

AAO: Avatar Optimizer: Non Destructive Avatar Optimization Utilities
MIT License
161 stars 23 forks source link

feat: VRM0 / VRM1 support (UniVRM) #651

Open kaikoga opened 10 months ago

kaikoga commented 10 months ago

Discussed in https://github.com/anatawa12/AvatarOptimizer/discussions/522

Support VRM0 / VRM1 avatars in AAO components.

Required Tasks

Affected VRM0 / VRM1 components list

Broken by AAO

Modified but not broken by AAO

Unaffected by AAO

AAO component list

Breaks Typical VRM Setup (update required)

Possible Invalid Setup (wontfix)

Independent components (nothing to do)

Legacy or Non-VRM components (wontfix)

kaikoga commented 10 months ago

主に BlendShapeClip (VRM0) / Vrm10Expression (VRM1) のBlendShapeがIndex参照なのとRendererの指定方法がAvatarRootTransformからのRelativePathなのでいろいろと苦しいことになっています。

あといずれもScriptableObjectがScriptableObjectの参照を持つ形の(AnimationControllerに近い)データ構造なので、(AAOの)AnimatorControllerMapperによるDeepCloneっぽい扱いが必要です。とりあえず仮でAnimatorControllerMapperのDeepCloneに相乗りしてますが、この実装をMAにコピーする必要が起きる前にNDMFあたりにもう少し使いやすいDeepCloneのAPIを生えてると嬉しそうな気持ちがあります。

ちなみにVRM1のFirstPerson(一人称視点からどのRendererが表示されるか指定できる仕組み。言い換えると、VRM標準のMA Visible Head Accessory)はVrm10Objectに(つまり表情と一緒のScriptableObjectに)格納されるので、MAでFirstPersonをマージしたい時はMAでVrm10ObjectをDeepCloneできる必要があります。大変そう。

kaikoga commented 10 months ago

「AAOはVRMをサポートします」って言えるようになるまでにやらなきゃいけないAAO外の課題

bdunderscore/ndmf#71 (これを入れない限り、VRCSDKとUniVRMが両方入っているプロジェクトではVRCアバターしか扱えない) bdunderscore/ndmf#72 (↑の とりあえず仮でAnimatorControllerMapperのDeepCloneに相乗りしてます をどう解消するか)