Navigation

Ventuz 6 Quick Guide

  • Introduction
  • Getting Started
  • Ventuz Editions
  • Designer Overview
  • Ventuz System Requirements
  • Configuration
  • Video/Audio Configuration
  • Machine Configuration
  • GPI Configuration for Runtime or Director
  • Optimize Rendering Performance
  • Supported Formats
  • Supported Hardware
  • Multisampling / Anti-Aliasing
  • Input Subsystem
  • Ventuz Proprietary Files
  • What's new
  • FAQ
  • Common Mistakes
  • Deployment
  • Migration Guide
  • Ventuz 5 Migration Guide
  • Summary Shortcuts

Ventuz 6 Designer

  • Index
  • Getting Started
  • Designer Options
  • Designer Overview
Projects & Scenes
  • Projects and Scenes
  • Project Browser
  • Project Properties
  • Project Maintenance
  • Project and Scene Data
  • Scene Tree
  • Scene Management
  • Scene Statistics
  • Deployment
Interface
  • Designer Interface
  • Renderer Window
  • Realtime Rendering
  • Optimize Scene Performance
  • Performance Statistics
  • Transformation Gizmo
  • Render to Disk
  • Camera Navigation
  • Isolated Objects
  • Manipulate Objects with Gizmos
  • Layer Editor
  • Common Layer Properties
  • IPP Effects
  • Color Correction FX
  • Distortion FX
  • Filter FX
  • Layer Editor Shortcuts
  • Hierarchy Editor
  • Working with Nodes
  • Containers
  • Find and Replace
  • Shortcuts Hierarchy Editor
  • Content Editor
  • Working with Nodes
  • Containers
  • Content Editor Shortcuts
  • Toolbox
  • Property Editor
  • Project Data and Scene Data
  • Property Groups
  • Shader Editor
  • Text Editor
  • Scene Tree
  • Message View
  • Stage Editor
  • Container Outline
  • Watches Editor
  • Animation Editor
  • Animation and State Engine
  • Templates
  • Template Engine
  • Shortcuts Animation Editor
  • Text Rendering
  • Text Editor
  • Character Sets
  • Geometry Import
  • Input Subsystem
  • Multitouch
  • TUIO Protocol
  • Open Sound Control
  • How to work with Head Mounted Displays
  • Cluster
  • Multi Display Setups and Shaping
  • Warping, Soft Edging and Masking
  • Available Nodes
  • Animation Nodes
  • Material&Color Nodes
  • Data Nodes
  • Geometry Nodes
  • Interaction Nodes
  • IO Nodes
  • Layers
  • Light Nodes
  • Logic Nodes
  • Render Option Nodes
  • Slides Nodes
  • Sound Nodes
  • Text Nodes
  • Texture Nodes
  • VR Nodes
  • World Nodes

Ventuz 6 Node Reference

ANIMATION
  • Mover
  • Alternator
  • Simple Control
  • Timeline Control
  • Anmation Rig
  • Keyframe Animation
  • Animation Group
COLOR/MATERIAL
  • Alpha
  • Fog
  • Ground Fog
  • Sky Box
  • Color to RGBA
  • HSLA to Color
  • RGBA to Color
  • Color Transformer
  • HLSL Shader
  • Color
  • Material
  • Color Picker
  • Substance Material
DATA
  • Database
  • Excel
  • JSON
  • RSS Feed
  • Resource Linker
  • Text File
  • XML
GEOMETRY
  • Rectangle
  • Rounded Rectangle
  • Gradient Rectangle
  • Overlay Rectangle
  • Cube
  • Circle
  • Sphere
  • Cylinder
  • Cone
  • Torus
  • Chart
  • Random Points
  • Mesh Loader
  • Geometry Import (Live)
  • Volume
  • Get Bounding Box
  • Arrow
  • Particle System
  • Path Renderer
  • Geometry Renderer
INTERACTION
  • Interaction Rect
  • Touch Button
  • Touch Excluder
  • Touch Marker
  • Touch Paint
  • Touch Pattern
  • Touch Proxy
  • Touch Ripples
  • Touch Transformations
  • Web Browser
  • Touch Teleport
  • Touch Simulator
INPUT/OUTPUT (I/O)
  • GPI
  • Joystick
  • Keyboard
  • MIDI
  • Mouse
  • Network
  • Open Sound Control
  • Serial
  • Timecode
  • DMX
LAYER
  • 3D Layers
  • 3D Layer Reference
  • 2D Layers
  • PSD Import Layer
  • Others
LIGHT
  • Light Sources
LOGIC
  • Array Processing
  • Convert To Text
  • Cluster Synchronization
  • Counter
  • Date Time
  • Directory
  • Dispatcher
  • Enumeration
  • Expressions
  • Invert
  • Log
  • Loop Breaker
  • Math Effects
  • Matrix Operations
  • Scene Event
  • Script
  • String Operations
  • System ID
  • Text Splitter
  • Timer
  • Toggle
  • URL
  • Value Switch
  • Value Buffer
  • Variables
  • Visual Indexer
