Error importing assets .gltf

I’m trying to import my blender model into jmonkey, but the material is applying badly, and when I try to create one from the sceneComposer by clicking "create j3m material I get the following errors
errors:

Loaded asset ringhiera
Unknown texture option "Texture2D[name=image0.jpeg," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "image=Image[size=2048x2048," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "format=BGR8," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "id=8]]:returned" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "null" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Cannot locate key (Mipmapped) for material Materials/Generated/ringhiera-Cube_007.j3m
Unknown texture option "Texture2D[name=image1.jpeg," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "image=Image[size=2048x2048," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "format=BGR8," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "id=9]]:returned" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "null" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Cannot locate key (Mipmapped) for material Materials/Generated/ringhiera-Cube_007.j3m
The texture key has linear color space, but the material parameter BaseColorMap specifies no color space requirement, this may lead to unexpected behavior.
Check if the image was not set to another material parameter with a linear color space, or that you did not set the ColorSpace to Linear using texture.getImage.setColorSpace().
Unknown texture option "Texture2D[name=image2.png," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "image=Image[size=2048x2048," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "format=BGR8," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "id=10]]:returned" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "null" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Cannot locate key (Mipmapped) for material Materials/Generated/ringhiera-Cube_007.j3m
smoothing groups are not supported, statement ignored: s
Unknown texture option "Texture2D[name=image0.jpeg," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "image=Image[size=2048x2048," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "format=BGR8," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "id=8]]:returned" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "null" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Cannot locate key (Mipmapped) for material Materials/Generated/ringhiera-Cube_007.j3m
Unknown texture option "Texture2D[name=image1.jpeg," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "image=Image[size=2048x2048," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "format=BGR8," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "id=9]]:returned" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "null" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Cannot locate key (Mipmapped) for material Materials/Generated/ringhiera-Cube_007.j3m
The texture key has linear color space, but the material parameter BaseColorMap specifies no color space requirement, this may lead to unexpected behavior.
Check if the image was not set to another material parameter with a linear color space, or that you did not set the ColorSpace to Linear using texture.getImage.setColorSpace().
Unknown texture option "Texture2D[name=image2.png," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "image=Image[size=2048x2048," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "format=BGR8," encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "id=10]]:returned" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "null" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Cannot locate key (Mipmapped) for material Materials/Generated/ringhiera-Cube_007.j3m
The texture key has linear color space, but the material parameter BaseColorMap specifies no color space requirement, this may lead to unexpected behavior.
Check if the image was not set to another material parameter with a linear color space, or that you did not set the ColorSpace to Linear using texture.getImage.setColorSpace().
com.jme3.asset.AssetNotFoundException: e (Flipped)
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:385)
	at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:407)
	at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:97)
	at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:92)
	at com.jme3.app.AppTask.invoke(AppTask.java:147)
	at com.jme3.app.LegacyApplication.runQueuedTasks(LegacyApplication.java:759)
	at com.jme3.app.LegacyApplication.update(LegacyApplication.java:775)
	at com.jme3.gde.core.scene.SceneApplication.update(SceneApplication.java:296)
	at com.jme3.system.awt.AwtPanelsContext.updateInThread(AwtPanelsContext.java:237)
	at com.jme3.system.awt.AwtPanelsContext.access$200(AwtPanelsContext.java:46)
	at com.jme3.system.awt.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:80)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:126)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:160)
	at java.base/java.lang.Thread.run(Thread.java:833)
com.jme3.asset.AssetNotFoundException: e (Flipped)
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:385)
	at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:407)
	at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:97)
	at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:92)
	at com.jme3.app.AppTask.invoke(AppTask.java:147)
	at com.jme3.app.LegacyApplication.runQueuedTasks(LegacyApplication.java:759)
	at com.jme3.app.LegacyApplication.update(LegacyApplication.java:775)
	at com.jme3.gde.core.scene.SceneApplication.update(SceneApplication.java:296)
	at com.jme3.system.awt.AwtPanelsContext.updateInThread(AwtPanelsContext.java:237)
	at com.jme3.system.awt.AwtPanelsContext.access$200(AwtPanelsContext.java:46)
	at com.jme3.system.awt.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:80)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:126)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:160)
	at java.base/java.lang.Thread.run(Thread.java:833)
com.jme3.asset.AssetNotFoundException: e (Flipped)
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:385)
	at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.java:407)
	at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:97)
	at com.jme3.gde.core.properties.preview.TexturePreview$1.call(TexturePreview.java:92)
	at com.jme3.app.AppTask.invoke(AppTask.java:147)
	at com.jme3.app.LegacyApplication.runQueuedTasks(LegacyApplication.java:759)
	at com.jme3.app.LegacyApplication.update(LegacyApplication.java:775)
	at com.jme3.gde.core.scene.SceneApplication.update(SceneApplication.java:296)
	at com.jme3.system.awt.AwtPanelsContext.updateInThread(AwtPanelsContext.java:237)
	at com.jme3.system.awt.AwtPanelsContext.access$200(AwtPanelsContext.java:46)
	at com.jme3.system.awt.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:80)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:126)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:160)
	at java.base/java.lang.Thread.run(Thread.java:833)

