Browse Source

Fixed deprecated calls

rdb 17 years ago
parent
commit
45b179b75b

+ 3 - 3
doc/SceneEditor/dataHolder.py

@@ -166,7 +166,7 @@ class dataHolder:
         name = nodePath.getName()
         name = nodePath.getName()
 
 
         ## Check if there is any child node, if so, remove it.
         ## Check if there is any child node, if so, remove it.
-        childrenList = nodePath.getChildrenAsList()
+        childrenList = nodePath.getChildren()
         
         
                 
                 
         if self.ModelDic.has_key(name):
         if self.ModelDic.has_key(name):
@@ -258,7 +258,7 @@ class dataHolder:
                 newName = name+'_copy_%d'%i
                 newName = name+'_copy_%d'%i
                 while self.isInScene(newName):
                 while self.isInScene(newName):
                     newName = newName + '_1'
                     newName = newName + '_1'
-                holder[newName] = loader.loadModelCopy(FilePath.getFullpath())
+                holder[newName] = loader.loadModel(FilePath.getFullpath())
                 holderRef[newName] = FilePath
                 holderRef[newName] = FilePath
                 self.ModelNum += 1
                 self.ModelNum += 1
                 holder[newName].reparentTo(parent)
                 holder[newName].reparentTo(parent)
@@ -713,7 +713,7 @@ class dataHolder:
         number = len(self.dummyDict)
         number = len(self.dummyDict)
         number += 1
         number += 1
         name = 'Dummy%d'%number
         name = 'Dummy%d'%number
-        self.dummyModel = loader.loadModelCopy( "models/misc/sphere" )
+        self.dummyModel = loader.loadModel( "models/misc/sphere" )
         self.dummyModel.reparentTo(nodePath)
         self.dummyModel.reparentTo(nodePath)
         while self.isInScene(name):
         while self.isInScene(name):
             name = name + '_1'
             name = name + '_1'

+ 1 - 1
doc/SceneEditor/seCameraControl.py

@@ -310,7 +310,7 @@ class DirectCameraControl(DirectObject):
             self.cqEntries = self.cqEntries[1:] + self.cqEntries[:1]
             self.cqEntries = self.cqEntries[1:] + self.cqEntries[:1]
             # Filter out object's under camera
             # Filter out object's under camera
             nodePath = entry.getIntoNodePath()
             nodePath = entry.getIntoNodePath()
-            if SEditor.camera not in nodePath.getAncestry():
+            if SEditor.camera not in nodePath.getAncestors():
                 # Compute new hit point
                 # Compute new hit point
                 hitPt = entry.getSurfacePoint(entry.getFromNodePath())
                 hitPt = entry.getSurfacePoint(entry.getFromNodePath())
                 # Move coa marker to new point
                 # Move coa marker to new point

+ 1 - 1
doc/SceneEditor/seFileSaver.py

@@ -250,7 +250,7 @@ class FileSaver:
             dummyS=str(dummy)
             dummyS=str(dummy)
             
             
             if(1): # This is kept for now... perhaps later some sort of check might have to be enforced based on loadMode
             if(1): # This is kept for now... perhaps later some sort of check might have to be enforced based on loadMode
-                out_file.write(i2+ "self."+ dummyS + "=loader.loadModelCopy(\"models/misc/sphere\")\n")
+                out_file.write(i2+ "self."+ dummyS + "=loader.loadModel(\"models/misc/sphere\")\n")
                 #Transformation Code
                 #Transformation Code
                 out_file.write(i2+"# Transforming the Dummy\n")
                 out_file.write(i2+"# Transforming the Dummy\n")
                 out_file.write(i2+ "self."+ dummyS + ".setPosHprScale(%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f)\n"% (AllScene.dummyDict[dummy].getX(),AllScene.dummyDict[dummy].getY(),AllScene.dummyDict[dummy].getZ(),AllScene.dummyDict[dummy].getH(),AllScene.dummyDict[dummy].getP(),AllScene.dummyDict[dummy].getR(),AllScene.dummyDict[dummy].getSx(),AllScene.dummyDict[dummy].getSy(),AllScene.dummyDict[dummy].getSz()))
                 out_file.write(i2+ "self."+ dummyS + ".setPosHprScale(%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f,%.3f)\n"% (AllScene.dummyDict[dummy].getX(),AllScene.dummyDict[dummy].getY(),AllScene.dummyDict[dummy].getZ(),AllScene.dummyDict[dummy].getH(),AllScene.dummyDict[dummy].getP(),AllScene.dummyDict[dummy].getR(),AllScene.dummyDict[dummy].getSx(),AllScene.dummyDict[dummy].getSy(),AllScene.dummyDict[dummy].getSz()))

+ 1 - 1
doc/SceneEditor/seGrid.py

@@ -88,7 +88,7 @@ class DirectGrid(NodePath,DirectObject):
         self.centerLines.reset()
         self.centerLines.reset()
 
 
         # Now redraw lines
         # Now redraw lines
-        numLines = math.ceil(self.gridSize/self.gridSpacing)
+        numLines = int(math.ceil(self.gridSize/self.gridSpacing))
         scaledSize = numLines * self.gridSpacing
         scaledSize = numLines * self.gridSpacing
  
  
         center = self.centerLines
         center = self.centerLines

