loadModelOnce -> loadModel

This commit is contained in:
David Rose 2008-08-28 19:24:59 +00:00
parent b98db4a8d8
commit ddf501b588
18 changed files with 22 additions and 22 deletions

View File

@ -86,7 +86,7 @@ class GravityWalker(DirectObject.DirectObject):
self.platform2.destroy()
del self.platform2
model = loader.loadModelCopy('phase_9/models/cogHQ/platform1')
model = loader.loadModel('phase_9/models/cogHQ/platform1')
fakeId = id(self)
self.platform = MovingPlatform.MovingPlatform()
self.platform.setupCopyModel(fakeId, model, 'platformcollision')

View File

@ -80,7 +80,7 @@ class PhysicsWalker(DirectObject.DirectObject):
self.platform.destroy()
del self.platform
model = loader.loadModelCopy('phase_9/models/cogHQ/platform1')
model = loader.loadModel('phase_9/models/cogHQ/platform1')
fakeId = id(self)
self.platform = MovingPlatform.MovingPlatform()
self.platform.setupCopyModel(fakeId, model, 'platformcollision')
@ -781,7 +781,7 @@ class PhysicsWalker(DirectObject.DirectObject):
if __debug__:
def setupAvatarPhysicsIndicator(self):
if self.wantDebugIndicator:
indicator=loader.loadModelCopy('phase_5/models/props/dagger')
indicator=loader.loadModel('phase_5/models/props/dagger')
#self.walkControls.setAvatarPhysicsIndicator(indicator)
def debugPrint(self, message):

View File

@ -637,7 +637,7 @@ class ShipPilot(PhysicsWalker):
if __debug__:
def setupAvatarPhysicsIndicator(self):
if self.wantDebugIndicator:
indicator=loader.loadModelCopy('phase_5/models/props/dagger')
indicator=loader.loadModel('phase_5/models/props/dagger')
#self.walkControls.setAvatarPhysicsIndicator(indicator)
def debugPrint(self, message):

View File

@ -1000,7 +1000,7 @@ class ShipPilot2(PhysicsWalker):
if __debug__:
def setupAvatarPhysicsIndicator(self):
if self.wantDebugIndicator:
indicator=loader.loadModelCopy('phase_5/models/props/dagger')
indicator=loader.loadModel('phase_5/models/props/dagger')
#self.walkControls.setAvatarPhysicsIndicator(indicator)
def debugPrint(self, message):

View File

@ -7,7 +7,7 @@ from direct.showbase import ShowBase
ShowBase.ShowBase()
# Put an axis in the world:
loader.loadModelCopy("models/misc/xyzAxis").reparentTo(render)
loader.loadModel("models/misc/xyzAxis").reparentTo(render)
if 0:
# Hack:

View File

@ -8,7 +8,7 @@ from direct.showbase import ThreeUpShow
ThreeUpShow.ThreeUpShow()
# Put an axis in the world:
loader.loadModelCopy("models/misc/xyzAxis").reparentTo(render)
loader.loadModel("models/misc/xyzAxis").reparentTo(render)
if 0:
# Hack:

View File

@ -284,7 +284,7 @@ class DirectSession(DirectObject):
self.oobeCamera = hidden.attachNewNode('oobeCamera')
self.oobeVis = loader.loadModelOnce('models/misc/camera')
self.oobeVis = loader.loadModel('models/misc/camera')
if self.oobeVis:
self.oobeVis.node().setFinal(1)

View File