RENDER OPTIONS
  • Alpha Blending
  • Color Write
  • Alpha Testing
  • Clip Plane
  • Filter
  • Mask
  • Mirror
  • Effect
  • Render Cube Map
  • Draw Modes
  • Stencil
  • ZTesting
SOUND
  • Audio Clip
  • Sound
  • Volume Control
  • Audio Analysis
SLIDES
  • Slide Manager
  • Slide
  • Slide Port
  • Pivot
TEXT
  • Text Effects
  • Text Layouts
  • Text Rendering
TEXTURE
  • Background
  • Hatch
  • Image
  • Texture
  • SVG Loader
  • Gradient Texture
  • Live Video
  • Movie Stream
  • Movie Frame
  • Movie Clip
  • Texture Loader
  • Snapshot
  • Snapshot Framebuffer
  • Texture Saver
  • Video Source Selector
  • VIO Input
  • Spout Receiver
  • NDI Receiver
  • Substance Loader
VR/AR
  • Tracked Devices
  • Draw Tracked Devices
WORLD
  • Axis
  • Billboard
  • GetWorld
  • SetWorld
  • Arrange
  • Ticker
  • Layout
  • Group
  • World Z Sort
  • YesNo
  • Switch
  • Spread
  • Filter Pass
  • Set Pass
  • Hierarchy Container
  • Scene Port
  • Content Container
  • Template Port
  • Container Info
  • Camera
  • Paths

Ventuz 6 Configuration Editor

  • Configuration
  • Machine Configuration
  • Video/Audio Configuration
  • Web Configuration Editor and License Manager
  • Render Setup Editor
  • Warping and Soft-Edging Editor
  • Supported Hardware
  • How to Setup a Cluster Render

Ventuz 6 Director

  • Application Settings
  • Assets
  • Channels
  • Command Line Options
  • Content References
  • Designing Templates
  • Environment
  • Glossary
  • Index
  • Introduction
  • Pages
  • Playlist
  • Plug-Ins
  • Project Data
  • Property Editor
  • Shortcuts
  • GPI Configuration
  • Shot Box
  • Show
  • Taking Action
  • Timeline
  • Topology
  • User Interface
  • Director Mode
  • Macros

How To

  • How to Run Ventuz
  • How to Work with Designer
  • Ventuz Designer Drag&Drop workflow
  • How to use Head Mounted Displays
  • How to work with Shadows
  • How to use Emoijs
  • How to Build a Template
  • How to use Newtek NDI
  • How to Create Visuals Loader Node
  • How to Remote Control with a Phone
  • How to Setup a Cluster Render
  • How to use a Mixed Frame Rate Cluster
  • How to use Tracking
  • How to work with 3D Reference Layers
  • How to create a Firework Particle System
  • How to use DDS with new Block Compression modes
  • How to setup Spout with Ventuz
  • How to use the Substance Integration

Keyboard Shortcuts

  • Summary Shortcuts
  • Layer Editor Shortcuts
  • Hierarchy Editor Shortcuts
  • Content Editor Shortcuts
  • Animation Editor Shortcuts
  • Director Shortcuts

Advanced and Development

  • Command Line Options
  • Remoting Overview
  • Remoting 4
  • Remoting 4 via Websockets
  • Deprecated Remoting
  • Ventuz IP Ports
  • Ventuz Machine Service
  • Remoting Machine Signature
  • TUIO
  • .NET Scripting
  • HLSL Shader Programming
  • Ventuz API and SDK
  • Ventuz VIO API
  • Ventuz File Format (VFF)
  • Ventuz Stream Out API

General Reference

  • Terminology
  • Manual Index

Miscellaneous

  • Presets
« Previous Article
» Index «
Next Article »

JSON

JSON This node takes a JSON string and provides its content for further processing.

​JSON (JavaScript Object Notation) is an open standard format that uses human-readable text to transmit data objects consisting of key:value pairs. It is used primarily to transmit data between a server and web application, as an alternative to XML. Many online services such as ​Twitter, ​Facebook, ​Yahoo or ​Google are using JSON as a simple data format for their information services.

The JSON Parser node can parse JSON objects, arrays of objects, single values or arrays of values. In contrast to XML, which only knows the string type, JSON can handle a few strongly typed values. Unfortunately JSON doesn't define any data size or precision of these types, so many incompatibilities can be expected when using JSON as data interchange format.

Examples

  1. Single value:
    "A simple string\nwith linefeeds and escaped \u0055nicode"
    
  2. Array of values
    [ 1, 2, 3, 4 ]
    
  3. Single object (with nested object values and array)
    {
        "firstName": "John",
        "lastName": "Smith",
        "age": 25,
        "address": {
            "streetAddress": "21 2nd Street",
            "city": "New York",
            "state": "NY",
            "postalCode": 10021
        },
        "phoneNumbers": [
            {
                "type": "home",
                "number": "212 555-1234"
            },
            {
                "type": "fax",
                "number": "646 555-4567"
            }
        ]
    }
    
  4. Array of objects
    [
    {
        "firstName": "John",
        "lastName": "Smith",
        "age": 25,
    },
    {
        "firstName": "Donald",
        "lastName": "Duck",
        "age": 5,
    },
    {
        "firstName": "John",
        "lastName": "Doe",
        "age": 178,
    }
    ]
    

