mirror of
https://github.com/panda3d/panda3d.git
synced 2026-03-01 12:39:26 -06:00
Fixed deprecated calls
This commit is contained in:
@@ -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'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()))
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user