|
@@ -33,7 +33,7 @@ jMonkeyProjects/MyGame/assets/Models/ # .j3o
|
|
|
jMonkeyProjects/MyGame/assets/Scenes/ # .j3o
|
|
|
jMonkeyProjects/MyGame/assets/Shaders/ # .j3f, .vert, .frag
|
|
|
jMonkeyProjects/MyGame/assets/Sounds/ # .ogg, .wav
|
|
|
-jMonkeyProjects/MyGame/assets/Textures/ # .jpg, .png; also .mesh.xml+.material, .mtl+.obj, .blend (!)</code></pre></div></div>
|
|
|
+jMonkeyProjects/MyGame/assets/Textures/ # .jpg, .png; also .mesh.xml+.material, .mtl+.obj, .blend, .gltf (!)</code></pre></div></div>
|
|
|
<div class="paragraph"><p>These subdirectories are just the most common examples.</p></div>
|
|
|
<div class="admonitionblock important"><table><tr><td class="icon"><i class="fa icon-important" title="Important"></i></td><td class="content"><div class="paragraph"><p>You can rename/delete/add (sub)directories inside the <code>assets</code> directory in any way you like. Note however that there is no automatic refactoring for asset paths in the SDK, so if you modify them late in the development process, you have to refactor all paths manually.</p></div></td></tr></table></div>
|
|
|
<div class="paragraph"><p><strong>Examples:</strong> You can rename <code>assets/Sounds</code> to <code>assets/Audio</code>, you can delete <code>assets/MatDefs</code> if you don’t use it, you can create <code>assets/AIscripts</code>, etc. You can rename/move the <code>assets/Textures</code> directory or its subdirectories, but then you have to re-export all models, and re-convert them all to .j3o, so plan ahead!</p></div>
|
|
@@ -80,10 +80,10 @@ com.jme3.app.Application handleError
|
|
|
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
|
|
|
java.lang.NullPointerException</code></pre></div></div>
|
|
|
<div class="paragraph"><p><strong>Reason:</strong></p></div>
|
|
|
-<div class="paragraph"><p>If you use the default build script, <strong>original models and scenes (.mesh.xml, .obj, .blend, .zip), are excluded</strong> from the distribution automatically. A stand-alone executable includes converted <strong>.j3o files</strong> (models and scenes) only. The default build script makes sure to bundle existing .j3o files in the distribution, but you need to remember to convert the models (from mesh.xml–>.j3o, or .obj–>.j3o, etc) yourself.</p></div>
|
|
|
+<div class="paragraph"><p>If you use the default build script, <strong>original models and scenes (.mesh.xml, .obj, gltf, .zip), are excluded</strong> from the distribution automatically. A stand-alone executable includes converted <strong>.j3o files</strong> (models and scenes) only. The default build script makes sure to bundle existing .j3o files in the distribution, but you need to remember to convert the models (from mesh.xml<span class="icon"><i class="fa fa-long-arrow-right"></i></span>.j3o, or .obj<span class="icon"><i class="fa fa-long-arrow-right"></i></span>.j3o, etc) yourself.</p></div>
|
|
|
<div class="paragraph"><p><strong>Solution</strong></p></div>
|
|
|
<div class="paragraph"><p>Before building the executable, you must use the jMonkeyEngine SDK’s context menu action to <a href="../../sdk/model_loader_and_viewer.html">convert 3D models to .j3o binary format</a>.</p></div>
|
|
|
-<div class="olist arabic"><ol class="arabic"><li><p>Save your original models (.mesh.xml, .scene, .blend, or .obj files, plus textures) into <code>assets/Textures/</code>. (!)</p></li><li><p>Open the jME3 project in the jMonkeyEngine SDK.</p></li><li><p>Browse to the <code>assets</code> directory in the Projects window.</p></li><li><p>Right-click an original model in <code>assets/Textures/</code>, and choose “Convert to JME3 binary”.</p></li><li><p>The converted file appears in the same directory as the original file. It has the same name and a <code>.j3o</code> suffix.</p></li><li><p>Move the .j3o file into the <code>assets/Models/</code> or <code>assets/Scenes/</code> directory.</p></li><li><p>Use the assetManager’s <code>load()</code> method to load the <code>.j3o</code> file.</p></li></ol></div>
|
|
|
+<div class="olist arabic"><ol class="arabic"><li><p>Save your original models (.mesh.xml, .scene, .gltf, or .obj files, plus textures) into <code>assets/Textures/</code>. (!)</p></li><li><p>Open the jME3 project in the jMonkeyEngine SDK.</p></li><li><p>Browse to the <code>assets</code> directory in the Projects window.</p></li><li><p>Right-click an original model in <code>assets/Textures/</code>, and choose “Convert to JME3 binary”.</p></li><li><p>The converted file appears in the same directory as the original file. It has the same name and a <code>.j3o</code> suffix.</p></li><li><p>Move the .j3o file into the <code>assets/Models/</code> or <code>assets/Scenes/</code> directory.</p></li><li><p>Use the assetManager’s <code>load()</code> method to load the <code>.j3o</code> file.</p></li></ol></div>
|
|
|
<div class="paragraph"><p>This ensures that the model’s Texture paths keep working between your 3D mesh editor and JME3.</p></div>
|
|
|
<div class="admonitionblock important"><table><tr><td class="icon"><i class="fa icon-important" title="Important"></i></td><td class="content"><div class="paragraph"><p>If you must load custom assets from a non-.j3o ZIP file, you must manually ammend the <a href="../../sdk/default_build_script.html">default build script</a> to copy ZIP files into your distribution. ZIPs are skipped by default.</p></div></td></tr></table></div></div>
|
|
|
<div class="sect2"><h3 id="asset-handling-for-other-ides-codeless-projects">Asset Handling For Other IDEs: Codeless Projects</h3><div class="paragraph"><p><strong>Problem:</strong></p></div>
|
|
@@ -94,7 +94,7 @@ java.lang.NullPointerException</code></pre></div></div>
|
|
|
Store your assets there as described above.</p></li><li><p>Download and install the jMonkeyEngine SDK.</p></li><li><p>In the SDK, go to <code><span class="menuseq"><span class="menu">File</span> ▸ <span class="submenu">Import Projects</span> ▸ <span class="menuitem">External Project Assets</span></span></code>.</p></li><li><p>Select your (Eclipse or whatever) project and your assets folder in the Import Wizard.</p></li><li><p>You can now open this (Eclipse or whatever) project in the jMonkeyEngine SDK.<br>
|
|
|
Convert assets as described above.</p></li></ol></div>
|
|
|
<div class="admonitionblock important"><table><tr><td class="icon"><i class="fa icon-important" title="Important"></i></td><td class="content"><div class="paragraph"><p>If you don’t use the SDK for some reason, you can still convert models to j3o format: Load any model in Ogre3D or Wavefront format with the AssetManager.loadModel() as a spatial. Then save the spatial as j3o file using <a href="../../jme3/advanced/save_and_load.html">BinaryExporter</a>.</p></div></td></tr></table></div>
|
|
|
-<div class="admonitionblock tip"><table><tr><td class="icon"><i class="fa icon-tip" title="Tip"></i></td><td class="content"><div class="paragraph"><p>Use file version control and let team members check out the project. Your developers open the project in Eclipse (etc) as they are used to. Additionally to their graphic tools, ask your graphic designers to install the jMonkeyEngine SDK, and to check out the codeless project that you just prepared. This makes it easy for non-coding team member to browse and preview game assets, to arrange scenes, and to convert files. At the same time, non-coders don’t accidentally mess with code, and developers don’t accidentally mess with assets. :)</p></div></td></tr></table></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2019-12-23 04:48:14 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
|
|
|
+<div class="admonitionblock tip"><table><tr><td class="icon"><i class="fa icon-tip" title="Tip"></i></td><td class="content"><div class="paragraph"><p>Use file version control and let team members check out the project. Your developers open the project in Eclipse (etc) as they are used to. Additionally to their graphic tools, ask your graphic designers to install the jMonkeyEngine SDK, and to check out the codeless project that you just prepared. This makes it easy for non-coding team member to browse and preview game assets, to arrange scenes, and to convert files. At the same time, non-coders don’t accidentally mess with code, and developers don’t accidentally mess with assets. :)</p></div></td></tr></table></div></div></div></div><div id="footer"><div id="footer-text">Version <br>Last updated 2019-12-23 04:52:42 +00:00</div></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.js"></script><script>docsearch({
|
|
|
apiKey: 'a736b6d93de805e26ec2f49b55013fbd',
|
|
|
indexName: 'jmonkeyengine',
|
|
|
inputSelector: '#doc-search',
|