From 988acd00f10e5334ea2903b0ef7b0df2b6529f9b Mon Sep 17 00:00:00 2001 From: Alexis Breust Date: Fri, 5 Jan 2018 10:08:17 +0100 Subject: [PATCH] Using relative buffers URI --- code/glTF2AssetWriter.inl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/code/glTF2AssetWriter.inl b/code/glTF2AssetWriter.inl index 6b1a50887..2f9b8cb68 100644 --- a/code/glTF2AssetWriter.inl +++ b/code/glTF2AssetWriter.inl @@ -156,7 +156,10 @@ namespace glTF2 { inline void Write(Value& obj, Buffer& b, AssetWriter& w) { obj.AddMember("byteLength", static_cast(b.byteLength), w.mAl); - obj.AddMember("uri", Value(b.GetURI(), w.mAl).Move(), w.mAl); + + const auto uri = b.GetURI(); + const auto relativeUri = uri.substr(uri.find_last_of("/\\") + 1u); + obj.AddMember("uri", Value(relativeUri, w.mAl).Move(), w.mAl); } inline void Write(Value& obj, BufferView& bv, AssetWriter& w)