Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The Root and Camera elements are always present in Operator View, but you have the option to add and customize other elements like Label, Input, Select or SelectSlider.

Info

Position of element can be changed not only by entering specific X and Y number in its settings, but also by clicking on the element and dragging it around the view.

...

Code Block
languagepy
def main(context):
    context['label_key'] = str(context['result'])

Input

Input element allows the operator to write any input text into a field, which can then be processed in Code.

...

Note

If you want to have multiple inputs (or selects/sliders - explained below) in the operator view, you have to set different target key for each input (and also for each select)of them, so e.g. set one to ‘input1’ and the other to ‘input2’.

...

Note

If you want to have multiple inputs/selects/sliders in the operator view, you have to set different target key for each input and select, of them, so e.g. set one to ‘input1’ and the other to ‘input2’.

Slider

Slider element allows the operator to select a number from a given range set with min and max. Either by using the slider itself or the text field next to it (if enabled by Show text field).

The Label can be used to describe what kind of value is set by the slider. Apart from position, you can also adjust the slider width and set visibility by key.

...

Disabling text field can be used e.g. when trying to make an “on/off switch” between 0 and 1, otherwise the text field is needed for showing the set value.

...

Target Key is the key in Context which will contain the value which was selected by the slider at the time the image was processed. You can then work with this value in Code where you access it with (if target key is set to ‘input3’):

Code Block
context['operatorInput']['input3']
Note

If you want to have multiple inputs/selects/sliders in the operator view, you have to set different target key for each of them, so e.g. set one to ‘input1’ and the other to ‘input2’.

...