From 43b82212fb69b4c62f10217ac8d74c7bba185df8 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Fri, 23 Jan 2026 15:06:46 -0600 Subject: [PATCH] new --- gltf.cm | 8 ++++---- tests/readout.ce | 31 ------------------------------- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/gltf.cm b/gltf.cm index dc9e2a3..09946ae 100644 --- a/gltf.cm +++ b/gltf.cm @@ -64,7 +64,7 @@ function parse_data_uri(uri) { var parts = array(meta, ";") if (parts[0]) mime = parts[0] for (var i = 1; i < length(parts); i++) { - if (parts[i]) == "base64") is_base64 = true + if (parts[i] == "base64") is_base64 = true } } @@ -297,8 +297,8 @@ function used_image_indices(asset) { arrfor(array(used_tex), function(k) { var ti = number(k) var t = textures[ti] - if (!t) continue - if (t.image == null) continue + if (!t) return + if (t.image == null) return used_imgs[t.image] = true }) @@ -427,7 +427,7 @@ gltf.pull_images = function(asset, opts) { function guess_mime(img) { if (img.mime) return img.mime if (img.uri) { - var u = img.uri) + var u = img.uri if (ends_with(u, ".png")) return "image/png" if (ends_with(u, ".jpg") || ends_with(u, ".jpeg")) return "image/jpeg" } diff --git a/tests/readout.ce b/tests/readout.ce index e1c21f7..0de9585 100644 --- a/tests/readout.ce +++ b/tests/readout.ce @@ -48,37 +48,6 @@ def print_array = function(arr, indent) { } } -def print_object = function(obj, indent) { - if (!indent) indent = "" - var keys = array(obj) - for (var i = 0; i < length(keys); i++) { - var key = keys[i] - var val = obj[key] - if (val == null) { - log.console(`${indent}${key}: null`) - } else if (val.constructor && val.constructor.name == 'Blob') { - log.console(`${indent}${key}: `) - } else if (is_array(val)) { - if (length(val) == 0) { - log.console(`${indent}${key}: []`) - } else if (length(val) <= 4 && !is_object(val[0])) { - log.console(`${indent}${key}: [${text(val, ', ')}]`) - } else if (!is_object(val[0])) { - log.console(`${indent}${key}: [${text(array(val, 0, 4), ', ')}...] (${length(val)} items)`) - } else { - log.console(`${indent}${key}: (${length(val)} items)`) - print_array(val, indent + " ") - } - } else { - log.console(`${indent}${key}:`) - print_object(val, indent + " ") - } - } else { - log.console(`${indent}${key}: ${val}`) - } - } -} - log.console(`\n=== Model Structure: ${filepath} ===\n`) log.console(`Buffers: ${length(model.buffers)}`)