From 5cf922e4a0ce5077361c50b24b3a8be6b12c40e9 Mon Sep 17 00:00:00 2001 From: ousttrue Date: Tue, 23 Mar 2021 15:30:08 +0900 Subject: [PATCH] =?UTF-8?q?blendShape=E3=81=8C=E5=90=8D=E7=84=A1=E3=81=97?= =?UTF-8?q?=E3=81=AE=E5=A0=B4=E5=90=88=E3=81=AB=E9=80=A3=E7=95=AA=E3=82=92?= =?UTF-8?q?=E4=BB=98=E3=81=91=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gltf_mesh_extras_targetNames.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Assets/UniGLTF/Runtime/UniGLTF/Format/ExtensionsAndExtras/gltf_mesh_extras_targetNames.cs b/Assets/UniGLTF/Runtime/UniGLTF/Format/ExtensionsAndExtras/gltf_mesh_extras_targetNames.cs index 314b79d44..f1036bb61 100644 --- a/Assets/UniGLTF/Runtime/UniGLTF/Format/ExtensionsAndExtras/gltf_mesh_extras_targetNames.cs +++ b/Assets/UniGLTF/Runtime/UniGLTF/Format/ExtensionsAndExtras/gltf_mesh_extras_targetNames.cs @@ -58,6 +58,21 @@ namespace UniGLTF } } + if (mesh.primitives.Count > 0) + { + var prim = mesh.primitives[0]; + if (prim.targets.Count > 0) + { + // 名無しには連番を付ける + targetNames = new List(); + for (int i = 0; i < prim.targets.Count; ++i) + { + targetNames.Add($"{i}"); + } + return true; + } + } + targetNames = default; return false; }