NeoTextureMaterialKey : Asset implements CloneableSmartAsset but doesn't have processor to handle cl

I’m just starting to use NeoTexture to do some materials. I’m getting this odd exception but I’m not quite sure what it is saying (or what I should do about it). It seems to suggest the AssetKey super class doesn’t have a processor registered for it?



Thanks in advance for your help!





static public void initialize(AssetManager am)

{

am.registerLoader(com.jme3.material.plugins.NeoTextureMaterialLoader.class, “tgr”);



NeoTextureMaterialKey key = new NeoTextureMaterialKey(“Materials/neoBrick.tgr”);

s_brickMaterial = am.loadAsset(key);

}




And here is the exception it raises when I try to run:



java.lang.IllegalStateException: Asset implements CloneableSmartAsset but doesn’t have processor to handle cloning

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

at house.HouseGeometry.initialize(HouseGeometry.java:154)

at house.House.initialize(House.java:108)

at states.HousingScreenState.initialize(HousingScreenState.java:69)

at states.HiranStateManager.initialize(HiranStateManager.java:85)

at mygame.Main.simpleInitApp(Main.java:70)

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

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

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

at java.lang.Thread.run(Thread.java:722)

Ah, the loader hasn’t been updated since the latest changes in the asset system… Gotta check with Kirill whats necessary here…

I think it should be sufficient for the key class to just inherit from MaterialKey instead of AssetKey. The MaterialKey class already returns the proper processors and caches.

Okay I fixed this.

It looks like it worked! Thanks for the quick response.



I do have a side question: is there something special I need to do or avoid in order to load 2 NeoTextures? I have the following, but both Materials seem to use whatever NeoTexture I loaded first (I tried both the brick and cobblestone and whichever is first is used for both Materials). I’m fairly sure they are two different Materials since as you can see, I turn culling off only one. When I move behind the first material, I can see it, but the second material gets culled.





NeoTextureMaterialKey key = new NeoTextureMaterialKey(“Materials/newexample_Bricks.tgr”);

key.setMaterialDef(“Common/MatDefs/Misc/Unshaded.j3md”);

s_brickMaterial = am.loadAsset(key);

s_brickMaterial.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);



key = new NeoTextureMaterialKey(“Materials/newexample_CobbleStone.tgr”);

key.setMaterialDef(“Common/MatDefs/Misc/Unshaded.j3md”);

s_cobblestoneMaterial = am.loadAsset(key);