+ 5 - 5
doc/SceneEditor/seLights.py

@@ -81,13 +81,13 @@ class seLight(NodePath):
         
         
         self.assign(self.LightNode)
         self.assign(self.LightNode)
         if(self.type=='spot'):
         if(self.type=='spot'):
-            self.helpModel = loader.loadModelCopy( "models/misc/Spotlight" )
+            self.helpModel = loader.loadModel( "models/misc/Spotlight" )
         elif(self.type=='point'):
         elif(self.type=='point'):
-            self.helpModel = loader.loadModelCopy( "models/misc/Pointlight" )
+            self.helpModel = loader.loadModel( "models/misc/Pointlight" )
         elif(self.type=='directional'):
         elif(self.type=='directional'):
-            self.helpModel = loader.loadModelCopy( "models/misc/Dirlight" )
+            self.helpModel = loader.loadModel( "models/misc/Dirlight" )
         else:
         else:
-            self.helpModel = loader.loadModelCopy( "models/misc/sphere" )
+            self.helpModel = loader.loadModel( "models/misc/sphere" )
         self.helpModel.setColor(self.lightcolor)
         self.helpModel.setColor(self.lightcolor)
         self.helpModel.reparentTo(self)
         self.helpModel.reparentTo(self)
         DirectUtil.useDirectRenderStyle(self.helpModel)
         DirectUtil.useDirectRenderStyle(self.helpModel)
@@ -304,7 +304,7 @@ class seLightManager(NodePath):
         # Originally, we don't do this load model thing.
         # Originally, we don't do this load model thing.
         # But the problem is, if we don't, then it will cause some
         # But the problem is, if we don't, then it will cause some
         # Bounding calculation error...
         # Bounding calculation error...
-        self.helpModel = loader.loadModelCopy( "models/misc/sphere" )
+        self.helpModel = loader.loadModel( "models/misc/sphere" )
         self.helpModel.reparentTo(self)
         self.helpModel.reparentTo(self)
         self.helpModel.hide()
         self.helpModel.hide()
    
    

+ 1 - 1
doc/SceneEditor/seMopathRecorder.py

@@ -700,7 +700,7 @@ class MopathRecorder(AppShell, DirectObject):
 
 
     def getChildIds(self, nodePath):
     def getChildIds(self, nodePath):
         ids = [nodePath.id()]
         ids = [nodePath.id()]
-        kids = nodePath.getChildrenAsList()
+        kids = nodePath.getChildren()
         for kid in kids:
         for kid in kids:
             ids += self.getChildIds(kid)
             ids += self.getChildIds(kid)
         return ids
         return ids

+ 1 - 1
doc/SceneEditor/seSceneGraphExplorer.py

@@ -185,7 +185,7 @@ class SceneGraphExplorerItem(TreeItem):
 
 
     def GetSubList(self):
     def GetSubList(self):
         sublist = []
         sublist = []
-        for nodePath in self.nodePath.getChildrenAsList():
+        for nodePath in self.nodePath.getChildren():
             item = SceneGraphExplorerItem(nodePath)
             item = SceneGraphExplorerItem(nodePath)
             sublist.append(item)
             sublist.append(item)
         return sublist
         return sublist

+ 2 - 2
doc/SceneEditor/seSelection.py

@@ -350,7 +350,7 @@ class DirectBoundingBox:
         # Get a node path's bounds
         # Get a node path's bounds
         nodeBounds = BoundingSphere()
         nodeBounds = BoundingSphere()
         nodeBounds.extendBy(self.nodePath.node().getInternalBound())
         nodeBounds.extendBy(self.nodePath.node().getInternalBound())
-        for child in self.nodePath.getChildrenAsList():
+        for child in self.nodePath.getChildren():
             nodeBounds.extendBy(child.getBounds())
             nodeBounds.extendBy(child.getBounds())
         return nodeBounds.makeCopy()
         return nodeBounds.makeCopy()
 
 
@@ -514,7 +514,7 @@ class SelectionQueue(CollisionHandlerQueue):
                 # Skip, if backfacing poly
                 # Skip, if backfacing poly
                 pass
                 pass
             elif ((skipFlags & SKIP_CAMERA) and
             elif ((skipFlags & SKIP_CAMERA) and
-                  (camera in nodePath.getAncestry())):
+                  (camera in nodePath.getAncestors())):
                 # Skip if parented to a camera.
                 # Skip if parented to a camera.
                 pass
                 pass
             # Can pick unpickable, use the first visible node
             # Can pick unpickable, use the first visible node

+ 1 - 1
doc/SceneEditor/seSession.py

@@ -388,7 +388,7 @@ class SeSession(DirectObject):  ### Customized DirectSession
             messenger.send('DIRECT_preSelectNodePath', [dnp])
             messenger.send('DIRECT_preSelectNodePath', [dnp])
             if fResetAncestry:
             if fResetAncestry:
                 # Update ancestry
                 # Update ancestry
-                self.ancestry = dnp.getAncestry()
+                self.ancestry = dnp.getAncestors()
                 self.ancestry.reverse()
                 self.ancestry.reverse()
                 self.ancestryIndex = 0
                 self.ancestryIndex = 0
             # Update the selectedNPReadout
             # Update the selectedNPReadout