Esc

gltf_remove_extension

procedureextensionsince 0.36.1Source
  • macOS: gltf_remove_extension works on macOS
  • Linux: gltf_remove_extension works on Linux
  • Windows: gltf_remove_extension works on Windows
  • Wasm: gltf_remove_extension works on Wasm

Remove the extension name from the extensions of a document, node, material or texture reference of asset: the undo of gltf_set_extension. Once no object of the asset has the extension any more, its name also leaves extensionsUsed and extensionsRequired, so the asset still writes and loads. The result is false when extensions had no such member. extensions must belong to asset.

Signature

gltf_remove_extension :: (
    asset: *Gltf_Asset,
    extensions: *Json_Value,
    name: string
) -> bool
Example↗
asset, error := gltf_load("{\"asset\":{\"version\":\"2.0\"},\"extensionsUsed\":[\"KHR_materials_ior\"],\"materials\":[{\"extensions\":{\"KHR_materials_ior\":{\"ior\":1.33}}}]}");
assert(error.kind == .NONE);
defer gltf_free(*asset);
assert(gltf_remove_extension(*asset, *asset.document.materials[0].extensions, "KHR_materials_ior"));
assert(asset.document.extensions_used.count == 0);

See also