From 3fcd2a764e54934a62e3cc02335eae45d4ce9297 Mon Sep 17 00:00:00 2001 From: Zachary Pavlov Date: Thu, 7 May 2009 18:56:33 +0000 Subject: [PATCH] fix for actor setLOD --- direct/src/actor/Actor.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index bc1980a9b1..d5379aa6a3 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -700,10 +700,14 @@ class Actor(DirectObject, NodePath): # add the switch distance info ## sortedKeys = self.switches.keys() ## sortedKeys.sort() - sortedKeys = self.__sortedLODNames - index = sortedKeys.index(str(lodName)) - self.__LODNode.node().setSwitch(index, inDist, outDist) + self.__LODNode.node().setSwitch(self.getLODIndex(lodName), inDist, outDist) + def getLODIndex(self, lodName): + """getLODIndex(self) + safe method (but expensive) for retrieving the child index + """ + return list(self.__LODNode.getChildren()).index(self.getLOD(lodName)) + def getLOD(self, lodName): """getLOD(self, string) Get the named node under the LOD to which we parent all LOD