and the j3m file material looks like this:

Material MyMaterial : Common/MatDefs/Light/PBRLighting.j3md {
    MaterialParameters {
        EmissivePower : 3.0
        BackfaceShadows : false
        Roughness : 1.0
        EmissiveIntensity : 2.0
        Glossiness : 1.0
        BaseColor : 1.0 1.0 1.0 1.0
        ParallaxHeight : 0.05
        Metallic : 1.0
        NormalType : 1.0
        Emissive : 0.0 0.0 0.0 1.0
        NormalMap : Texture2D[name=image0.jpeg, image=Image[size=2048x2048, format=BGR8, id=8]]:returned null key
        BaseColorMap : Texture2D[name=image1.jpeg, image=Image[size=2048x2048, format=BGR8, id=9]]:returned null key
        MetallicRoughnessMap : Texture2D[name=image2.png, image=Image[size=2048x2048, format=BGR8, id=10]]:returned null key
        Specular : 1.0 1.0 1.0 1.0
    }
    AdditionalRenderState {
        FaceCull Off
        DepthWrite On
        ColorWrite On
        PolyOffset 0.0 0.0
        DepthTest On
        Blend Off
        Wireframe Off
    }
}

Can you be more specific? What does the material look like in Blender? What does the material look like in JME?

…the SDK’s material editor might be a little wonky but maybe you don’t even need it if you can figure out what’s wrong with your material in the first place.

(99% of the time, it’s no light probe. The other 1% of the time, it’s flipped textures.)

By the way

The formatting looks wrong. See an example of how to specify textures here:

i didn’t format i did all the sdk

I won’t be home for 2 days, I ask a friend of mine if he can send me some screenshots meanwhile:
the material looks stretched on the model, and opening the model (converted from .gltf to .j3o)
I get the following output by opening the model in sceneComposer:

Unknown texture option "returned" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "null" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Cannot locate key (Mipmapped) for material Materials/Generated/ringhiera-Cube_007.j3m
Unknown texture option "returned" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "null" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Unknown texture option "key" encountered for "Materials/Generated/ringhiera-Cube_007.j3m" in material "Materials/Generated/ringhiera-Cube_007.j3m"
Loaded asset ringhiera

It’s probably also useful to know which version of Blender you used to make the gltf (or if you used something other than Blender then that would be useful also) and what version of JME you are using.

There are also sites where you can upload your gltf to see if it is even good. I don’t have the links handy.

Something funny is definitely happening, though. Either the GLTF is corrupt/bad or it’s a version that JME does not support somehow (which would also be weird)… or the SDK itself is messing it up.

Blender version is 3.4, SDK version is latest taken from github 3.6 pre-release 3

[update]

trying to add a UV mapping to the blender project now it gives the same output but the material is not shown, but the material of missing-material is shown

if it can be useful I can directly send the .blender of the project

[edit]

The same j3o in jmonkeybuilder is loaded but still shown badly

@pspeed
I tried to select invert, to select repeat it but nothing… it stays so stretched…

original from blender:

[EDIT]

other viewers like the pre-installed windows one display the .gltf without problems

[EDIT2]

libgdx load the models without problems

still getting wrong material

Blender file

I can reproduce this in the SDK.

  1. Create default cube in Blender
  2. Apply a shader with a texture.
  3. Export as gltf
  4. Open in SDK. Select “generate material”.
  5. Open material. Missing texture with the same logs as above.

I will assume it’s a problem in the SDK since it happens at the “generate material” step, which is not available in core.

I did some digging, and sorry, it’s just not going to work, creating a material from a gltf material.
Beside all the extra text, the texture is called ‘image0.jpeg’ (actually ‘dirt.jpg’ when I chose it).
There’s no way the SDK can figure out that stuff.

So, I recommend using the material that comes with the gltf. There’s no need to create a material locally, the converter creates and stores one in the .j3o.
If you want the extra control, create a material separately and apply it to the model.

Hmm, how does SDK generate material?

Once the model is loaded by GltfLoader, the texture names in the material should be correct. SDK just needs to use J3MExporter to save the material to a file.

J3MExporter j3mExporter = new J3MExporter();
j3mExporter.save(material, file);

Yeah, this also seems strange to me. As far as I remember, JMEC will export PBR j3ms just fine from gltf if so marked.

the problem is that as you see the material applies to the model badly, in any way I export/import it even without creating a file for the separate material… I also tried to validate the .gltf to see if it was an export problem but it seems to be valid, I also tried to open it in other 3D editors and they load/import it perfectly, I loaded in a previous post the .blend if you want to try to reproduce
@pspeed

no, i’m joking in unity import like jmonkey

Yes, it struck me later as well that there are alternatives. I had my bug fixing hat on and wanted it to be a parsing issue. Somehow I also seemed to think the texture was linked, rather than contained in the file.

I’ll revisit this later.