Skip to content

Commit abfedec

Browse files
committed
Do not load buffer data urls in gltf, parse them directly instead
1 parent 45ca30f commit abfedec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/io/gltf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn dependencies(raw_assets: &RawAssets, path: &PathBuf) -> HashSet<PathBuf>
1010
for buffer in document.buffers() {
1111
if let ::gltf::buffer::Source::Uri(uri) = buffer.source() {
1212
if uri.starts_with("data:") {
13-
dependencies.insert(PathBuf::from(uri));
13+
// data urls does not need to be loaded, will be deserialized from the data in the url instead
1414
} else {
1515
dependencies.insert(base_path.join(uri));
1616
}
@@ -39,7 +39,7 @@ pub fn deserialize_gltf(raw_assets: &mut RawAssets, path: &PathBuf) -> Result<Sc
3939
let mut data = match buffer.source() {
4040
::gltf::buffer::Source::Uri(uri) => {
4141
if uri.starts_with("data:") {
42-
raw_assets.remove(uri)?
42+
super::parse_data_url(uri)?
4343
} else {
4444
raw_assets.remove(base_path.join(uri))?
4545
}

0 commit comments

Comments
 (0)