Convert Tree to Value (vuo.type.tree.value)

Converts the data contained in the tree to a chosen data type.

If the output port’s data type is Text, Integer, Real, or Boolean, this node interprets the tree’s content as that data type. For example:

Data typeTreeOutput
IntegerTree with content 10241024
BooleanTree with content truetrue

If the output port’s data type is 2D Point, 3D Point, 4D Point, or Color, this node interprets the tree’s content or children as the components of that data type. For example:

Data typeTreeOutput
2D PointTree created from XML <location><x>1.2</x><y>3.4</y></location>1.2, 3.4
3D PointTree created from JSON {"coordinates": {"x":1.2, "y":3.4, "z":5.6}}1.2, 3.4, 5.6
4D PointTree created from XML <point><x>1.2</x><y>3.4</y><z>5.6</z><w>7.8</w></point>1.2, 3.4, 5.6, 7.8
4D PointTree with content 1.2, 3.4, 5.6, 7.81.2, 3.4, 5.6, 7.8
ColorTree created from JSON {"foreground": {"r":1, "g":0, "b":0, "a":1}}opaque red
ColorTree with content 1.0, 0.0, 0.0, 1.0opaque red
ColorTree with content #00FF00opaque green

The tree’s name doesn’t matter. This node only looks at the tree’s content and descendants.

Keyword: conversion


Back to vuo.type node set documentation.