clearNodeParent

  • Clears the parent of the given Node, leaving it attached directly to its Scene. Inherited transforms will be applied to the Node. This operation changes the Node's local transform, but leaves its world transform unchanged.

    Example:

    import { clearNodeParent } from '@gltf-transform/functions';
    
    scene.traverse((node) => { ... }); // Scene → … → Node
    
    clearNodeParent(node);
    
    scene.traverse((node) => { ... }); // Scene → Node
    

    To clear all transforms of a Node, first clear its inherited transforms with clearNodeParent, then clear the local transform with clearNodeTransform.

Function symbol, where the argument and output are a box labeled 'glTF'.

Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.