소스 검색

minor optimization features for async flatten

David Rose 17 년 전
부모
커밋
55a789293a
1개의 변경된 파일8개의 추가작업 그리고 5개의 파일을 삭제
  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
         self.__LODNode.node().addSwitch(inDist, outDist)
         if center != None:
-            self.__LODNode.node().setCenter(center)
+            self.setCenter(center)
 
     def setLOD(self, lodName, inDist=0, outDist=0):
         """setLOD(self, string)
@@ -1862,7 +1862,7 @@ class Actor(DirectObject, NodePath):
         return controls
 
     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
         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
             # so, try to bind them immediately and put them into the
             # 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
             # the Actor.