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):