mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -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"""
|
"""Returns a unique id identifying the NodePath instance"""
|
||||||
return self.getKey()
|
return self.getKey()
|
||||||
|
|
||||||
def getName(self):
|
def __hash__(self):
|
||||||
"""Returns the name of the bottom node if it exists, or <noname>"""
|
return self.getKey()
|
||||||
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)
|
|
||||||
|
|
||||||
# For iterating over children
|
# For iterating over children
|
||||||
def getChildrenAsList(self):
|
def getChildrenAsList(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user