glTF `extras` metadata missing

Babylon seems to have the plugin ExtrasAsMetadata, which should add glTF extras properties to mesh.metadata.gltf.extras

However, I can’t seem to find these extras properties after importing a mesh in the Playground example (console.log(mesh.metadata) shows an empty object)

Here is the glTF file used, which has a single cube with the data:

"extras":{
	"test":"hi"
}

Would anyone know what I’m doing wrong here? Thank you for your help :smiley:

This is how it should look like:

{
	"asset":{
		"generator":"Khronos glTF Blender I/O v3.6.27",
		"version":"2.0"
	},
	"scene":0,
	"scenes":[
		{
			"extras":{
				"khr_physics_exporter_props":{}
			},
			"name":"Scene",
			"nodes":[
				0
			]
		}
	],
	"nodes":[
		{
			"extras":{
				"testProp":"Hello Babylon"   <===========
			},
			"mesh":0,
			"name":"Cube"
		}
	],
	"materials":[
		{
			"doubleSided":true,
			"name":"Material",
			"pbrMetallicRoughness":{
				"baseColorFactor":[
					0.800000011920929,
					0.800000011920929,
					0.800000011920929,
					1
				],
				"metallicFactor":0,
				"roughnessFactor":0.5
			}
		}
	],
	"meshes":[
		{
			"name":"Cube",
			"primitives":[
				{
					"attributes":{
						"POSITION":0,
						"NORMAL":1,
						"TEXCOORD_0":2
					},
					"indices":3,
					"material":0
				}
			]
		}
	],
(...)

Btw. was this exported in Blender? Then make sure you tick the “Custom properties” box:

2 Likes

Thank you so much, @Joe_Kerr ! I did export it via Blender with the Custom Properties box ticked

Turns out that the Custom Properties have to be defined in the “Object Properties” pane in Blender for the object instead of its “Object Data Properties” pane

1 Like