浏览代码

wrtReparent to parent

Samir Naik 21 年之前
父节点
当前提交
840d2bdc6e
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      direct/src/distributed/DistributedNode.py

+ 3 - 1
direct/src/distributed/DistributedNode.py

@@ -39,7 +39,9 @@ class DistributedNode(DistributedObject.DistributedObject, NodePath):
             # reparent to parent
             # reparent to parent
             parent = base.cr.doId2do.get(parentId)
             parent = base.cr.doId2do.get(parentId)
             if parent and isinstance(parent, NodePath):
             if parent and isinstance(parent, NodePath):
-                self.reparentTo(parent)
+                if self.getParent() != parent:
+                    print "generate: reparenting %s to %s" % (self, parent)
+                    self.wrtReparentTo(parent)
             
             
 
 
     def __cmp__(self, other):
     def __cmp__(self, other):