ArsThaumaturgis/Panda3DTutorial.io

Lesson2: loader(error): Couldn't load file Models/Misc/environment.egg: not found on model path

Closed this issue · 9 comments

Fak3 commented

The tutorial seems to be missing instructions how and where to download assets. When I tried to launch Lesson2 code, i got an error:

:loader(error): Couldn't load file Models/Misc/environment.egg: not found on model path (currently: "/home/z/pproj/panda_tut:/usr/lib64/python3.7/site-packages/panda3d/etc/..:/usr/lib64/python3.7/site-packages/panda3d/etc/../models")
Traceback (most recent call last):
  File "game.py", line 52, in <module>
    game = Game()
  File "game.py", line 41, in __init__
    self.environment = loader.loadModel("Models/Misc/environment")
  File "/usr/lib64/python3.7/site-packages/direct/showbase/Loader.py", line 298, in loadModel
    raise IOError(message)
OSError: Could not load model file(s): ['Models/Misc/environment']

There is a paragraph which mentions that there are some assets you have to download on the "Start Here" page, but unfortunately without any details of where to put them.

You're quite right--it looks like I did omit explicit indication of where to place those files!

However, note that the code (and error) itself gives a hint: it indicates that "environment.egg" is expected to be found in "Models/Misc/". Now, it doesn't say where that should located. But note that your project's directory is on the model-path (as mentioned in the error); indeed, you can generally rely on being able to access things in your project directory, I think.

So, simply create the relevant folders in your project directory, place the models as indicated in the code, and it should work!

(You could also place them in the same structure within another folder mentioned in the model-path, or even change the model-path to reflect the folder that you want--but this was is, I think, simpler, and keeps all the project-files together.)

I've made some edits to the "start here" page, indicating more or less what I said above, which may hopefully aid others in placing their files. The relevant commits should be 3ad1cd5 and 3b9faa8.

I first want to say that this tutorial is greatly appreciated. I'll also add that this Issue was useful - I couldn't find the Actor models (found the environment.egg in the actual Panda3d repo, which threw me for a bit), then saw the comment above about the "Start Here" page, where I found the links.

The tutorial is my pleasure; I'm glad if you're finding it useful! And similarly, I'm glad that this issue has proven helpful to you. ^_^

I still can't seem to find the PandaChan actor models. The Start Here page says it's in the PandaSampleModels repository, but I only see BambooLaser, Environment, SimpleEnemy, SlidingTrap and UI folders. Where canI find the actor models required for lesson 2? (such as PandaChan/act_p3d_chan and PandaChan/a_p3d_chan_run

I still can't seem to find the PandaChan actor models. The Start Here page says it's in the PandaSampleModels repository, but I only see BambooLaser, Environment, SimpleEnemy, SlidingTrap and UI folders.

The Start Here.Prologue does have:

The second of which has the models you named.

And backticks removed - I used the "add code" function, and pasted the code inside - not sure why it broke like that. Wups.

Indeed, as CrawfishPress indicates above, the "Panda-chan" model-files are stored in a separate repository (as they were not made by me), and should be available from that repository. ^_^

(The link as quoted by them is essentially correct, but has an extra '`' that breaks it. For the sake of convenience and clarity, here then is (what should be) a working link:
https://github.com/wezu/p3d_samples/tree/master/models
)

Oh, I see! Somehow I completely missed the links in the Start Here page, my bad! Thank you for your quick responses :)

Not a problem! These things do happen! ^_^

Enjoy the tutorial, and I hope that it proves useful! ^_^