mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
add __hash__, getName now defined in Panda
This commit is contained in:
parent
0b8b4f9cef
commit
b2e0b4395e
@ -8,19 +8,8 @@
|
||||
"""Returns a unique id identifying the NodePath instance"""
|
||||
return self.getKey()
|
||||
|
||||
def getName(self):
|
||||
"""Returns the name of the bottom node if it exists, or <noname>"""
|
||||
node = self.node()
|
||||
if hasattr(node, "getName"):
|
||||
return node.getName()
|
||||
|
||||
return '<noname>'
|
||||
|
||||
def setName(self, name = '<noname>'):
|
||||
"""Sets the name of the bottom node if it can be set."""
|
||||
node = self.node()
|
||||
if hasattr(node, "setName"):
|
||||
node.setName(name)
|
||||
def __hash__(self):
|
||||
return self.getKey()
|
||||
|
||||
# For iterating over children
|
||||
def getChildrenAsList(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user