From 8b1aa5c90a17e2825916b50ec267d3977fddbf0b Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Thu, 16 Jun 2005 19:43:25 +0000 Subject: [PATCH] allow POD to grab values off of similar objects --- direct/src/showbase/PythonUtil.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 203b550215..1e1ff24f3b 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -1173,7 +1173,12 @@ class POD: # extract our dataset from an existing POD instance obj = args[0] for name in self.getDataNames(): - setattr(self, name, getattr(obj, name)) + # if the other obj doesn't have this data item, stick to the + # default + if hasattr(obj, name): + setattr(self, name, getattr(obj, name)) + else: + setattr(self, name, self.getDefaultValue(name)) else: assert len(args) == 0 if __debug__: