Xbuf format – A developer friendly game exchange format for 3d data

[OT] https://conemu.github.io/ is my favorite terminal for windows XP, 7, 8, 10 (resizeable, configurable shell, …)

Hi
When I run lunch.exe for jme3_xbuf_viewer I get this error:
LoadLibrary failed with error 1114 : a dynamic link library (DLL) initialization routine failed.

Edit : solved

In windows 7 it runs OK.
but in win 10 gives the error.

Edit : problem was from java 8 update 60.
I changed to update 51 and it worked.

I have an other problem.
How should I install blender_io_xbuf-0.6.0.zip in blender?
1- I chose install from file
2- select blender_io_xbuf-0.6.0.zip
but nothing happens.
I could only install blender_io_xbuf-master.zip.

to install a tagged version of blender_io_xbuf, dowload the source zip from Releases · xbuf/blender_io_xbuf · GitHub. As xbuf is WIP I suggest to use blender_io_xbuf-master.zip.

Thanks for feedback, I’ll try to improve the setup flow.

mmmm…Lunch.

I imported a human model with "custom shape" armature from makehuman and added a bvh animation to it. then exported to xbuf format.
but when I tried to import it in jme I got whole bunch of warning and errors.


WARNING: Angle between tangents exceeds tolerance for vertex 39,699.
Oct 02, 2015 4:18:19 PM com.jme3.util.TangentBinormalGenerator_31 processTriangleData
WARNING: Angle between tangents exceeds tolerance for vertex 39,990.
Oct 02, 2015 4:18:19 PM com.jme3.util.TangentBinormalGenerator_31 processTriangleData
WARNING: Angle between tangents exceeds tolerance for vertex 39,994.
Oct 02, 2015 4:18:19 PM com.jme3.util.TangentBinormalGenerator_31 processTriangleData
>>>> SET Texture: Textures/brown_eye.png into DiffuseMap
WARNING: Angle between tangents exceeds tolerance for vertex 48,436.
Oct 02, 2015 4:18:19 PM com.jme3.util.TangentBinormalGenerator_31 processTriangleData
WARNING: Angle between tangents exceeds tolerance for vertex 48,254.
Oct 02, 2015 4:18:19 PM com.jme3.util.TangentBinormalGenerator_31 processTriangleData
16:18:21.005 [jME3 Main] WARN  jme3_ext_xbuf.XbufLoader - vertex influenced by more than 4 bones : 5, only the 4 higher are keep for total weight keep/orig: 0.9692338/1.0000001.
16:18:21.008 [jME3 Main] WARN  jme3_ext_xbuf.XbufLoader - vertex influenced by more than 4 bones : 5, only the 4 higher are keep for total weight keep/orig: 0.96605814/1.0.
16:18:21.008 [jME3 Main] WARN  jme3_ext_xbuf.XbufLoader - vertex influenced by more than 4 bones : 5, only the 4 higher are keep for total weight keep/orig: 0.9692338/1.0000001.
16:18:21.008 [jME3 Main] WARN  jme3_ext_xbuf.XbufLoader - vertex influenced by more than 4 bones : 5, only the 4 higher are keep for total weight keep/orig: 0.96605814/1.0.
16:18:21.009 [jME3 Main] WARN  jme3_ext_xbuf.XbufLoader - vertex influenced by more than 4 bones : 5, only the 4 higher are keep for total weight keep/orig: 0.9501505/1.0.
16:18:21.009 [jME3 Main] WARN  jme3_ext_xbuf.XbufLoader - vertex influenced by more than 4 bones : 5, only the 4 higher are keep for total weight keep/orig: 0.9501505/1.0.
16:18:21.009 [jME3 Main] WARN  jme3_ext_xbuf.XbufLoader - vertex influenced by more than 4 bones : 5, only the 4 higher are keep for total weight keep/orig: 0.9942774/1.0.
16:18:21.009 [jME3 Main] WARN  jme3_ext_xbuf.XbufLoader - vertex influenced by more than 4 bones : 5, only the 4 higher are keep for total weight keep/orig: 0.9942774/1.0.

Oct 02, 2015 4:18:23 PM com.jme3.renderer.opengl.GLRenderer updateShaderSourceData
WARNING: Bad compile of:
1    #version 110
2    #define VERTEX_SHADER 1
3    #define DIFFUSEMAP 1
4    #define NUM_BONES 300
5    // -- begin import Common/ShaderLib/Instancing.glsllib --
6    // Instancing GLSL library.
7    // 
8    // When the INSTANCING define is set in the shader, 
9    // all global matrices are replaced with "instanced" versions.
10    // One exception is g_NormalMatrix which becomes unusable,
11    // instead the function ApplyNormalTransform is used to transform
12    // the normal and tangent vectors into world view space.
13    
14    // The world matrix and normal transform quaternion need to be passed
15    // as vertex attributes "inWorldMatrix" and "inNormalRotationQuaternion"
16    // respectively. 
17    // The VertexBuffers for those two attributes 
18    // need to be configured into instanced mode (VertexBuffer.setInstanced(true)). 
19    //  - inWorldMatrix should have 12 * numInstances floats.
20    //  - inNormalRotationQuaternion should have 4 * numInstances.
21    // Thus, instancing data occupies 4 vertex attributes (16 / 4 = 4).
22    // 
23    // The GL_ARB_draw_instanced and GL_ARB_instanced_arrays extensions 
24    // are required (OGL 3.3).
25    
26    uniform mat4 g_WorldMatrix;
27    uniform mat4 g_ViewMatrix;
28    uniform mat4 g_ProjectionMatrix;
29    uniform mat4 g_WorldViewMatrix;
30    uniform mat4 g_WorldViewProjectionMatrix;
31    uniform mat4 g_ViewProjectionMatrix;
32    uniform mat3 g_NormalMatrix;
33    
34    #if defined INSTANCING
35    
36    // World Matrix + Normal Rotation Quaternion. 
37    // The World Matrix is the top 3 rows - 
38    //     since the bottom row is always 0,0,0,1 for this transform.
39    // The bottom row is the transpose of the inverse of WorldView Transform 
40    //     as a quaternion. i.e. g_NormalMatrix converted to a quaternion.
41    //
42    // Using a quaternion instead of a matrix here allows saving approximately
43    // 2 vertex attributes which now can be used for additional per-vertex data.
44    attribute mat4 inInstanceData;
45    
46    // Extract the world matrix out of the instance data, leaving out the 
47    // quaternion at the end.
48    mat4 worldMatrix = mat4(vec4(inInstanceData[0].xyz, 0.0), 
49                                vec4(inInstanceData[1].xyz, 0.0), 
50                                vec4(inInstanceData[2].xyz, 0.0), 
51                                vec4(inInstanceData[3].xyz, 1.0));
52    
53    vec4 TransformWorld(vec4 position)
54    {
55        return (worldMatrix * position);
56    }
57    
58    vec4 TransformWorldView(vec4 position)
59    {
60        return g_ViewMatrix * TransformWorld(position);
61    }
62    

.WARNING: Could not enable HW skinning due to shader compile error:
com.jme3.renderer.RendererException: compile error in: ShaderSource[name=Common/MatDefs/Light/Lighting.vert, defines, type=Vertex, language=GLSL100]
Vertex shader failed to compile with the following errors:
ERROR: 0:111: error(#102) #error: NUM_BONES must be between 1 and 255.
ERROR: error(#273) 1 compilation errors. No code generated

at com.jme3.renderer.opengl.GLRenderer.updateShaderSourceData(GLRenderer.java:1126)
at com.jme3.renderer.opengl.GLRenderer.updateShaderData(GLRenderer.java:1153)
at com.jme3.renderer.opengl.GLRenderer.setShader(GLRenderer.java:1217)
at com.jme3.material.Material.preload(Material.java:1062)
at com.jme3.renderer.RenderManager.preloadScene(RenderManager.java:617)
at com.jme3.renderer.RenderManager.preloadScene(RenderManager.java:608)
at com.jme3.renderer.RenderManager.preloadScene(RenderManager.java:608)
at com.jme3.animation.SkeletonControl_31.testHardwareSupported(SkeletonControl_31.java:162)
at com.jme3.animation.SkeletonControl_31.controlRender(SkeletonControl_31.java:276)
at com.jme3.scene.control.AbstractControl.render(AbstractControl.java:119)
at com.jme3.scene.Spatial.runControlRender(Spatial.java:681)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:673)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:683)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:683)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:662)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1019)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1078)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:260)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:152)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:192)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:233)
at java.lang.Thread.run(Thread.java:745)

