mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-07 19:38:13 -05:00
Merge pull request #1914 from ousttrue/fix10/export_option
[1.0] morph target の accessor に sparse を使うか否かのオプションを実装
This commit is contained in:
@@ -10,20 +10,23 @@ namespace UniVRM10
|
||||
/// <summary>
|
||||
/// エクスポート時にBlendShapeClipから参照されないBlendShapeを削除する
|
||||
/// </summary>
|
||||
[Tooltip("Remove blendshape that is not used from BlendShapeClip")]
|
||||
[Tooltip("not implemented yet. Remove blendshape that is not used from BlendShapeClip")][ReadOnly]
|
||||
public bool ReduceBlendshape = false;
|
||||
|
||||
/// <summary>
|
||||
/// skip if BlendShapeClip.Preset == Unknown
|
||||
/// </summary>
|
||||
[Tooltip("Remove blendShapeClip that preset is Unknown")]
|
||||
[Tooltip("not implemented yet. Remove blendShapeClip that preset is Unknown")][ReadOnly]
|
||||
public bool ReduceBlendshapeClip = false;
|
||||
|
||||
[Tooltip("Use sparse accessor for morph target")]
|
||||
public bool MorphTargetUseSparse = true;
|
||||
|
||||
public GltfExportSettings MeshExportSettings => new GltfExportSettings
|
||||
{
|
||||
UseSparseAccessorForMorphTarget = true,
|
||||
UseSparseAccessorForMorphTarget = MorphTargetUseSparse,
|
||||
ExportOnlyBlendShapePosition = true,
|
||||
DivideVertexBuffer = true,
|
||||
DivideVertexBuffer = true,
|
||||
};
|
||||
|
||||
public GameObject Root { get; set; }
|
||||
|
||||
@@ -277,8 +277,11 @@ namespace UniVRM10
|
||||
model.ConvertCoordinate(VrmLib.Coordinates.Vrm1, ignoreVrm: false);
|
||||
|
||||
// export vrm-1.0
|
||||
var exporter = new UniVRM10.Vrm10Exporter(new EditorTextureSerializer(), new GltfExportSettings());
|
||||
var option = new VrmLib.ExportArgs();
|
||||
var exporter = new UniVRM10.Vrm10Exporter(new EditorTextureSerializer(), m_settings.MeshExportSettings);
|
||||
var option = new VrmLib.ExportArgs
|
||||
{
|
||||
sparse = m_settings.MorphTargetUseSparse,
|
||||
};
|
||||
exporter.Export(root, model, converter, option, Vrm ? Vrm.Meta : m_tmpObject.Meta);
|
||||
|
||||
var exportedBytes = exporter.Storage.ToGlbBytes();
|
||||
|
||||
Reference in New Issue
Block a user