Strange Error since upgrading

I updated jME today. Before, I ran the game and it was fine. However, now when I run, the following exception occurs:



SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.UnsupportedOperationException: The buffer already set is incompatible with the given parameters



This occurs when I use Tangent TangentBinormalGenerator.generate();



Any help?

Sorry for bumping, but I have been trying to find the problem for hours. This is the code which is not working:



[java]for (int i = 0; i < 100; i++){

walls = assetManager.loadModel(“Models/Wall2/Wall2.j3o”);

walls.setMaterial(material);

y.attachChild(walls);

walls.setLocalTranslation(10i, 0, 0);

walls.setName(""+i);

TangentBinormalGenerator.generate(walls);

a = true;

p = walls.getLocalTranslation().x;

}[/java]



This is the complete exception (pointing at TangentBinormalGenerator.generate(walls); ):



[java]SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.UnsupportedOperationException: The buffer already set is incompatible with the given parameters

at com.jme3.scene.Mesh.setBuffer(Mesh.java:910)

at com.jme3.scene.Mesh.setBuffer(Mesh.java:930)

at com.jme3.util.TangentBinormalGenerator.processTriangleData(TangentBinormalGenerator.java:614)

at com.jme3.util.TangentBinormalGenerator.generate(TangentBinormalGenerator.java:161)

at com.jme3.util.TangentBinormalGenerator.generate(TangentBinormalGenerator.java:111)

at com.jme3.util.TangentBinormalGenerator.generate(TangentBinormalGenerator.java:127)

at com.jme3.util.TangentBinormalGenerator.generate(TangentBinormalGenerator.java:118)

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

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

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:722)

[/java]



It’s strange that this works:



[java]wall6 = assetManager.loadModel(“Models/HighWall/HighWall.j3o”);

wall6.setMaterial(material);

wall6.rotate(0, -90f
FastMath.DEG_TO_RAD, 0);

wall6.setLocalTranslation(10, 0, 5);

TangentBinormalGenerator.generate(wall6); [/java]



Using the HighWall model works well, but opening the material files which come with them reveals that they’re identical.

One of those models has tangents generated by a really old version of jME3 so it only uses 3 coordinates instead of 4. The expected result in this case would be that the TangentBinormalGenerator regenerates the buffer with 4 coordinates, but here it is failing because the number of coordinates are not compatible.



I have fixed this issue in SVN, you may need to wait until nightly for it to be available though.

So new models (from scratch) should work well?

Just update to the nightly version, or re-create the j3o for that model

I tried recreating the .j3o, and even importing the model again, but no luck. I re-create the model and it worked. Apparently the problem was that the old one was having binormals generated. I noticed this when I compared the two mesh.xml files.

Binormals are not even used by the current version of jME3. Like I said, you probably have a 3 coordinate tangent buffer already set on that mesh

@Momoko_Fan:

And this error is strange too :



material.setParam(“BoneMatrices”, VarType.Matrix4Array, matrix4array);



This code doesn’t run anymore and no exception shown , the whole program just hang and need to stop by force !

:frowning: crazy one

Then that might be the problem Momoko, although I think I am using the same jME version. But as long as it’s working well… New models fixed everything.