We now read glTF extras data to X3D nodes metadata.
In practical terms, it means that you can set custom properties in Blender, and then read it back in CGE using MetadataString and similar properties on nodes.
We read “extras” data from glTF primitives, materials, cameras and transformation nodes. If you use Blender, it means we can read “Custom Properties” from Blender objects, meshes, materials and cameras.
More pointers how to read custom properties defined in Blender are here. Our demo-models contain examples of Blender models with custom properties, see in subdirectories
blender/custom_properties_2/. Finally, reworked examples/short_api_samples/metadata shows how to read and write metadata in CGE.
Our metadata API was also a bit simplified. MetadataString can now be used easier (doesn’t have an index, use it like
Node.MetadataString['my_name']), but we expose MetadataStringArray when you need an array (use it like
Shape.collision field supports
"NONE"value. In Pascal you would set it as
MyShapeNode.Collision := scNone.
We support a special custom property at Blender mesh:
CastleCollision. It can have these values:
- none — do not collide
- box — collide as box
- default — collide as precise triangles
See the Shape.collision field linked above for more details.
This way you can easily turn off collisions in Blender, or set collisions to use simple box for complicated shapes. Just set Blender custom property
CastleCollisionon a mesh.
Demo usage in examples/fps_game/data/example_level level. The level defined there contains everything collidable + non-collidable water surface in one model, one glTF file, and the water is marked with CastleCollision=none.
Documented various X3D extensions added lately to have perfect glTF support: