This commit is contained in:
ousttrue
2021-04-26 13:59:37 +09:00
parent 64077a4ab1
commit 74cae0eec7
3 changed files with 5 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ using UnityEngine;
namespace UniVRM10
{
public static class MeshLoader
public static class MeshImporter
{
/// <summary>
/// VrmLib.Mesh => UnityEngine.Mesh
@@ -11,7 +11,7 @@ namespace UniVRM10
/// <param name="mesh"></param>
/// <param name="src"></param>
/// <param name="skin"></param>
public static void LoadMesh(this UnityEngine.Mesh mesh, VrmLib.Mesh src, VrmLib.Skin skin = null)
public static void LoadSharedMesh(UnityEngine.Mesh mesh, VrmLib.Mesh src, VrmLib.Skin skin = null)
{
mesh.vertices = src.VertexBuffer.Positions.GetSpan<Vector3>().ToArray();
mesh.normals = src.VertexBuffer.Normals?.GetSpan<Vector3>().ToArray();

View File

@@ -28,7 +28,7 @@ namespace UniVRM10
{
Model = new VrmLib.Model(VrmLib.Coordinates.Unity);
ToGlbModel(root);
Export(root);
// humanoid
{
@@ -52,7 +52,7 @@ namespace UniVRM10
return Model;
}
public VrmLib.Model ToGlbModel(GameObject root)
VrmLib.Model Export(GameObject root)
{
if (Model == null)
{

View File

@@ -141,7 +141,7 @@ namespace UniVRM10
// submesh 方式
var mesh = new UnityEngine.Mesh();
mesh.name = src.Name;
mesh.LoadMesh(src.Meshes[0], src.Skin);
MeshImporter.LoadSharedMesh(mesh, src.Meshes[0], src.Skin);
m_map.Meshes.Add(src, mesh);
Meshes.Add(new MeshWithMaterials
{