.. module:: NatronEngine .. _UserParamHolder: UserParamHolder *************** **Inherited by** : :doc:`Effect`, :doc:`../NatronGui/PyModalDialog` Synopsis -------- This is an abstract class that serves as a base interface for all objects that can hold user parameters. See :ref:`userParams.details` Functions ^^^^^^^^^ - def :meth:`createBooleanParam` (name, label) - def :meth:`createButtonParam` (name, label) - def :meth:`createChoiceParam` (name, label) - def :meth:`createColorParam` (name, label, useAlpha) - def :meth:`createDouble2DParam` (name, label) - def :meth:`createDouble3DParam` (name, label) - def :meth:`createDoubleParam` (name, label) - def :meth:`createFileParam` (name, label) - def :meth:`createGroupParam` (name, label) - def :meth:`createInt2DParam` (name, label) - def :meth:`createInt3DParam` (name, label) - def :meth:`createIntParam` (name, label) - def :meth:`createOutputFileParam` (name, label) - def :meth:`createPageParam` (name, label) - def :meth:`createParametricParam` (name, label, nbCurves) - def :meth:`createPathParam` (name, label) - def :meth:`createStringParam` (name, label) - def :meth:`removeParam` (param) - def :meth:`refreshUserParamsGUI` () .. _userParams.details: Detailed Description -------------------- To create a new user :doc:`parameter` on the object, use one of the **createXParam** function. To remove a user parameter created, use the :func:`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 :func:`refreshUserParamsGUI()` function to notify the GUI, otherwise no change will appear on the GUI. Member functions description ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. method:: NatronEngine.UserParamHolder.createBooleanParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`BooleanParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createButtonParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`ButtonParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createChoiceParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`ChoiceParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createColorParam(name, label, useAlpha) :param name: :class:`str` :param label: :class:`str` :param useAlpha: :class:`bool` :rtype: :class:`ColorParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createDouble2DParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`Double2DParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createDouble3DParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`Double3DParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createDoubleParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`DoubleParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createFileParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`FileParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createGroupParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`GroupParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createInt2DParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`Int2DParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createInt3DParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`Int3DParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createIntParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`IntParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createOutputFileParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`OutputFileParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createPageParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`PageParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createParametricParam(name, label, nbCurves) :param name: :class:`str` :param label: :class:`str` :param nbCurves: :class:`int` :rtype: :class:`ParametricParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createPathParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`PathParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.createStringParam(name, label) :param name: :class:`str` :param label: :class:`str` :rtype: :class:`StringParam` Creates a new user :doc:`parameter` with the given *name* and *label*. See :ref:`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 :func:`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. .. method:: NatronEngine.UserParamHolder.removeParam(param) :param param: :class:`Param` :rtype: :class:`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 :func:`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. .. method:: 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.