Importing assets using Eclipse

Hi,

I’m new to JMonkeyEngine and I’m having some immediate problems in importing assets. I’m using eclipse and I’m trying to create terrain using the terrain example. I try to load an asset like so:

[java] mat_terrain.setTexture(“m_Alpha”,

assetManager.loadTexture(“asset/textures/terrain/alphamap.jpg”));[/java]

but I get an Asset not found exception. This particular asset is in a new folder I created within the project called assets, in which the subfolders are contained and eventualy the alphamap. I’m sure its something simple but I’ve not been able to figure out why this doesn’t work - most of the documentation directly relates to the Java Monkey Engine IDE (which is fair enough).

On a side note, what should I do about importing “Common/MatDefs/Terrain/Terrain.j3md” - do I need to get this from somewhere and place it in the asset folder I created?



Thanks, any help much appreciated.

  • Aaron.

Hi there!



I was also having problems with this until I found out, that assets folder should be on classPath. So either make it a source folder, or place it under src as a package. This solved it for me.

Ah, got it working, thanks very much!

created account to thank you :stuck_out_tongue:

helped me also… people having this problem: just create separate Source folder and add assets subdirectories there :slight_smile: