Create Json Parameters¶
Documentation¶
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',
label='Numbers',
description='Description of the number parameter.',
value=1)
parameters.set_string(
'string',
label='String',
description='Description of the string parameter.',
value="Hello")
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 an instance of
some sympathy datatype corresponding to the data type
connected to the input port.
Definition¶
Input ports¶
- arg
Type: <a>Description: InputOptional number of ports: 0–1 (default: 0)
Output ports¶
- output
Type: jsonDescription: Output
Configuration¶
- Parameters: (code)
Python code that modifies the parameter structure.
Examples¶
Example flows demonstrating this node:
Implementation¶
- class node_create_json.CreateParameters[source]