Oct 02, 2015 4:18:24 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.ArrayIndexOutOfBoundsException: 8160

  at com.jme3.animation.SkeletonControl_31.applySkinningTangents(SkeletonControl_31.java:622)
    at com.jme3.animation.SkeletonControl_31.softwareSkinUpdate(SkeletonControl_31.java:438)
    at com.jme3.animation.SkeletonControl_31.controlRenderSoftware(SkeletonControl_31.java:238)
    at com.jme3.animation.SkeletonControl_31.controlRender(SkeletonControl_31.java:296)
    at com.jme3.scene.control.AbstractControl.render(AbstractControl.java:119)
    at com.jme3.scene.Spatial.runControlRender(Spatial.java:681)
    at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:673)
    at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:683)
    at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:683)
    at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:662)
    at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1019)
    at com.jme3.renderer.RenderManager.render(RenderManager.java:1078)
    at com.jme3.app.SimpleApplication.update(SimpleApplication.java:260)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:152)
    at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:192)
    at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:233)
    at java.lang.Thread.run(Thread.java:745)

Edit: sorry above I mentioned “shape key” . I was wrong . i mean with “custom shape”

I didn’t test xbuf against 3.1.x today (only 3.0)

The error seems related to issue with a change into some 3.1 shader.
The warning is commons but doesn’t block :

  • Angle between tangents exceeds tolerance for vertex xxxx.
  • vertex influenced by more than 4 bones : 5, only the 4 higher are keep (jME only support 4 bones)

if I have time, I should try xbuf with 3.1 next week.

