JsonTree addChild for vec*


#1

Hi,
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?


#2

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

cheers,
Rich


#3

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.


#4

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