mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-17 12:12:10 -04:00
automatically reparent DistributedNode to its parent
This commit is contained in:
parent
82186733d1
commit
5c2d4f40d8
@ -34,6 +34,13 @@ class DistributedNode(DistributedObject.DistributedObject, NodePath):
|
|||||||
def generate(self):
|
def generate(self):
|
||||||
DistributedObject.DistributedObject.generate(self)
|
DistributedObject.DistributedObject.generate(self)
|
||||||
self.gotStringParentToken = 0
|
self.gotStringParentToken = 0
|
||||||
|
if wantOtpServer:
|
||||||
|
parentId, zoneId = self.getLocation()
|
||||||
|
# reparent to parent
|
||||||
|
parent = base.cr.doId2do.get(parentId)
|
||||||
|
if parent and isinstance(parent, NodePath):
|
||||||
|
self.reparentTo(parent)
|
||||||
|
|
||||||
|
|
||||||
def __cmp__(self, other):
|
def __cmp__(self, other):
|
||||||
# DistributedNode inherits from NodePath, which inherits a
|
# DistributedNode inherits from NodePath, which inherits a
|
||||||
|
Loading…
x
Reference in New Issue
Block a user