فهرست منبع

Regenerate CacheBoneDataArray when appropriate.

NPR Shader seems to do something that nulls the cache bone data so when
getting the cache, check if the bone data is null and regenerate.
habeebweeb 4 سال پیش
والد
کامیت
386fb1f4cb
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/Meido.cs

+ 7 - 1
COM3D2.MeidoPhotoStudio.Plugin/MeidoPhotoStudio/Meido/Meido.cs

@@ -677,10 +677,16 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
         private CacheBoneDataArray GetCacheBoneData()
         {
             CacheBoneDataArray cache = Maid.gameObject.GetComponent<CacheBoneDataArray>();
+            void CreateCache() => cache.CreateCache(Body.GetBone("Bip01"));
             if (cache == null)
             {
                 cache = Maid.gameObject.AddComponent<CacheBoneDataArray>();
-                cache.CreateCache(Body.GetBone("Bip01"));
+                CreateCache();
+            }
+            if (cache.bone_data?.transform == null)
+            {
+                Utility.LogDebug("Cache bone_data is null");
+                CreateCache();
             }
             return cache;
         }