Lets say Ive loaded an asset like this
loader.loadModel('panda')
Now I want to access the loaded model by it’s filename, not object name in Python. How would you do that? Tags, dictionaries? Or is there a simpler way?
Lets say Ive loaded an asset like this
loader.loadModel('panda')
Now I want to access the loaded model by it’s filename, not object name in Python. How would you do that? Tags, dictionaries? Or is there a simpler way?
What could be simpler than a dictionary?
David
I don’t know, thats why I asked
Do you need access to that specific object (instance) or to the model as it is on the disk?
In first case:
models = {}
filename = "superhero"
models[filename] = loader.loadModel(filename)
In second case, you can simply use another call to loadModel() which will get the model from cache.
model = loader.loadModel("foo") # slow
second_model = loader.loadModel("foo") # fast