Hey Guys!
I have tried getting a particle effect I have created in the reneditor, to load into my game. It works, very well too :). Tho once I have deployed it the texture file I used won't load, I understand why not, paths are all different once in a jar etc.
So, how do I load a .jme particle effect made in reneditor and then load it, with relative texture path?
Regards,
Jordan.
how do you load the file exactly?
Make sure to use the ResourceLocator.
try {
InputStream j = Test.class.getClassLoader()
.getResourceAsStream("engine.jme");
Spatial obj = (Spatial) BinaryImporter.getInstance().load(j);
if (obj instanceof Node) {
Node jet = (Node) obj;
for (int ii = jet.getQuantity() - 1; ii >= 0; ii--) {
if (!(jet.getChild(ii) instanceof ParticleGeometry)) {
jet.detachChildAt(ii);
}
}
if (jet.getQuantity() == 0) {
throw new Exception("Node contains no particle meshes");
}
jet.setLocalScale(0.1f);
ship.attachChild(jet);
jet.updateRenderState();
}
}catch(Exception e){
e.printStackTrace();
System.exit(0);
}
try to set up the ResourceLocator to point to your texture directory.
-> example