소스 검색

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;
         }