mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
specific lod lookup for useLOD. Should prevent the sorting problems we've been seeing
This commit is contained in:
parent
a10f7a2b8c
commit
877404d8a9
@ -554,16 +554,6 @@ class Actor(DirectObject, NodePath):
|
|||||||
def __updateSortedLODNames(self):
|
def __updateSortedLODNames(self):
|
||||||
# Cache the sorted LOD names so we dont have to grab them
|
# Cache the sorted LOD names so we dont have to grab them
|
||||||
# and sort them every time somebody asks for the list
|
# 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()
|
self.__sortedLODNames = self.__partBundleDict.keys()
|
||||||
# Reverse sort the doing a string->int
|
# Reverse sort the doing a string->int
|
||||||
def sortFunc(x, y):
|
def sortFunc(x, y):
|
||||||
@ -647,8 +637,8 @@ class Actor(DirectObject, NodePath):
|
|||||||
# and pollute the the switches dictionary
|
# and pollute the the switches dictionary
|
||||||
## sortedKeys = self.switches.keys()
|
## sortedKeys = self.switches.keys()
|
||||||
## sortedKeys.sort()
|
## sortedKeys.sort()
|
||||||
sortedKeys = self.__sortedLODNames
|
child = self.__LODNode.find(str(lodName))
|
||||||
index = sortedKeys.index(str(lodName))
|
index = self.__LODNode.node().findChild(child.node())
|
||||||
self.__LODNode.node().forceSwitch(index)
|
self.__LODNode.node().forceSwitch(index)
|
||||||
|
|
||||||
def printLOD(self):
|
def printLOD(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user