No Loader Registered for type ”blend”

Hi there,



I’ve taken the TestBlenderLoader test and modified it to work with a simple model I’ve created in Blender. I basically removed the Ogre lines and replaced them with:



[java]

assetManager.registerLocator(“C:/Users/Public/Documents/Blender Projects/Characters/Base”, FileLocator.class.getName());

Spatial moira = assetManager.loadModel(“Moira_jMonkeyTest.blend”);

[/java]



When I run this alone I’m able to see my model and the test track.



Now I want to run the same in Android 3.2. I’m using Eclipse Indigo, release 1. I’ve downloaded the latest builds (21 Feb). I have successfully run the samples “HelloSimpleApplication” and “Hello Node” locally and on my Android device (I have a Toshiba Thrive running Android 3.2) which I have connected as a debug device. Below is my code for utilizing the Android Harness:



[java]

package jme3test.blender;



import android.content.pm.ActivityInfo;

import com.jme3.app.AndroidHarness;

import com.jme3.system.android.AndroidConfigChooser.ConfigType;





public class TestBlenderLoaderAndroidActivity extends AndroidHarness {

public TestBlenderLoaderAndroidActivity() {

//Set the application class to run

appClass = “jme3test.blender.TestBlenderLoader”;

// set the config type

eglConfigType = ConfigType.BEST;

// Exit Dialog title & message

exitDialogTitle = “Exit?”;

exitDialogMessage = “Press Yes”;

// Edit: 25.06.2011: Enable verbose logging

eglConfigVerboseLogging= true;

// Edit: 30.06.2011: Choose screen orientation

screenOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;

// Edit 12.07.2011: Invert the MouseEvents X (default = true)

mouseEventsInvertX = true;

// Edit 05.07.2011: Invert the MouseEvents Y (default = true)

mouseEventsInvertY = true;

}



}

[/java]



When I run this, it successfully loads onto my device and starts but I get the following:





AndroidHarness(30789): Exception thrown in Thread[GLThread 13,5,main]

AndroidHarness(30789): java.lang.IllegalStateException: No loader registered for type “blend”

AndroidHarness(30789): at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:248)

AndroidHarness(30789): at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:408)

AndroidHarness(30789): at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:418)

AndroidHarness(30789): at jme3test.blender.TestBlenderLoader.simpleInitApp(TestBlenderLoader.java:22)

AndroidHarness(30789): at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:220)

AndroidHarness(30789): at com.jme3.system.android.OGLESContext.initInThread(OGLESContext.java:236)

AndroidHarness(30789): at com.jme3.system.android.OGLESContext.onSurfaceCreated(OGLESContext.java:195)

AndroidHarness(30789): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1414)

AndroidHarness(30789): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1184)



For some reason it can’t locate the loader for “blend”. Any ideas as to what I may be missing?



Thanks!



Jim

blend files are not packaged in the android build, you have to convert them to J3o

Hi nehon,



Thanks for your quick response!



I apologize if I’m being … “thick”, but this means to utilize a model I’m working with in Blender I need to export it from Blender as an Ogre XML, (install and) use jME SDK to import said XML and subsequently export same to a J3o? Do I understand this workflow?



Thanks!



Jim

Either that or you convert from .blend to j3o directly, which isn’t 100% working correctly yet though. Any import process from any external exchange format means overhead and in the case of the blender importer even more (awt dependencies etc). All of this workflow is outlined in the HelloAssets tutorial, really.

Hi normen,



Is that .blend → j3o documented somewhere? I’ve found the SDK version…



Jim

See my addition above, its all documented, yeah.

I’ve installed the jME SDK, converted the .blend to a j3o via the import process. I made the following changes to TestBlenderLoader:



[java]

assetManager.registerLocator(“C:/Workspace/jMonkeySDK/ConvertBlender/assets/Models/Moira_jMonkeyTest”, FileLocator.class.getName());

Spatial moira = assetManager.loadModel(“Moira_jMonkeyTest.j3o”);

[/java]



I run it and it works just like before. However, when I run the Android code above I get the following:



AndroidHarness(32035): Exception thrown in Thread[GLThread 10,5,main]

AndroidHarness(32035): java.lang.IllegalArgumentException: Given root path “/C:/Workspace/jMonkeySDK/ConvertBlender/assets/Models/Moira_jMonkeyTest” not a directory



If you note the root path reported in the log it prepends the path with a ‘/’, which hammers my path.



Any ideas?



Thanks!



Jim

Not sure what I did, but I managed to “fix” it. I’ve changed my registerLocator path to be “C:/Workspace/jMonkeySDK/ConvertBlender/assets” and the loadModel path “Models/Moira_jMonkeyTest/Moira_jMonkeyTest.j3o”. Now my blender model, via the j3o conversion, loads on my Android.



Cheers!



Jim

:smiley: