Can’t import WorldForge creature

I downloaded the WorldForge models and I’m using Eclipse. How do I import a WorldForge model? I try and I get an exception:



[java]com.jme3.asset.AssetNotFoundException: objects/creatures/goblin/goblin.mesh.xml

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:277)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:410)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:420)

at adventure.Main.simpleInitApp(Main.java:110)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:225)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)

at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)

at java.lang.Thread.run(Thread.java:679)[/java]



The code I want to run that should import a goblin is



[java]Spatial model3 = assetManager.loadModel(“objects/creatures/goblin/goblin.mesh.xml”);[/java]

Neither does an absolute path work.

Can you help me?

Learn how he assetManager works and look how the paths in the ogre files are. Or just use the SDK where you can add all these models with a double-click. The worldforge models also require you to use the MaterialExtensions functionality of the ogre importer and map the shader map names.

1 Like
@normen said:
Learn how he assetManager works and look how the paths in the ogre files are. Or just use the SDK where you can add all these models with a double-click. The worldforge models also require you to use the MaterialExtensions functionality of the ogre importer and map the shader map names.

Thank you for the answer. I'm learning how to use the SDK and the model import. I could import models that I downloaded from blendswap. It's starting to work pretty good for me but not all models work so I think I must learn more blender to make everything work.
@normen said:
Learn how he assetManager works and look how the paths in the ogre files are. Or just use the SDK where you can add all these models with a double-click. The worldforge models also require you to use the MaterialExtensions functionality of the ogre importer and map the shader map names.

How should I use the MaterialExtensions? I'm getting the following stacktrace:
[java]com.jme3.asset.AssetLoadException: An exception has occured while loading asset: objects/creatures/goblin/textures/green/ogre.material
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:284)
at com.jme3.material.Material.<init>(Material.java:116)
at adventure.TownWorld.simpleInitApp(TownWorld.java:338)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:225)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.IOException: Must specify MaterialExtensionSet when loading
Ogre3D materials with extended materials
at com.jme3.scene.plugins.ogre.MaterialLoader.load(MaterialLoader.java:440)
at com.jme3.scene.plugins.ogre.MaterialLoader.load(MaterialLoader.java:465)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:282)
... 6 more[/java]
Code
[java] Spatial model3 = assetManager
.loadModel("objects/creatures/goblin/goblin.mesh.xml");
Material mat_stl = new Material(assetManager, "objects/creatures/goblin/textures/green/ogre.material");

mat_stl.setTexture("Green", assetManager.loadTexture("objects/creatures/goblin/textures/green/D.png"));

model3.setMaterial(mat_stl);[/java]

Dude, why don’t you just download the worldforge assetpack :?

1 Like
@normen said:
Dude, why don't you just download the worldforge assetpack :?

I thought I did and then I got those files. I couldn't load them with jme3 sdk, I have to load them with eclipse. Since jme3 sdk doesn't work for me, when I try to load the models it is just black:

So I try everything from eclipse and loading models with that code kind of works, I could get the spaceman model and a troll model to work but not the alien model and not the goblin model, it might be something with the blender export that I must learn. I got the ninja working nicely in third person and I'm eager to add more models and more scenes.
@niklasro said:
I thought I did and then I got those files. I couldn't load them with jme3 sdk, I have to load them with eclipse. Since jme3 sdk doesn't work for me, when I try to load the models it is just black:



I notice that lighting is turned off (the little light bulb). Does something show if you turn it on?
1 Like

…also you can right-click them to add them to the project (also if its sources are managed under eclipse)

1 Like
@pspeed said:
I notice that lighting is turned off (the little light bulb). Does something show if you turn it on?

Yes, then I can view the goblin in the jme3 sdk and right-click it to add it to the project but then I get an error message:
[java]
Load main file 3d_objects/creatures/goblin/goblin.mesh.xml
Load Ogre Material
Add Ogre Material
Child (goblin-geom-1) attached to this node (goblin-ogremesh)
Error loading model
Could not copy texture: /home/dev/NetBeansProjects/BasicGame/assets/3d_objects/creatures/goblin/textures/green/D.png
Could not copy texture: /home/dev/NetBeansProjects/BasicGame/assets/3d_objects/creatures/goblin/textures/common/N.png
Could not copy texture: /home/dev/NetBeansProjects/BasicGame/assets/3d_objects/creatures/goblin/textures/common/S.png
Could not copy texture: /home/dev/NetBeansProjects/BasicGame/assets/3d_objects/creatures/goblin/textures/green/D.png
Could not copy texture: /home/dev/NetBeansProjects/BasicGame/assets/3d_objects/creatures/goblin/textures/common/N.png
Could not copy texture: /home/dev/NetBeansProjects/BasicGame/assets/3d_objects/creatures/goblin/textures/common/S.png
[/java]
A goblin.j3o is created but I think it is without textures because when I load it into eclipse it shows up with no texture in my scene. What am I doin wrong?

Does your eclipse project have the “assets” folder on its classpath? The paths are absolute and need to be correct. You can either add it to the classpath or add a locator to the asset manager.

1 Like
@normen said:
Does your eclipse project have the "assets" folder on its classpath? The paths are absolute and need to be correct. You can either add it to the classpath or add a locator to the asset manager.

Now it works! I had forgotten to copy the texture when I moved the files from jme3 sdk to eclipse. Now I can get the alien and a monster nicely in my application. Thank you!