Using relative buffers URI

pull/1681/head
Alexis Breust 2018-01-05 10:08:17 +01:00
parent abb09cc1d8
commit 988acd00f1
1 changed files with 4 additions and 1 deletions

View File

@ -156,7 +156,10 @@ namespace glTF2 {
inline void Write(Value& obj, Buffer& b, AssetWriter& w)
{
obj.AddMember("byteLength", static_cast<uint64_t>(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)