@ -392,7 +392,7 @@ class DistributedCartesianGrid(DistributedNode, CartesianGridBase):
dx = self.cellWidth * self.gridSize * .5
for i in range(self.gridSize):
for j in range(self.gridSize):
marker = loader.loadModelCopy("models/misc/smiley")
marker = loader.loadModel("models/misc/smiley")
marker.reparentTo(self.markerParent)
marker.setPos(i * self.cellWidth - dx,
j * self.cellWidth - dx,

View File

@ -67,7 +67,7 @@
else:
self.setSourceNodeName(nodeName)
# Load model and get texture
m = loader.loadModelOnce(modelName)
m = loader.loadModel(modelName)
if (m == None):
print "SpriteParticleRenderer: Couldn't find model: %s!" % modelName
return None

View File

@ -136,7 +136,7 @@ def setDefaultFontFunc(newFontFunc):
def getDefaultDialogGeom():
global defaultDialogGeom
if defaultDialogGeom == None:
defaultDialogGeom = loader.loadModelOnce('models/gui/dialog_box_gui')
defaultDialogGeom = loader.loadModel('models/gui/dialog_box_gui')
return defaultDialogGeom
def setDefaultDialogGeom(newDialogGeom):

View File

@ -95,7 +95,7 @@ class OnscreenGeom(DirectObject, NodePath):
if isinstance(geom, NodePath):
self.assign(geom.copyTo(parent, sort))
elif isinstance(geom, types.StringTypes):
self.assign(loader.loadModelCopy(geom))
self.assign(loader.loadModel(geom))
self.reparentTo(parent, sort)
if not self.isEmpty():

View File

@ -110,7 +110,7 @@ class OnscreenImage(DirectObject, NodePath):
self.setTexture(tex)
elif type(image) == type(()):
# Assume its a file+node name, extract texture from node
model = loader.loadModelOnce(image[0])
model = loader.loadModel(image[0])
if model:
node = model.find(image[1])
if node:

View File

@ -84,7 +84,7 @@ class SpriteParticleRendererExt(SpriteParticleRenderer):
nodeName = self.getSourceNodeName()
# Load model and get texture
m = loader.loadModelOnce(modelName)
m = loader.loadModel(modelName)
if (m == None):
print "SpriteParticleRendererExt: Couldn't find model: %s!" % modelName
return False
@ -111,7 +111,7 @@ class SpriteParticleRendererExt(SpriteParticleRenderer):
nodeName = self.getSourceNodeName()
# Load model and get texture
m = loader.loadModelOnce(modelName)
m = loader.loadModel(modelName)
if (m == None):
print "SpriteParticleRendererExt: Couldn't find model: %s!" % modelName
return False

View File

@ -13,7 +13,7 @@ class FallTest(NodePath):
#self.setPos(avatarNodePath, Vec3(0))
#self.setHpr(avatarNodePath, Vec3(0))
avatarNodePath=loader.loadModelCopy("models/misc/smiley")
avatarNodePath=loader.loadModel("models/misc/smiley")
assert not avatarNodePath.isEmpty()
camLL=render.find("**/camLL")

View File

@ -13,7 +13,7 @@ class RotationTest(NodePath):
#self.setPos(avatarNodePath, Vec3(0))
#self.setHpr(avatarNodePath, Vec3(0))
avatarNodePath=loader.loadModelCopy("models/misc/smiley")
avatarNodePath=loader.loadModel("models/misc/smiley")
assert not avatarNodePath.isEmpty()
camLL=render.find("**/camLL")

View File

@ -185,7 +185,7 @@ class Loader(DirectObject):
then attempt to load it from disk. Return a nodepath to
the model if successful or None otherwise
"""
Loader.notify.debug("loader.loadModelOnce() is deprecated; use loader.loadModel() instead.")
Loader.notify.info("loader.loadModel() is deprecated; use loader.loadModel() instead.")
return self.loadModel(modelPath, noCache = False)
@ -195,7 +195,7 @@ class Loader(DirectObject):
then attempt to load it from disk. Return a nodepath to
a copy of the model if successful or None otherwise
"""
Loader.notify.debug("loader.loadModelCopy() is deprecated; use loader.loadModel() instead.")
Loader.notify.info("loader.loadModel() is deprecated; use loader.loadModel() instead.")
return self.loadModel(modelPath, loaderOptions = loaderOptions, noCache = False)
@ -213,7 +213,7 @@ class Loader(DirectObject):
However, if you're loading a font, see loadFont(), below.
"""
Loader.notify.debug("loader.loadModelNode() is deprecated; use loader.loadModel() instead.")
Loader.notify.info("loader.loadModelNode() is deprecated; use loader.loadModel() instead.")
model = self.loadModel(modelPath, noCache = False)
if model is not None:

View File

@ -1790,7 +1790,7 @@ class ShowBase(DirectObject.DirectObject):
self.oobe2cam = self.oobeTrackball.attachNewNode(Transform2SG('oobe2cam'))
self.oobe2cam.node().setNode(self.oobeCameraTrackball.node())
self.oobeVis = loader.loadModelOnce('models/misc/camera')
self.oobeVis = loader.loadModel('models/misc/camera')
if self.oobeVis:
self.oobeVis.node().setFinal(1)
self.oobeCullFrustum = None

View File

@ -2426,7 +2426,7 @@ class ParticlePanel(AppShell):
self.widgetDict['Sprite Renderer-'+animName+' Anim Node'] = entry
def checkForNode(modelStrVar=mStrVar, nodeStrVar=nStrVar):
mod = loader.loadModelCopy(modelStrVar.get())
mod = loader.loadModel(modelStrVar.get())
if mod:
node = mod.find(nodeStrVar.get())
if node: