From 82a863831c5f6f4a8bdd7b92494de35ac5008d7c Mon Sep 17 00:00:00 2001 From: "Asad M. Zaman" Date: Thu, 16 Aug 2007 19:40:19 +0000 Subject: [PATCH] properly cleans up nametags --- direct/src/actor/Actor.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 3bd4b690fb..d5c2f075e6 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -327,9 +327,15 @@ class Actor(DirectObject, NodePath): # assign these elements to ourselve (overwrite) self.assign(otherCopy) else: - # just copy these to ourselve + # just copy these to ourselves otherCopy = other.copyTo(self) - self.setGeomNode(otherCopy.getChild(0)) + # masad: check if otherCopy has a geomNode as its first child + # if actor is initialized with flattenable, then otherCopy, not + # its first child, is the geom node; check __init__, for reference + if other.getGeomNode().getName() == other.getName(): + self.setGeomNode(otherCopy) + else: + self.setGeomNode(otherCopy.getChild(0)) # copy the switches for lods self.switches = other.switches