From 877404d8a9eb6153fb6e8b5321116098a403393d Mon Sep 17 00:00:00 2001 From: Zachary Pavlov Date: Wed, 19 Nov 2008 00:06:03 +0000 Subject: [PATCH] specific lod lookup for useLOD. Should prevent the sorting problems we've been seeing --- direct/src/actor/Actor.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 5f494a6f99..8c6a89388f 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -554,16 +554,6 @@ class Actor(DirectObject, NodePath): def __updateSortedLODNames(self): # Cache the sorted LOD names so we dont have to grab them # and sort them every time somebody asks for the list - if(self.__hasLOD): - lodnode = self.__LODNode.node() - switchRange = range(lodnode.getNumSwitches()) - switchList = [lodnode.getIn(x) for x in switchRange] - nameList = [self.__LODNode.getChild(x).getName() for x in switchRange] - sortedList = zip(switchList, nameList) - sortedList.sort() - self.__sortedLODNames = [x[1] for x in sortedList] - return - self.__sortedLODNames = self.__partBundleDict.keys() # Reverse sort the doing a string->int def sortFunc(x, y): @@ -647,8 +637,8 @@ class Actor(DirectObject, NodePath): # and pollute the the switches dictionary ## sortedKeys = self.switches.keys() ## sortedKeys.sort() - sortedKeys = self.__sortedLODNames - index = sortedKeys.index(str(lodName)) + child = self.__LODNode.find(str(lodName)) + index = self.__LODNode.node().findChild(child.node()) self.__LODNode.node().forceSwitch(index) def printLOD(self):