UserParamHolder — Natron 2.5.0 documentation

# UserParamHolder

Inherited by : Effect, PyModalDialog

## Synopsis

This is an abstract class that serves as a base interface for all objects that can hold user parameters. See Detailed Description

### Functions

- def `createBooleanParam` (name, label)

- def `createButtonParam` (name, label)

- def `createChoiceParam` (name, label)

- def `createColorParam` (name, label, useAlpha)

- def `createDouble2DParam` (name, label)

- def `createDouble3DParam` (name, label)

- def `createDoubleParam` (name, label)

- def `createFileParam` (name, label)

- def `createGroupParam` (name, label)

- def `createInt2DParam` (name, label)

- def `createInt3DParam` (name, label)

- def `createIntParam` (name, label)

- def `createOutputFileParam` (name, label)

- def `createPageParam` (name, label)

- def `createParametricParam` (name, label, nbCurves)

- def `createPathParam` (name, label)

- def `createStringParam` (name, label)

- def `removeParam` (param)

- def `refreshUserParamsGUI` ()

## Detailed Description

To create a new user parameter on the object, use one of the createXParam function. To remove a user parameter created, use the `removeParam(param)` function. Note that this function can only be used to remove user parameters and cannot be used to remove parameters that were defined by the OpenFX plug-in.

Once you have made modifications to the user parameters, you must call the `refreshUserParamsGUI()` function to notify the GUI, otherwise no change will appear on the GUI.

### Member functions description

NatronEngine.UserParamHolder.createBooleanParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `BooleanParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type boolean which will appear in the user interface as a checkbox.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createButtonParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `ButtonParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type button which will appear as a push button. Use the onParamChanged callback of the Effect to handle user clicks.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createChoiceParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `ChoiceParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type choice which will appear as a dropdown combobox.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createColorParam(name, label, useAlpha)
  Parameters

    - name – `str`

    - label – `str`

    - useAlpha – `bool`

  Return type

    `ColorParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type color.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createDouble2DParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `Double2DParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type double with 2 dimensions.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createDouble3DParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `Double3DParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type double with 3 dimensions.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createDoubleParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `DoubleParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type double with single dimension. A double is similar to a floating point value.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createFileParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `FileParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type double with 2 dimensions.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createGroupParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `GroupParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type group. It can contain other children parameters and can be expanded or folded.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createInt2DParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `Int2DParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type integer with 2 dimensions.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createInt3DParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `Int3DParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type integer with 3 dimensions.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createIntParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `IntParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type integer with a single dimension.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createOutputFileParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `OutputFileParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type string dedicated to specify paths to output files.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createPageParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `PageParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type page. A page is a tab within the settings panel of the node.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createParametricParam(name, label, nbCurves)
  Parameters

    - name – `str`

    - label – `str`

    - nbCurves – `int`

  Return type

    `ParametricParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type parametric. A parametric parameter is what can be found in the ColorLookup node or in the Ranges tab of the ColorCorrect node.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createPathParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `PathParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type string. This parameter is dedicated to specify path to single or multiple directories.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.createStringParam(name, label)
  Parameters

    - name – `str`

    - label – `str`

  Return type

    `StringParam`

Creates a new user parameter with the given name and label. See here for an explanation of the difference between the name and label. This function will return a new parameter of type string.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.removeParam(param)
  Parameters

    param – `Param`

  Return type

    `bool`

Removes the given param from the parameters of this Effect. This function works only if param is a user parameter and does nothing otherwise. This function returns True upon success and False otherwise.

Warning

After calling this function you should call `refreshUserParamsGUI()` to refresh the user interface. The refreshing is done in a separate function because it may be expensive and thus allows you to make multiple changes to user parameters at once while keeping the user interface responsive.

NatronEngine.UserParamHolder.refreshUserParamsGUI()

This function must be called after new user parameter were created or removed. This will re-create the user interface for the parameters and can be expensive.