Strange issue with model texture

I am having an extremely strange issue and not sure if it is a bug with my system or with Panda3D.
I am using Manjaro linux

I went to try using Texture.set_format() but could not get the texture from the cube, I also found cube.find_texture(’*’).get_name() was returning a null. Commenting out the lines dealing with the texture the model loads and looks normal without looking dark which is strange because it should have the dark texture on it.

I tried exporting the model again from Blender: No change.

I tried exporting the model from blender with a different texture: No change, same model with same old texture.

I exported the model from blender under a different name and loaded that one: It changed and looks dark.

I tried loading cube2.gltf: Old model loads with a non dark texture.

I loaded cube2.gltf in to a different program: It shows the new model with the new texture.

I deleted the cube2.gltf file: Panda still loaded it with the old model and dark texture.

I changed the path to a full file system path: It still loaded it.

I created a blank cube2.gltf file in the model path: Panda still loads the model with the texture.

I deleted the file and searched my system for cube2.gltf: None found, but panda3d will still load it.

I rebooted the computer: Panda still loads the phantom model with the texture.

I emptied my trash folder and powered off the computer and unplugged it, powered back on and it still loads.

I ran a file system check: No errors.

I fully uninstalled panda and reinstalled it: It still loads the phantom model.
My projects folder setup is panda/models with the py files in the panda folder. I moved my py file to a different folder: I failed to load the model.

I moved the py file back: It loads the file.

I renamed the panda folder, created a new panda folder and its sub folders and copied the contents
over: It still loads the phantom model.

If I rename the panda folder or the model folder then it fails to load, but if I name it back then it loads the phantom file which makes me believe this is a file system issue. However any other program I try to use to edit the phantom file fail to load it because it does not exist.

I again tried creating a empty file at “/home/will/Documents/panda/models/cube2.gltf”, even entered random garbage in to it, but panda3d will still load the cube with the texture using this line: cube = self.loader.load_model("/home/will/Documents/panda/models/cube2.gltf")

So I am very confused with this, could panda have some sort of secret cache somewhere it is loading the file from that needs to be deleted?

etc/Config.prc

# Enable the model-cache, but only for models, not textures.

model-cache-dir $USER_APPDATA/Panda3D-1.10
model-cache-textures #f

Yes there is such a thing.

Try deleting ~/.cache/panda3d or disabling the model cache by putting model-cache-dir (with no arguments) on a line on its own in a Config.prc file.

It seems to me that a solution without parameters is not intuitive. “f” will be more obvious, I do not think that someone will call the folder the name “f”.

Thanks, yeah this looks like an issue with the cache system.
There seems to be a bug.
If I change the cache folder then the model fails to load.
However, if I create a new model then change or delete it Panda will keep loading the old model from the cache.

If you are on python, you can use the flag for:

load_model(noCache = True)

This will not cache the model.

2 Likes

Thanks that solves my issue.
After a little testing I found this to be a bug with gltf and panda3d’s caching, If I convert the file to bam it does not have this issue.