Hey guys, I’m just getting started using jME3 for a new game I’m working on and having some trouble loading a Wavefront OBJ model in my IDE, IntelliJ. I’ve seen a couple references around to people using it here, so I was wondering if any of you that have experience with it might be able to help?
Here’s the problem:
I’m trying to load a model via the Asset Manager. I’ve followed the basic tutorials here on the website. The problem is thus: I can’t get IntelliJ to copy the .obj file into the output directory. Matter of fact, it doesn’t even recognize it in the project tree. Here’s what I’ve done:
- Create folders “assets/Models” inside the project root. (So assets is a sibling of “src”). And made “assets” a Source root directory in the IntelliJ project structure.
- Put “Tank.obj” in the assets/Models directory, and added “?.obj" to the resource name patterns in the Compiler pane of the Project Settings window. This is my exact patterns string: "?.obj;?.properties;?.xml;?.gif;?.png;?.jpeg;?.jpg;?.html;?.dtd;?.tld;?.ftl”
- Try to run, and get a NullPointerException on assetManager.loadModel(“Models/Tank.obj”);
I’ve noticed that if I rename the “Tank.obj” file to “Tank.obj.properties” then it will copy over just fine. Did any of you have to do anything else to get IntelliJ to copy it for you? I’m running Community Edition 9.0.3.
Another question: If, for some reason, I’m unable to get it to work with the .obj extension, is the Asset Manager smart enough to know what the model file is by looking at the contents, or does it depend on the extension?
Thanks in advance.