Assets not found problem

  1. The geometry is not part of that node if you take it out and attach it to some other node – investigate
  2. Done by a strange copying of meshes into a new geometry – investigate

    4b) Why is in both examples the loaded model attached to the root node then? – investigate
  1. but I am reading the obj into a spatial and casting it to a Node then (for testing purposes) attaching that Node to the rootNode and still the obj has no material. I htink the problem is here and I still can’t figure it out


  2. not in example 2, forget example 1 its completely wrong Iwas trying to make a point



    4b) for testing purposes, I only attach model to the rootNode at the end

Show us the actual example simplified down to loading just the one node and attaching it to the scene. That code should be fine… if it ever had a material then it should still have a material and the problem will be somewhere else.



…and I mean, complete test case.

Alright I tried to put as much as I can, since the code is very related to other stuff but basically here it is:



[java]

int drivesNumber = 2;

int x = 0;

int y = 0;

int z = 0;

private Spatial[] model; // array of spatials



// for testing purposes I’ll only pass create events

//…

//in an outside function I have this:

// Setup lighting

/*

DirectionalLight dl = new DirectionalLight();

dl.setColor(ColorRGBA.White);

dl.setDirection(Vector3f.UNIT_XYZ.negate());

rootNode.addLight(dl);

(/



//…



/** This function creates spatials in 3D by taking an array of “create” events from the reader file */

public void create3dDrives(Jme3CreateDriveAnimationEvent[] jme3CreateDriveAnimationEvents) {



for (int i=0; i<= drivesNumber - 1; i++)

{



drive_unit = assetManager.loadModel("/Models/F_Drive_ver2.obj");

drive_node = (Node) drive_unit;



drive_node.setLocalTranslation(x , y, z);

drive_node.setName(jme3CreateDriveAnimationEvents.id); // this is a String passed from the event



model = drive_node;



if(assetManager == null)

{



System.out.println(“WARNING: Asset Manager is null”);

}





//AssetManager assetManager = null;

//assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource(“com/jme3/asset/Desktop.cfg”));

Material mat1 = new Material(assetManager, “Common/MatDefs/Light/Lighting.j3md”);

model.setMaterial(mat1);

rootNode.attachChild(model);

}



}[/java]

Reducing the problem to a simple test case that illustrates the issue is as much for you as it is for us. If you can make a self-contained simple application that shows the same problem (ie: when you run it you see the issue) then we have something to go on. However, 9 times out of 10 this test case will work fine for you too and then you can work on why it works in the simple case and not your full application.



If you use Unshaded.j3md instead of Lighting.j3md does it change anything?

If you use Unshaded.j3md instead of Lighting.j3md does it change anything?


yes it does , the spatials become white without any textures

What happens if you remove the line that sets the material?

1 Like

It actually works fine if I remove the materials from jme… why is that so? Is it bc the obj already has its own materials?



it’s still a little dark in there so I might add a lamp in my scene.



Thanks.

Err, dude, you have no light in your scene when you try to use Lighting.j3md? Thats… not going to work :smiley:

I know I know! I should be banned from this forum lol



but look at the positive side, if you compile all my forum posts you could come up with JME3 FOR DUMMIES book w/ no effort :wink:

Nah, we count on you helping out those poor individuals that are in the same noob situation as you are / were :wink:

garnaout said:
It actually works fine if I remove the materials from jme... why is that so? Is it bc the obj already has its own materials?

it's still a little dark in there so I might add a lamp in my scene.

Thanks.


Yes, your object already had materials when it was loaded.

Hello since this afternoon, i’m having the same issue in the JME3 SDK
com.jme3.AssetNotFoundException:
Interface/Fonts/Default.fnt
Exception Thrown in Thread[GLThread2598,5,main]

I tried to create a Default.fnt font in my Assets Project folder and the problem vanishes BUT i have then an exception on Common/MatDefs/Misc/Unshaded.j3md

i don’t know what happen on my project configuration. as it was working fine so far (i just added google play service to add ads)

If i try to launch it on my Desktop no issue
If i try to create a new JME3 Project and try to launch it on my android device i have no issue neither.

Any lead on how to fix it ?

1 Like

We can’t see your unshaded exception. Having some information is probably helpful to solving your issue.

Same problem here on a Samsung S5 with Android 5 :

02-20 09:48:07.896: W/System.err(9549): com.jme3.asset.AssetNotFoundException: Interface/Fonts/Default.fnt
02-20 09:48:07.896: W/System.err(9549): 	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:283)
02-20 09:48:07.896: W/System.err(9549): 	at com.jme3.asset.DesktopAssetManager.loadFont(DesktopAssetManager.java:370)
02-20 09:48:07.896: W/System.err(9549): 	at com.jme3.app.SimpleApplication.loadGuiFont(SimpleApplication.java:179)
02-20 09:48:07.896: W/System.err(9549): 	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:187)
02-20 09:48:07.896: W/System.err(9549): 	at com.jme3.app.AndroidHarness.initialize(AndroidHarness.java:531)

On the other devices I tested it, it works:

  • Nexus 5 Android 5
  • One+ One Android 4.4.4
  • Samsung S3 Android 4.3

I checked in the APK, the Default.fnt is there (otherwise the other phones would complain as well I guess;) so it might be something Samsung or Android 5 specific. Isn’t it a problem that the DesktopAssetManager.java is used on an Android phone? Shouldn’t it be the AndroidAssetManager.java? Where and how does the system decide with AssetManager is instanciated and injected?

No, DesktopAssetManager is correct for android.

When does this error appear? Maybe after you restart the app?
Could it be related to this issue?

It happens as soon as I start the activity the first time