Browse Source

minor optimization features for async flatten

David Rose 17 years ago
parent
commit
55a789293a
1 changed files with 8 additions and 5 deletions
  1. 8 5
      direct/src/actor/Actor.py

+ 8 - 5
direct/src/actor/Actor.py

@@ -689,7 +689,7 @@ class Actor(DirectObject, NodePath):
         # add the switch distance info
         # add the switch distance info
         self.__LODNode.node().addSwitch(inDist, outDist)
         self.__LODNode.node().addSwitch(inDist, outDist)
         if center != None:
         if center != None:
-            self.__LODNode.node().setCenter(center)
+            self.setCenter(center)
 
 
     def setLOD(self, lodName, inDist=0, outDist=0):
     def setLOD(self, lodName, inDist=0, outDist=0):
         """setLOD(self, string)
         """setLOD(self, string)
@@ -1862,7 +1862,7 @@ class Actor(DirectObject, NodePath):
         return controls
         return controls
 
 
     def loadModel(self, modelPath, partName="modelRoot", lodName="lodRoot",
     def loadModel(self, modelPath, partName="modelRoot", lodName="lodRoot",
-                  copy = True, okMissing = None):
+                  copy = True, okMissing = None, autoBindAnims = True):
         """Actor model loader. Takes a model name (ie file path), a part
         """Actor model loader. Takes a model name (ie file path), a part
         name(defaults to "modelRoot") and an lod name(defaults to "lodRoot").
         name(defaults to "modelRoot") and an lod name(defaults to "lodRoot").
         """
         """
@@ -1907,9 +1907,12 @@ class Actor(DirectObject, NodePath):
             # Maybe the model file also included some animations.  If
             # Maybe the model file also included some animations.  If
             # so, try to bind them immediately and put them into the
             # so, try to bind them immediately and put them into the
             # animControlDict.
             # animControlDict.
-            acc = AnimControlCollection()
-            autoBind(model.node(), acc, ~0)
-            numAnims = acc.getNumAnims()
+            if autoBindAnims:
+                acc = AnimControlCollection()
+                autoBind(model.node(), acc, ~0)
+                numAnims = acc.getNumAnims()
+            else:
+                numAnims = 0
 
 
             # Now extract out the Character and integrate it with
             # Now extract out the Character and integrate it with
             # the Actor.
             # the Actor.