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, or Select, or Slider.

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.

...

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 of them, so e.g. set one to ‘input1’ and the other to ‘input2’.

...

Code Block
context['operatorInput']['input2']
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’.

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 the 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 the 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’.

...

Info

For images you saved (when you had ‘Save images’ enabled or you ‘Captured' the image while the Operator View was running) you can see the operator inputs at that time in the Inspection tab under 'operatorInput’ key, which is a dictionary containing key-value pairs for all your inputs/selects/sliders.

If you set some dynamic label, you can see the value of its context key (if you set its value in code) at that time under the context key name you selected, so e.g. 'label_key' in this example.

If you set visibility by key for some element and you set its value in code, you will see it here too under the name you selected for the key so e.g. ‘visibility_key’ in this example.

...