mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 17:35:34 -04:00
allow POD to grab values off of similar objects
This commit is contained in:
parent
9bf60050f6
commit
8b1aa5c90a
@ -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__:
|
||||
|
Loading…
x
Reference in New Issue
Block a user