Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: VRM0 / VRM1 support (UniVRM) #651

Open
5 tasks done
kaikoga opened this issue Oct 29, 2023 · 2 comments
Open
5 tasks done

feat: VRM0 / VRM1 support (UniVRM) #651

kaikoga opened this issue Oct 29, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@kaikoga
Copy link
Contributor

kaikoga commented Oct 29, 2023

Discussed in #522

Support VRM0 / VRM1 avatars in AAO components.

Required Tasks

  • Add Version Define AAO_VRM1 against "com.vrmc.vrm" and/or AAO_UNIVRMAAO_VRM0 against "com.vrmc.univrm"
  • Register VRM0 / VRM1 components to ComponentInfo
  • Fix Trace And Optimize
  • Fix Freeze BlendShape (not AutoFreezeBlendShape)
  • Fix Merge Skinned Mesh

Affected VRM0 / VRM1 components list

Broken by AAO

  • BlendShapeClips(VRM0) / VRM10Expression(VRM1)
    • Morph targets in SkinnedMeshRenderers are referenced by index
    • Material are referenced by material name (I won't support this, cannot survive Merge ToonLit Material anyway)
  • VRMFirstPerson(VRM0) / VRM10ObjectFirstPerson(VRM1)
    • Contains references(VRM0) or relative paths(wtf VRM1) to SkinnedMeshRenderers
    • Should merge entries

Modified but not broken by AAO

  • VRMSpringBone(VRM0) / Vrm10InstanceSpringBone(VRM1)
    • Should merge VRM1Instance references (VRM1)
  • VRMSpringBoneColliderGroup(VRM0) / VRM10SpringBoneColliderGroup(VRM1)
    • Should merge VRM1Instance references (VRM1)
  • IVrm10Constraint(VRM1)
    • Pray if default object mapper does well

Unaffected by AAO

  • VRMLookAtHead(VRM0) / VRM10ObjectLookAt(VRM1)
    • Driven through specific Humanoid bone if LookAtType is Bone (not serialized)
    • Driven through BlendShapeProxy / Expression name if LookAtType is BlendShape / Expression (not serialized)

AAO component list

Breaks Typical VRM Setup (update required)

  • Trace And Optimize
    • Breaks everything
  • Merge Skinned Mesh
    • Skinned meshes in BlendShapeClips(VRM0) / Expressions(VRM1) are referenced by path, need to update refs
  • Freeze BlendShape
    • BlendShapes in BlendShapeClipsVRM0) / Expressions(VRM1) are referenced by index, need to update names

Possible Invalid Setup (wontfix)

  • Merge ToonLit Material
    • VRM has material value animations
  • Clear Endpoint Position
    • May break VRM SpringBones

Independent components (nothing to do)

  • Remove Mesh By BlendShape
  • Remove Mesh in Box
  • Merge Bone
    • May break VRM SpringBones
  • Merge PhysBone

Legacy or Non-VRM components (wontfix)

  • UnusedBonesByReferencesTool
  • Make Children
@kaikoga
Copy link
Contributor Author

kaikoga commented Oct 29, 2023

主に 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
Copy link
Contributor Author

kaikoga commented Oct 29, 2023

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

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

@anatawa12 anatawa12 added the enhancement New feature or request label Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants