Houdini 20.5 Nodes TOP nodes

JSON Output TOP node

Performs various operations that produce JSON output

On this page
Since 17.5

This node offers various functionality that will produce a JSON file as output.

Tip

The $HH/help/files/pdg_examples/top_jsonpipeline example shows how you can use this node to prettify an existing .json file.

Parameters

Work Items

Generate When

Determines when this node will generate work items. You should generally leave this set to “Automatic” unless you know the node requires a specific generation mode, or that the work items need to be generated dynamically.

All Upstream Items are Generated

This node will generate work items once all of the input nodes have generated their work items.

All Upstream Items are Cooked

This node will generate work items once all of the input nodes have cooked their work items.

Each Upstream Item is Cooked

This node will generate work items each time a work item in an input node is cooked.

Automatic

The generation mode is selected based on the generation mode of the input nodes. If any of the input nodes are generating work items when their inputs cook, this node will be set to Each Upstream Item is Cooked. Otherwise, it will be set to All Upstream Items are Generated.

Input

Input Source

This specifies the input source for the JSON data

Upstream Work Item Fields

The node will treat the upstream work item(s) as JSON data

Upstream Output File

The node will load JSON data from an output file on the upstream work item(s)

Custom File Path

The node will load JSON data from a custom file path

Attribute

The node will load JSON data from an string, dictionary or Python object attribute

Write Partition Contents

Controls how partition work items are written. By default, the partition itself is written to disk as a single work item, but you can turn on this parameter to write the partition contents to JSON as an array of work items.

This parameter is only available when Input Source is set to Upstream Work Item Field.

Skip Default Fields

When this parameter is enabled, work item fields that are at their default value are omitted from the output.

This parameter is only available when Input Source is set to Upstream Work Item Field.

File Tag

When Input Source is set to Upstream Output File this parameter determines the file tag to use when looking up a file from the upstream items.

File Path

When Input Source is set to Custom File Path, this parameter is used to specify the input JSON file.

Attribute Name

When Input Source is set to Attribute this parameter determines the name of the attribute that contains JSON data.

Attribute Index

When Input Source is set to Attribute and the attribute is an array, this parameter determines which array element should be exported to JSON.

Output

Output As

Determines where the node should write the output JSON data.

Output File Tag

When Output As is set to JSON File, this specifies the tag of the reported result data.

Output File

When Output As is set to JSON File, this specifies the output file path.

Attribute Name

When Output As is set to String Attribute, Dictionary Attribute, or PyObject Attribute, this parameter determines the name of the attribute to write the JSON data to.

Prettify JSON

When Output As is set to JSON File or String Attribute, this parameter determines whether the JSON data should be formated with newlines and indentation instead of as a single line of text.

Sort Keys

When Output As is set to JSON File or String Attribute, this parameter determines whether keys in the output JSON data should be sorted by name.

Examples

example_top_jsonoutput Example for JSON Output TOP node

This example demonstrates how to use json output node to write workitem data to json format, or to reformat existing json files.

See also

TOP nodes