From fdc9d8fd533073d827d2810c29ffd18582b74ae1 Mon Sep 17 00:00:00 2001 From: Zachary Pavlov Date: Tue, 18 Nov 2008 21:03:06 +0000 Subject: [PATCH] updated sorting algorithm for lods --- direct/src/actor/Actor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 8cad60dad9..5f494a6f99 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -554,6 +554,16 @@ 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):