JSON Helpers
Skyreal VR provides Blueprint nodes to build, read and save JSON data, for example to store your extension's data or exchange it with another tool. They are in the Skr › Helper › Json category. Back to Helpers.
Build a JSON object
|
Node |
What it does |
|---|---|
|
Json Make |
Creates an empty JSON object. |
|
Json Make Field |
Adds a field (name + value) to an object, and returns the object. Chain them to add several fields. |
|
Json Make String / Int / Float / Bool / Null |
Turns a value into a JSON value. |
|
Json Make Array |
Turns an array of JSON values into a JSON value. |
|
Json Make Object |
Turns a JSON object into a JSON value, to nest it in another object. |
Read and edit a JSON object
|
Node |
What it does |
|---|---|
|
ToJsonObject (String) |
Parses a JSON string into an object. |
|
Json Has Field / Json Has Typed Field |
Tells whether a field exists, optionally with a given type. |
|
Json Set Field / Json Remove Field |
Changes or removes a field. |
|
ToString / ToInteger / ToFloat / ToBool / ToArray / ToJsonObject (JsonValue) |
Reads a JSON value as a Blueprint type. |
|
Json Type |
Returns the type of a value: String, Number, Boolean, Array, Object or Null. |
Save it
ToString (JsonObject) or ToPrettyString (JsonObject) turns the object into text. Then save it with the Files nodes, for example Try Save String To File In Resource Directory.
Example
This graph builds the JSON below and saves it in the experience's resource folder:
{
"Even": [ 0, 2, 4 ],
"Odd": [ "one", "three", "five" ],
"Object":
{
"ObjectParam1": true,
"ObjectParam2": true
}
}