mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-04-24 15:08:02 -05:00
add ExportUvSecondary.ExportUvSecondary. but always false
This commit is contained in:
parent
5221a885ca
commit
f4a2150c8a
|
|
@ -29,7 +29,7 @@ namespace UniGLTF
|
|||
public bool ExportOnlyBlendShapePosition;
|
||||
|
||||
/// <summary>
|
||||
/// tangent を出力する
|
||||
/// Export TANGENT
|
||||
/// </summary>
|
||||
public bool ExportTangents
|
||||
#if GLTF_EXPORT_TANGENTS
|
||||
|
|
@ -38,9 +38,9 @@ namespace UniGLTF
|
|||
;
|
||||
|
||||
/// <summary>
|
||||
/// Keep VertexColor
|
||||
/// Export COLOR_0
|
||||
/// </summary>
|
||||
public bool KeepVertexColor;
|
||||
public bool ExportVertexColor;
|
||||
|
||||
/// <summary>
|
||||
/// https://github.com/vrm-c/UniVRM/issues/1582
|
||||
|
|
@ -48,5 +48,10 @@ namespace UniGLTF
|
|||
/// Allowed hide flags for MeshFilters to be exported
|
||||
/// </summary>
|
||||
public HideFlags MeshFilterAllowedHideFlags = HideFlags.None;
|
||||
|
||||
/// <summary>
|
||||
/// Export TEXCOORD_1
|
||||
/// </summary>
|
||||
public bool ExportUvSecondary;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ namespace UniGLTF
|
|||
|
||||
var vColorState = VertexColorUtility.DetectVertexColor(mesh, unityMaterials);
|
||||
var exportVertexColor = (
|
||||
(settings.KeepVertexColor && mesh.colors != null && mesh.colors.Length == mesh.vertexCount) // vertex color を残す設定
|
||||
(settings.ExportVertexColor && mesh.colors != null && mesh.colors.Length == mesh.vertexCount) // vertex color を残す設定
|
||||
|| vColorState == VertexColorState.ExistsAndIsUsed // VColor使っている
|
||||
|| vColorState == VertexColorState.ExistsAndMixed // VColorを使っているところと使っていないところが混在(とりあえずExportする)
|
||||
);
|
||||
|
|
|
|||
|
|
@ -43,12 +43,16 @@ namespace UniGLTF
|
|||
}
|
||||
|
||||
var uvAccessorIndex0 = data.ExtendBufferAndGetAccessorIndex(mesh.uv.Select(y => y.ReverseUV()).ToArray(), glBufferTarget.ARRAY_BUFFER);
|
||||
var uvAccessorIndex1 = data.ExtendBufferAndGetAccessorIndex(mesh.uv2.Select(y => y.ReverseUV()).ToArray(), glBufferTarget.ARRAY_BUFFER);
|
||||
|
||||
var uvAccessorIndex1 = -1;
|
||||
if (settings.ExportUvSecondary)
|
||||
{
|
||||
uvAccessorIndex1 = data.ExtendBufferAndGetAccessorIndex(mesh.uv2.Select(y => y.ReverseUV()).ToArray(), glBufferTarget.ARRAY_BUFFER);
|
||||
}
|
||||
|
||||
var colorAccessorIndex = -1;
|
||||
|
||||
var vColorState = VertexColorUtility.DetectVertexColor(mesh, materials);
|
||||
if ((settings.KeepVertexColor && mesh.colors != null && mesh.colors.Length == mesh.vertexCount) // vertex color を残す設定
|
||||
if ((settings.ExportVertexColor && mesh.colors != null && mesh.colors.Length == mesh.vertexCount) // vertex color を残す設定
|
||||
|| vColorState == VertexColorState.ExistsAndIsUsed // VColor使っている
|
||||
|| vColorState == VertexColorState.ExistsAndMixed // VColorを使っているところと使っていないところが混在(とりあえずExportする)
|
||||
)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ namespace VRM
|
|||
UseSparseAccessorForMorphTarget = UseSparseAccessor,
|
||||
ExportOnlyBlendShapePosition = OnlyBlendshapePosition,
|
||||
DivideVertexBuffer = DivideVertexBuffer,
|
||||
KeepVertexColor = KeepVertexColor,
|
||||
ExportVertexColor = KeepVertexColor,
|
||||
};
|
||||
|
||||
public GameObject Root { get; set; }
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user