So I’m following the tutorial and the teapot & wall display fine, however, I seem unable to load the town scene. What I tried; zipped file, unzipped files in the assets/Scene folder & finally hard coded the path but alas, all options throw a AssetNotFoundException.
I’m running Jmonkey in intelij, and actually coding in Kotlin, though I doubt that would an issue? And if so, I have no clue how to resolve it so any insight would be appreciated!
this is an answer but, you are getting AssetNotFoundException that’s mean that you didn’t put the zip file in the right place or you have a bad Gradle config.
As requested… in general, don’t even bother mentioning exceptions without a stack traces. It’s totally useless. Like a post that says “I have a problem, can you fix it?” levels of useless.
Could you not have saved us all a click and simply included it in a post here? It’s just text.
Also, what is your directory structure, etc. etc…
I can 100% assure you that the problem is on your end. The code is working fine. So in order for us to help you sort out what your problem is, we will need all of the information.
Directory structure, project setup, and so on… so we can figure out which part you did wrong.
He may of failed to registerLocator if using the zip file. Otherwise its like others mentioned, wrong path.
The tutorial asks you to drop the zipfile into the top level directory, not the assets folder.
The tutorial did need to be clarified a little so I edited it. I made the optional step of unzipping required and moved it from the ZipLocator part of the tutorial to the second example.
Edit: Forgot to mention, when you registerLocator on zip files in the assets folder, you have to include assets in the path whereas when its just loadModel the path is relative to the assets folder.
But note that there will be no “assets” folder in a final deployment so then you will likely get errors about the missing file just when deploying “for real”.
If you are going to use a zip, probably best not to put it in the assets folder.
•The current classpath (the top level of your project directory).
•The assets directory of your project.
•Optionally, custom paths that you register.
To
•The current classpath (the top level of your project directory).
•The sub-folders of the assets directory of your project.
•Optionally, custom paths that you register.
and added this warning,
When you build your project for distribution, there will be no assets directory. Instead, you will generate an assets.jar file, located in the dist/lib folder of your project that will contain the sub-folders of the assets directory and all the assets in those folders.
Remember that there will be no assets folder in a final deployment. If you are going to use a zip, do not put it in the assets folder. Otherwise, you will likely get errors about a missing file. For final distribution, add it to your dist folder.
Thanks for clarifying! The documentation should probably also mention one needs to add a light source in order to see the town, at least when working through the zip exercise. On my end at least the level had no local or world lights, so I added a the directional light to the rootnode and that worked.
Actually wrote along with the examples, rather than copy/paste and once I had the teapot & wall visible skipped to the town. Which makes me wonder, how come they are visible without a light source?