From 62208fa7cc98246a63ec55319589608c7c230496 Mon Sep 17 00:00:00 2001 From: Mark Mine Date: Thu, 19 Dec 2002 22:39:46 +0000 Subject: [PATCH] Forgot to CVS ADd function to return node path collection as lisTd --- .../extensions/NodePathCollection-extensions.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 direct/src/extensions/NodePathCollection-extensions.py diff --git a/direct/src/extensions/NodePathCollection-extensions.py b/direct/src/extensions/NodePathCollection-extensions.py new file mode 100644 index 0000000000..af978b0dc4 --- /dev/null +++ b/direct/src/extensions/NodePathCollection-extensions.py @@ -0,0 +1,16 @@ + + """ + NodePathCollection-extensions module: contains methods to extend + functionality of the NodePathCollection class + """ + + # For iterating over children + def asList(self): + """Converts a NodePathCollection into a list""" + if self.isEmpty(): + return [] + else: + npList = [] + for nodePathIndex in range(self.getNumPaths()): + npList.append(self.getPath(nodePathIndex)) + return npList