JsonTree addChild for vec*

There are JsonTree::addChild for different types like int, float but not for vec2 vec3 vec4.
This makes a compile error:

vec4 value = jsonElement->getChild("value").getValue< vec4 >();

Should I use a string for now or is there something I’m missing?

I’ve always just made wrapper functions to pull out vec2, vec3, vec4, Color, ColorA, etc. Like these for example.


1 Like

What Rich said, plus I’d recommend to stop using JsonTree and start using Json::Value directly. The JsonTree wrapper is flawed and unnecessary. At least in my opinion.

Right, we’ve been meaning to deprecate JsonTree,and really should do that soon…