Weird stuff with fbx loading


#1

Some weird stuff has been happening when I try to load .fbx files.

A deleted model can still be loaded

Steps to reproduce:

  1. Make an empty directory
  2. Export a file called model.fbx into the directory
  3. Run a python script from that directory that loads model.fbx with loader.loadModel
  4. Delete model.fbx
  5. Run the script again. The model will still be loaded.

Script for convenience:

from direct.showbase.ShowBase import ShowBase


class App(ShowBase):
    def __init__(self):
        super().__init__()
        model = self.loader.loadModel('model.fbx')
        model.reparentTo(self.render)
        self.disableMouse()
        self.camera.setPos(0, -700, 0)  # Makes the 100x scale object visible

App().run()

Scaling

Most of the time, the models will come in at 100x scale, but sometimes they don’t, depending on what directory they’re in. I haven’t managed to reproduce this yet.

I’m using Ubuntu 18.04 64-bit, python 3.7.1, panda3d 1.10.0.


#2

Maybe the problem is in the cache.

model = self.loader.loadModel('model.fbx' , noCache = True)


#3

Yeah, it doesn’t find the model if I call it with noCache = True. If I change it back, it finds the model again.


#4

However, in the final version you should get rid of this flag noCache = True. When starting, the panda will generate a BAM model in the folder to speed up the download. Details - Model cache


#5

Hmm, it seems like a better approach may be to open the fbx in something like panda3dstudio and convert it manually to a .bam file. That way I don’t have to worry about any weird stuff going on in the cache.

It still seems weird to me that the cache isn’t being marked as invalid when the model is deleted…