diff --git a/panda/src/pgraph/nodePathCollection.cxx b/panda/src/pgraph/nodePathCollection.cxx index 2ecb0fa505..e0ea40c049 100644 --- a/panda/src/pgraph/nodePathCollection.cxx +++ b/panda/src/pgraph/nodePathCollection.cxx @@ -366,6 +366,18 @@ unstash() { } } +//////////////////////////////////////////////////////////////////// +// Function: NodePathCollection::detach +// Access: Published +// Description: Detaches all NodePaths in the collection. +//////////////////////////////////////////////////////////////////// +void NodePathCollection:: +detach() { + for (int i = 0; i < get_num_paths(); i++) { + get_path(i).detach_node(); + } +} + //////////////////////////////////////////////////////////////////// // Function: NodePathCollection::output // Access: Published diff --git a/panda/src/pgraph/nodePathCollection.h b/panda/src/pgraph/nodePathCollection.h index 33ebe9c707..9054266c98 100644 --- a/panda/src/pgraph/nodePathCollection.h +++ b/panda/src/pgraph/nodePathCollection.h @@ -62,6 +62,7 @@ PUBLISHED: void hide(); void stash(); void unstash(); + void detach(); void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const;