Texture error

Hi.
I’m trying to import a simple flat model and apply a texture to it at runtime. So far it works until I try adding a texture, then I get the error:

NodePath.setTexture() argument 1 must be texture, not NoneType

Any one got any ideas?

#plane test
import direct.directbase.DirectStart
from pandac.PandaModules import Filename


#load up the texture
myTexture = loader.loadTexture("sandtexture.png")

#load up the ground
plane = loader.loadModel("flatplane")
plane.setTexture(myTexture)
plane.reparentTo(render)
plane.setScale(1,1,1)
plane.setPos(0,0,0)

run()

loader.loadTexture failed. Either the loader can’t find your file, or it can’t read it. Check if your path is correct, if your filename is correct, and if your file isn’t corrupted.

That makes sense. It also says “Couldnt read texture sandtexture.png” then gives the path to the texture (its in the same directory as the script). Is there some standard format for textures that I might not be following and is making it go bad? I’m using a 128x128 png image.

Forget that.
I think it may have been a spelling error.
Boy do I feel stupid :blush: