CCK3.5でPhysBoneをDynamicBoneに変換してアバターをアップロードする
手順
VCC(VRChat Creator Companion)でAvatar Projectを作成する
1で作成したプロジェクトのUnityのバージョンを2021.3.23f1にアップグレードする
CCK3.5を導入する
DynamicBoneを導入する
アバターをインポートする
PhysBoneをDynamicBoneに変換するツールを導入して変換する
アバターをアップロードする
VCC(VRChat Creator Companion)でAvatar Projectを作成する
VCCは公式サイトの紹介にとどめ、導入方法は割愛します
https://vrchat.com/home/download
![](https://assets.st-note.com/img/1691296196690-50gIErqsB0.png?width=1200)
![](https://assets.st-note.com/img/1691296371517-zaopfPfaQ5.png?width=1200)
Unityのバージョンを2021.3.23f1にアップグレードする
![](https://assets.st-note.com/img/1691296645590-RrHb4jIXwj.png?width=1200)
![](https://assets.st-note.com/img/1691296510140-ZK9OJ3XFHY.png?width=1200)
![](https://assets.st-note.com/img/1691296698369-5kxfdiUQee.png?width=1200)
![](https://assets.st-note.com/img/1691296764547-Kp0E7zYpVJ.png)
![](https://assets.st-note.com/img/1691296888529-lDgVfA0YLi.png?width=1200)
エラー修復ツールを作りましたので、こちらをダウンロードしていただき、中にあるErrorFixer.exeを実行してください
ブラウザによってはセキュリティでブロックされる可能性があります。
その場合はブロックを解除するとダウンロードされます。
Chromeの場合
![](https://assets.st-note.com/img/1691322427070-RzNhe3nnC6.png)
![](https://assets.st-note.com/img/1691322437063-LillqXtKrO.png?width=1200)
![](https://assets.st-note.com/img/1691322447751-35DfPG3QWC.png)
![](https://assets.st-note.com/img/1691321906805-kix7Wjxi7Y.png)
実行後、Unityを再読込するとエラーが解消します
CCK3.5を導入する
※以下の手順はCCK3.4と同じかと思います
https://documentation.abinteractive.net/cck/setup/
DynamicBoneを導入する
![](https://assets.st-note.com/img/1691297623575-ULSoSqk8qz.png?width=1200)
アバターを導入する
![](https://assets.st-note.com/img/1691297836579-oCzwrm30AF.png?width=1200)
PhysBoneをDynamicBoneに変換するツールを導入して変換する
今回はPhysBone-Converterを使用しましたが、他のツールでも問題ありません
![](https://assets.st-note.com/img/1691298137426-1zOEe15fWa.png?width=1200)
アバターをアップロードする
![](https://assets.st-note.com/img/1691298338483-JxG1wKQgWL.png?width=1200)
![](https://assets.st-note.com/img/1691298618742-m7MjuqO30C.png?width=1200)
※アバターはファルリアちゃんを使用しています
以下、技術的な話
今回書き換えたコードはPackages以下のVRCSDKのコードなので、VRCSDKを更新すると上書きされる可能性が高いです。
なので、VRCSDKを更新して変更が失われた場合は、再度対応する必要があります。
また、仕様変更によりこの方法が通用しなくなる場合があります。
エラー修復内容について
Packages\com.vrchat.base\Editor\VRCSDK\Dependencies\VRChat\EnvConfig.cs(467,32): error CS0117: 'PlayerSettings' does not contain a definition for 'SetVirtualRealitySDKs'
※エラーログをダブルクリックするとエディターが開きます
EnvConfig.cs
if(!EditorApplication.isPlaying)
{
#pragma warning disable 618
PlayerSettings.SetVirtualRealitySDKs(buildTargetGroup, sdkNames);
#pragma warning restore 618
}
コメントアウトします
※先頭に「//」を追加するとコメントアウト(無効なコード)になります
if(!EditorApplication.isPlaying)
{
#pragma warning disable 618
//PlayerSettings.SetVirtualRealitySDKs(buildTargetGroup, sdkNames);
#pragma warning restore 618
}
Packages\com.vrchat.base\Editor\VRCSDK\Dependencies\VRChat\EnvConfig.cs(1196,17): error CS0103: The name 'il2CppAdditionalArgs' does not exist in the current context
EnvConfig.cs
#if UNITY_2021_3_OR_NEWER
// IL2CPP struggles with generics in unity 2021 and will not generate some code the UdonBehaviour needs
// A blog post is available for more information here:
// https://blog.unity.com/engine-platform/il2cpp-full-generic-sharing-in-unity-2022-1-beta
// increasing this setting will cause longer builds
il2CppAdditionalArgs.Add("--generic-virtual-method-iterations=2");
#endif
コメントアウトします
#if UNITY_2021_3_OR_NEWER
// IL2CPP struggles with generics in unity 2021 and will not generate some code the UdonBehaviour needs
// A blog post is available for more information here:
// https://blog.unity.com/engine-platform/il2cpp-full-generic-sharing-in-unity-2022-1-beta
// increasing this setting will cause longer builds
//il2CppAdditionalArgs.Add("--generic-virtual-method-iterations=2");
#endif
すると新たなエラーが発生します
Packages\com.vrchat.avatars\Editor\VRCSDK\SDK3A\Components3\VRCAvatarParameterDriverEditor.cs(6,7): error CS0246: The type or namespace name 'Boo' could not be found (are you missing a using directive or an assembly reference?)
VRCAvatarParameterDriverEditor.cs
using Boo.Lang;
コメントアウトします
//using Boo.Lang;
すると新たなエラーが発生します
Packages\com.vrchat.avatars\Editor\VRCSDK\SDK3A\Components3\VRCAvatarParameterDriverEditor.cs(27,4): error CS0246: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?)
Packages\com.vrchat.avatars\Editor\VRCSDK\SDK3A\Components3\VRCAvatarParameterDriverEditor.cs(27,29): error CS0246: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?)
Packages\com.vrchat.avatars\Editor\VRCSDK\SDK3A\Components3\VRCAvatarParameterDriverEditor.cs(28,4): error CS0246: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?)
Packages\com.vrchat.avatars\Editor\VRCSDK\SDK3A\Components3\VRCAvatarParameterDriverEditor.cs(28,54): error CS0246: The type or namespace name 'List<>' could not be found (are you missing a using directive or an assembly reference?)
VRCAvatarParameterDriverEditor.cs
コードを追加します
#if VRC_SDK_VRCSDK3
using UnityEngine;
using UnityEditor;
using VRC.SDK3.Avatars.Components;
using static VRC.SDKBase.VRC_AvatarParameterDriver;
//using Boo.Lang;
using System;
using System.Collections.Generic; <-- 追加する
SetVirtualRealitySDKsについて
PlayerSettings-SetVirtualRealitySDKs - Unity スクリプトリファレンス
おそらくUnity2020でXR Plugin Managementが導入され、それにより廃止になったようです。
Unity - Manual: XR Plugin Management
今回は、VRCSDK自体を使うわけではないため、コメントアウトしました。
ちなみに、#pragma warning disable 618の618はObsoleteの警告でした。
コンパイラの警告 (レベル 2) CS0618 | Microsoft Learn
il2CppAdditionalArgsについて
// IL2CPPはunity 2021のジェネリックと格闘し、UdonBehaviourが必要とするいくつかのコードを生成しません。
// 詳細はブログの記事を参照してください:
// https://blog.unity.com/engine-platform/il2cpp-full-generic-sharing-in-unity-2022-1-beta
// この設定を増やすと、ビルドが長くなります。
機能プレビュー:Unity 2022.1 ベータ版の IL2CPP Full Generic Sharing | Unity Blog
高度な話なのであまり理解はできませんでしたが、
ジェネリック使用時に、バイト数がobject型(8バイト)と異なる型を使用した場合に、それに合致するコードを探すor生成する機能なのかな?と思いました。
今回は、VRCSDK自体を使うわけではないため、コメントアウトしました。
この記事が気に入ったらサポートをしてみませんか?