JSON Types

JSON natively supports the following data types:

  • string: "quoted text with\nC-style\tcharacter escaping"
  • boolean: true or false
  • numbers: (integers and or floating point numbers) 0, 561423, -104.199, 0.123e-6
  • null-value: null
  • objects: (see below)
  • arrays: elements can be a mixture of values, objects or arrays

JSON Objects

A JSON object is expressed in a list of named values, where each name is a quoted string followed by a colon :. The value is a choice of the supported types. A JSON object can be understood as a dictionary or a list key:value pairs. JSON is a very lazy format . Therefore some issues have to be in mind when using JSON:

  • JSON doesn't define that the name within an object must be unique. The value "user" could appear two times, for example.
  • the type of a named value may differ. A value named "city" could appear as a string in one JSON object and as a number in another one.
  • there are no naming rules, so some JSON objects may provide weird names, containing whitespaces, line feed or non-printable characters.
  • the actual text format is not defined. Usually text is transferred as UTF-8 or Unicode. If the transport is not clear, the 7-bit ASCII format with escaped Unicode should be the preferred choice.

Usually providers for JSON formatted data try to avoid the issues described above. If a JSON text with such issues has to be parsed by the Ventuz JSON Parser node you might face problems gathering the correct information from that object!

JSON Parser Node

The Ventuz JSON Parser node provides three properties. Access to the parsed data is provided by properties that are created by editing the custom model of the JSON Parser node.

  • Inputs:
    • Json (JsonObject): Receives the JsonObject (or text) to be parsed.
    • Index (integer): The current index of the parsed object that has to be transferred to the output properties.
  • Outputs:
    • Count (integer): the number of elements in the parsed JSON object.
    • ... (all types): Custom Model output properties

The type JsonObject is an internal Ventuz type. This type can be converted from and to string via binding. Any node that provides a string can be bound to the Json input. Any Json output can be bound to any node that accepts JsonObjects or strings.

These different types of JSON text can be parsed:

  1. A single unnamed JSON value.
  2. A single unnamed array of JSON values.
  3. A single unnamed JSON object.
  4. A single array of JSON objects.

The context menu of the JSON Parser node and the Property Editor show an Update verb, which automatically creates the desired custom model output properties based on the current JSON text assigned to the Json property. The common design workflow is to assign an example JSON text to the node and select Update and let Ventuz create the correct properties for you. If you prefer to create your own custom model you can use the Custom Model Editor.

The properties defined in the custom model are either the Value property (case 1 and 2) or the names of the first JSON object in cases 3 and 4. In cases 1 and 3 the Count property will provide a 1 value, because there's only one element in the parsed object. In cases 2 and 4, Count provides the number of elements available in the arrays.

If the parser was unable to parse the text, the Count property will be 0 and the icon of the Parser node turns red. All output properties will output the default value of their type (false, null, zero)

The automatic update of the custom model can also recognize arrays of values. Some rules apply:

  • If all elements of the array are of the same simple type (booleans, numbers or strings), a Ventuz array of its corresponding type is created.
  • null is interpreted as type string
  • If all numbers are without a decimal point (.) they are treated as integer
  • If an array of numbers is mixed (integers and floating point numbers) it is treated as float (single)

Ventuz only handles 32-bit IEEE float numbers (single precision) and 32-bit integer numbers. Some JSON objects may provide large integers or number with a higher precision (64-bit or 128-bit). These numbers won't be parsed correctly! Try to parse them as string instead.

Chains of Parser nodes

Multiple JSON Parser nodes can be chained to parse nested JSON objects. If the first parser provides an output property of type JsonObject (or string) a secondary parser node can receive that object and output its values.

Creating JSON text

If a conversion back to text is required, you can either simply bind the JsonObject output to a string input property or use the Convert To Text node. The Convert To Text allows you to specify a format for the JsonObject (like number formats #.###) which controls the conversion.

The string conversion of a JsonObject supports two formats:

  • a ASCII: all non-ASCII characters are escaped as unicode (ä = \u00E4)
  • c COMPACT: all whitespaces and linefeeds are stripped.

The format can be specified in the convert to text node:

{0}               normal formatted JSON (default)
{0:a}             all ASCII compatible
{0:c}             compact - one line
{0:ac} or {0:ca}  ascii-compact

The Value0 binding must be of type JsonObject. This type is provided either the Json input property or any Json-object output property of the Json Parser node.

If a complete JSON object has to be constructed, please see JSON section in the Convert To Text page.

See also:
  • ​JavaScript Object Notation
  • ​JSON Syntax
  • Convert to Text node

« Previous Article
» Index «
Next Article »
Copyright 2020 Ventuz Technology