EDIT: @Ali_RS wrap you log, code,… between a pair of triple single backquote ```

1 Like

I used jme 3.0 and get different error:
here is my simple loadmodel class


import com.jme3.app.SimpleApplication;
import com.jme3.light.DirectionalLight;
import com.jme3.scene.Spatial;
import jme3_ext_xbuf.XbufLoader;

public class LoadModel extends SimpleApplication {

    @Override
    public void simpleInitApp() {
        assetManager.registerLoader(XbufLoader.class, "xbuf");
        Spatial s = assetManager.loadModel("Models/untitled2.xbuf");
        rootNode.attachChild(s);
    
        DirectionalLight sun = new DirectionalLight();
        sun.setDirection((new Vector3f(-0.5f, -0.5f, -0.5f)));
        sun.setColor(ColorRGBA.White);
        rootNode.addLight(sun);
    }

    public static void main(String[] args) {
        LoadModel app = new LoadModel();
        app.start();
    }
}

and get this message :

java.lang.NoClassDefFoundError: java/util/function/Consumer
    at jme3_ext_xbuf.XbufLoader.load(XbufLoader.java:25)
    at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:288)
    at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:374)
    at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:378)
    at chapter04.LoadModel.simpleInitApp(LoadModel.java:30)
    at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
    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:744)
Caused by: java.lang.ClassNotFoundException: java.util.function.Consumer
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 9 more

it is so strange. I think I am doing wrong some where.
when I saved my model as .xbuf in blender I get no error.
any way …
dose xbuf support custom shapes for armature?
what about face shape or face drivers?
can i convert .xbuf to .j3o ?
dose xbuf support baked animation using blender physic (eg : cloth , fluid , soft body) ?
these are questions I am curious to know. I am appreciating you for helping.

is a new class of java 8. I didn’t generate the java code for java 7 (planned for jme3_xbuf_loader).

What is custom shapes for armature ?

If you talk about morphing, I didn’t start to work on it. I don’t know if jme support morphing.

Yes, but today xbuf model use some custom controller and track. so you need jme3_xbuf_loader in the runtime classpath when you load & run j3o converted from xbuf.

I never tried, and didn’t create unit test case for it. xbuf bake animations, modifiers when it exports or renders in 3Dview.

PS: dose => does

Sorry for misspelling . :flushed:
by custom shape I mean these circles :

no there are not exported (at leat those of Jaime or created by rigify are not)

I do not want to export them directly to JME . Creating animation by using custom shapes are more easy than doing with the armature it self .(by using IK and FK). Now I created the animation on my model by using these. but I can not import the model to JME. I want a way to import just the animation and model itself to JME and not those shapes.

It’s de default behavior (see video with Jaime (the monkey)).
General rule: blender_io_xbuf doesn’t export what is hidden (render off). I guess you should be able to view your model rendered in 3DView blender with the “xbuf renderer” selected (require to have a start a remote xbuf renderer, like ModelViewer)

I just run the xbuf - Level 1 tuto on windows, and successfully display the default blender’ scene (cube + light + camera).

  • OS : windows 10 64bit
  • Blender: 2.75a (launch from conEmu/cmd with
> "\Program Files\Blender Foundation\Blender\blender.exe"
AL lib: (EE) UpdateDeviceParams: Failed to set 44100hz, got 48000hz instead
found bundled python: C:\Program Files\Blender Foundation\Blender\2.75\python
addon_utils.disable: blender_io_xbuf-master not disabled.
Modules Installed from 'C:\\Users\\dwayn\\Downloads\\blender_io_xbuf-master.zip'
 into 'C:\\Users\\dwayn\\AppData\\Roaming\\Blender Foundation\\Blender\\2.75\\sc
ripts\\addons' (blender_io_xbuf-master)
trying to save userpref at C:\Users\dwayn\AppData\Roaming\Blender Foundation\Ble
nder\2.75\config\userpref.blend ok
<!> event has invalid window
__init__
INFO: add relation: 'Mesh'(-9223372023546137492_0) to 'TObject'(-922337202355692
2508)
INFO: add relation: 'Material'(-9223372023556922328) to 'Mesh'(-9223372023546137
492_0)
INFO: add relation: 'Light'(-9223372023556922632) to 'TObject'(-9223372023556922
418)
INFO: add relation: 'Light'(-9223372023556922632) to 'TObject'(-9223372023556922
418)


@Empire_Phoenix, are you able to display the default scene ? if it’s an issue with the model, can you share it with me (PM)

Hi, respect for the great work. Here are male and femal models for testing: GitHub - bubblecloud/jme3-open-asset-pack: jMonkeyEngine Open Asset Pack

Can one already use xbuf with latest blender and jme 3.1 alpha? Is it easy to create in memory custom models for example based on in world sculpting and then save them as xbuf?

not yet, I’ll try this week with blender 2.76rc3 and 3.1-alpha1

I don’t understand “in memory”.

I get male.blend model with animation on it.
export it to .xbuf ( there was no error)
in importing to jme it failed. (no model showed in display)
it shows a lot of similar warning. I just put 2 of them.

Oct 03, 2015 8:55:20 PM com.jme3.util.TangentBinormalGenerator_31 processTriangleData
WARNING: Angle between tangents exceeds tolerance for vertex 129.
.
.

Oct 03, 2015 8:36:32 PM com.jme3.util.TangentBinormalGenerator_31 processTriangle
WARNING: Colinear uv coordinates for triangle [3,988, 3,989, 3,990]; tex0 = [0.878, 0.475], tex1 = [0.878, 0.476], tex2 = [0.878, 0.476]

I use jme3.1 with java 1.8u51

male rendered in blender (xbuf) via ModelViewer (very long to display on my today windows10 setup)

Oops …
yes it takes long to load . I waited for 1 min and get this :