Skip to content

Commit

Permalink
add: AfterSceneExport callback to allow for custom export modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
hybridherbst committed Dec 4, 2021
1 parent 15b796c commit 4254720
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,14 @@ public ExportOptions()
if(settings.UseMainCameraVisibility)
ExportLayers = Camera.main ? Camera.main.cullingMask : -1;
}

public GLTFSceneExporter.AfterSceneExportDelegate AfterSceneExport;
}

public class GLTFSceneExporter
{
public delegate string RetrieveTexturePathDelegate(Texture texture);
public delegate void AfterSceneExportDelegate(GLTFSceneExporter exporter, GLTFRoot gltfRoot);

private enum IMAGETYPE
{
Expand Down Expand Up @@ -340,6 +343,9 @@ public void SaveGLBToStream(Stream stream, string sceneName)
}
}

if (_exportOptions.AfterSceneExport != null)
_exportOptions.AfterSceneExport(this, _root);

_buffer.ByteLength = CalculateAlignment((uint)_bufferWriter.BaseStream.Length, 4);

_root.Serialize(jsonWriter, true);
Expand Down

0 comments on commit 4254720

Please sign in to comment.