Manually Create JSON Parameters

../../../../_images/create_json.svg

Manually Create a Sympathy parameter structure by writing a python expression which modifies the parameters variable using the sympathy parameter api (same class as nodes use to create their parameters).

Example:

parameters.set_integer(
    'number',
    description='Description of the number parameter.',
    value=1)
parameters.set_string(
    'string',
    description='Description of the string parameter.',
    value="1")
parameters.set_integer(
    'bounded_number',
    label='Bounded number',
    description='Description of the bounded_nummber parameter.',
    value=0,
    editor=synode.editors.bounded_lineedit_editor(
        0, 4))

In order to create editors and doing some other operations, synode is defined when the code is evaluated.

Optional input port, named arg, can be used in the code. Have a look at the Data type APIs to see what methods and attributes are available on the data type that you are working with.

The Evaluation context contains parameters of type ParameterRoot, synode - which is the module obtained from sympathy.api.node, and optionally arg which is a sympathy datatype subclass of TypeAlias or sybase (builtin).

Ports:

Inputs:

arg:

<a>

Input

Outputs:

output:

json

Output

Configuration:

code
Python code that modifies the parameter structure.
class node_create_json.CreateParameters[source]