mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-08-27 21:34:38 -05:00
rename
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user