Can't find asset in gradle JME3 project

Hey, this is probably a really simple issue that I just can’t figure out, but my assetmanager is having trouble finding an asset that should be… right there.

Like, the assetmanager is all standard, nothing’s been changed from default in the gradle setup and build files, and (at least according to the SDK scene composer tab seen in the screenshot) the path should be correct relative to the default classpath. I’ve tried importing other assets as well, no success. I’m probably missing something really simple, but does anyone have tips on how to proceed?

It is a bug.

2 Likes

Well, that’s good to know. Is there a known workaround, or should I just abandon Gradle altogether and manage my dependencies manually?

Use Gradle, but a different template. Options include:

1 Like

Yep, any working configuration with Gradle is supported by any IDE as well as the SDK. And Gradle is what you really want. Everything else you will probably regret later. I know I have.

1 Like

Hold on, is “BasicGame-on-Gradle” different from the included “Basic Gradle Game” template in SDK 3.3.0? Because that’s the one I’m using.

1 Like

yes

Alright, I’ve migrated to the version from the git repository, but now I’m having a different problem - the models will load (or rather, the loading will not fail) when running the game, but the SDK just doesn’t open anything from this project in the scene editor. Other projects work fine, even if I copy the same files to another project it works fine, but scene composer doesn’t work for files in this project. Is this a bug, and if so is there a workaround that isn’t ‘copy to other project to work on, copy back when done’?

1 Like

Try deleting modelName.j3odata cache files for each model you have, and try opening the project again.

Just tried it, no luck.

Finally figured it out, at least the problem; even the template from Git for BasicGame-with-Gradle isn’t regarded as a JME3 project by the SDK. I never noticed because I only tried to load .j3o files, but trying to convert any other format model - such as a .glb model I prepped for import - resulted in the following error:

"File is not part of a project! Cannot load without ProjectAssetManager"

So I’ve figured this much out, but I’m stumped as for the way forward. Is there a way to manually ‘convert’ an existing project that the SDK doesn’t see as a valid JME3 project without starting over my repository from whole cloth? Or would the solution be something else?

Again, to reclarify, loading files normally using the default asset locator works now, and I can see existing models while executing my game, but I can’t convert models to .j3o or use the scene editor without going well out of my way to do so. Any help with this would be appreciated.

Paste all project asset folders (rootDir/assets) to src/main/resources.

I felt very frustrated with no help, no luck and this AssetException behaviour is repeatedly told as a bug. And then a solution is found by neglecting the default Project Assets.

Anyway, please have a try. This solution help me pass loading resources correctly.