Browse Source

more better lodname handling

David Rose 17 years ago
parent
commit
48c395e10e
1 changed files with 11 additions and 6 deletions
  1. 11 6
      direct/src/actor/Actor.py

+ 11 - 6
direct/src/actor/Actor.py

@@ -392,9 +392,12 @@ class Actor(DirectObject, NodePath):
         """Handy utility function to list the joint hierarchy of the
         """Handy utility function to list the joint hierarchy of the
         actor. """
         actor. """
 
 
-        partBundleDict = self.__partBundleDict.get(lodName)
-        if not partBundleDict:
-            Actor.notify.error("no lod named: %s" % (lodName))
+        if self.mergeLODBundles:
+            partBundleDict = self.__commonBundleHandles
+        else:
+            partBundleDict = self.__partBundleDict.get(lodName)
+            if not partBundleDict:
+                Actor.notify.error("no lod named: %s" % (lodName))
 
 
         subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
         subpartDef = self.__subpartDict.get(partName, Actor.SubpartDef(partName))
 
 
@@ -1090,10 +1093,10 @@ class Actor(DirectObject, NodePath):
         pattern = GlobPattern(jointName)
         pattern = GlobPattern(jointName)
 
 
         if lodName == None and self.mergeLODBundles:
         if lodName == None and self.mergeLODBundles:
-            # Get any LOD.
-            lodName = self.__partBundleDict.keys()[0]
+            # Get the common bundle.
+            partBundleDicts = [self.__commonBundleHandles]
 
 
-        if lodName == None:
+        elif lodName == None:
             # Get all LOD's.
             # Get all LOD's.
             partBundleDicts = self.__partBundleDict.values()
             partBundleDicts = self.__partBundleDict.values()
         else:
         else:
@@ -2396,6 +2399,8 @@ class Actor(DirectObject, NodePath):
 
 
         if lodName is None:
         if lodName is None:
             lodNames = self.getLODNames()
             lodNames = self.getLODNames()
+            if self.mergeLODBundles:
+                lodNames = lodNames[:1]
         else:
         else:
             lodNames = [lodName]
             lodNames = [lodName]