getTexture woes

I create an actor and apply a texture to the model. It appears to work because I can see the texture. Later on, I try to use getTexture(), but get None. Any ideas?

Here are some code hilights:
nodePath = Actor.Actor()
nodePath.loadModel(‘media/’+modelName)
nodePath.reparentTo(render)

later…
tex = loader.loadTexture(‘media/’+texName)
nodePath.setTexture(tex)

later…
tex = nodePath.getTexture()

NodePath.getTexture() only returns the texture that is set on that particular level, not any texture attribute that may have gotten pushed down onto the Geoms. Thus, if you have called flattenLight(), flattenMedium(), or flattenStrong() at some point after you applied the texture–any of which would push the texture attribute down onto the Geoms–then you cannot retrieve the texture with NodePath.getTexture(). Try using NodePath.findTexture(’*’) instead.

David

Thanks, David. That works beautifully. I guess I’m still getting used to the whole geom tree concept.