Can you access custom data properties exported in gltf in panda?

This may be re-redundant question. I am probably just not finding it in the docs or on here, so sorry about that.

Essentially i want metadata to be accessible from blender to panda3d to convey model meaning in some way. The way im away of doing this in blender is the “Custom Properties” panel in a models data tab.

Screenshot from 2023-07-10 13-52-53

Its then available in the extras section of the gltf.

"meshes":[
		{
			"extras":{
				"test":1.0,
				"another":1.0
			},
			"name":"Cube",
			"primitives":[
				{
					"attributes":{
						"POSITION":0,
						"NORMAL":1,
						"TEXCOORD_0":2
					},
					"indices":3,
					"material":0
				}
			]
		}
	],

I am not sure how to access this in panda. I also tried to convert all the way to egg and see if it ended up as a “tag” it doesnt appear it does. Thanks for the help.

It depends on what you are using, if you are using blend2bam, then there is a manual on how to do it.

Thank you @serega-kkz, unfortunately this is standard gtlf export. Blend2Bam is failing for me with this issue:
SystemError: GPU API is not available in background mode

and yabee is just straight up broken on 3.6:

Exception in module unregister(): '/home/csevier/.config/blender/3.6/scripts/addons/YABEE-master/__init__.py'
Traceback (most recent call last):
  File "/home/csevier/Apps/blender-3.6.0-linux-x64/3.6/scripts/modules/addon_utils.py", line 421, in disable
    mod.unregister()
  File "/home/csevier/.config/blender/3.6/scripts/addons/YABEE-master/__init__.py", line 519, in unregister
    bpy.utils.unregister_module(__name__)
AttributeError: module 'bpy.utils' has no attribute 'unregister_module'

Blender quit

Sad situation, you can try this fork. I use it sometimes, at least it works.

Thanks! I will see if I can get that working.

Perhaps im installing it incorrectly. Both that Yabee and Yabee-1 are not working for me on blender 3.6

Maybe to some one can comment on blend2bams error:
SystemError: GPU API is not available in background mode

Maybe I will make a separate post regarding this.

I have it running on 3.5, but there is a breakdown.

  File "C:\Users\sereg\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\YABEE\yabee_libs\egg_writer.py", line 1236, in get_egg_materials_str
    for node in bpy.data.materials[0].node_tree.nodes:
AttributeError: 'NoneType' object has no attribute 'nodes'

This is not critical, you need to update the API a little.

It being the yabee exporter?

Yes, but it was a fork from Maxwell175.

Got it, so i fixed blend2bam, apparently when you run blend2bam, it loads in blender preferences and my addons scripts were broken so it was failing out! I cleaned up my addons and now blend2bam works and the tags are indeed in there!

2 Likes

Well it would appear that even though the data is a tag in the egg file.

  <Group> 00037_26074p01.dat {
    <Transform> {
      <Rotate> { 90.000001961151 -1 0 0 }
      <Translate> { 0.660000026226044 0.540000021457672 0.239999979734421 }
    }
    <Tag> Lego.isTransparent {
      False
    }
    <Tag> panda {
      panda
    }

Its unfortunately not a tag on the object?

# length = 0 
<PandaNode.tags[] of ModelRoot tuxWing.egg>

Maybe im checking the wrong tag?

   print(len(self.model.tags))

ohhh yeah, i bet its a tag on the subchild.

yup that was it!!!
PandaNode 00037_26074p01.dat [Lego.isTransparent panda] T:q(pos 0.66 0.54 0.24 hpr 0 -90 0)

I think its worth noting for future readers. The custom properties only work when they are blender “Object properties” not “Data Properties”!

Happy Hacking.

1 Like