Removes properties from the file if they are not referenced by a Scene. Commonly helpful
for cleaning up after other operations, e.g. allowing a node to be detached and any unused
meshes, materials, or other resources to be removed automatically.
Use PruneOptions to control what content should be pruned. For example, you can preserve
empty objects in the scene hierarchy using the option keepLeaves.
Removes properties from the file if they are not referenced by a Scene. Commonly helpful for cleaning up after other operations, e.g. allowing a node to be detached and any unused meshes, materials, or other resources to be removed automatically.
Example:
document.getRoot().listMaterials(); // → [Material, Material] await document.transform(prune()); document.getRoot().listMaterials(); // → [Material]
Use PruneOptions to control what content should be pruned. For example, you can preserve empty objects in the scene hierarchy using the option
keepLeaves
.