Fixed deprecated calls

This commit is contained in:
rdb
2009-03-14 17:05:06 +00:00
parent 6c475ddacd
commit 45b179b75b
9 changed files with 16 additions and 16 deletions

View File

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

View File

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

View File

@@ -250,7 +250,7 @@ class FileSaver:
dummyS=str(dummy)
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
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()))

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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