ChoiceParam

Inherits : AnimatedParam

Synopsis

A choice parameter holds an integer value which corresponds to a choice. See detailed description below.

Functions

Detailed Description

A choice is represented as a drop-down (combobox) in the user interface:

../../../_images/choiceParam.png

You can add options to the menu using the addOption(option, help) function. You can also set them all at once using the setOptions(options) function.

The value held internally is a 0-based index corresponding to an entry of the menu. the choice parameter behaves much like an IntParam.

Member functions description

NatronEngine.ChoiceParam.addOption(option, help)
Parameters:
  • optionstr
  • helpstr

Adds a new option to the menu. If help is not empty, it will be displayed when the user hovers the entry with the mouse.

NatronEngine.ChoiceParam.get(frame)
Parameters:framefloat
Return type:int

Get the value of the parameter at the given frame.

NatronEngine.ChoiceParam.get()
Return type:int

Get the value of the parameter at the current timeline’s time.

NatronEngine.ChoiceParam.getDefaultValue()
Return type:int

Get the default value for this parameter.

NatronEngine.ChoiceParam.getOption(index)
Parameters:indexint
Return type:str

Get the menu entry at the given index.

NatronEngine.ChoiceParam.getNumOptions()
Return type:int

Returns the number of menu entries.

NatronEngine.ChoiceParam.getOptions()
Return type:sequence

Returns a sequence of string with all menu entries from top to bottom.

NatronEngine.ChoiceParam.getValue()
Return type:int

Same as get()

NatronEngine.ChoiceParam.getValueAtTime(time)
Parameters:timefloat
Return type:float

Same as get(frame)

NatronEngine.ChoiceParam.restoreDefaultValue()

Removes all animation and expression set on this parameter and set the value to be the default value.

NatronEngine.ChoiceParam.set(x)
Parameters:xint

Set the value of this parameter to be x. If this parameter is animated (see getIsAnimated(dimension) then this function will automatically add a keyframe at the timeline’s current time.

NatronEngine.ChoiceParam.set(x, frame)
Parameters:
  • xint
  • framefloat

Set a new keyframe on the parameter with the value x at the given frame.

NatronEngine.ChoiceParam.set(label)
Parameters:labelstr

Set the value of this parameter given a label. The label must match an existing option. Strings will be compared without case sensitivity. If not found, nothing happens.

NatronEngine.ChoiceParam.setDefaultValue(value)
Parameters:valueint

Set the default value for this parameter.

NatronEngine.ChoiceParam.setDefaultValue(label)
Parameters:labelstr

Set the default value from the label for this parameter. The label must match an existing option. Strings will be compared without case sensitivity. If not found, nothing happens.

NatronEngine.ChoiceParam.setOptions(options)
Parameters:options – class::sequence

Clears all existing entries in the menu and add all entries contained in options to the menu.

NatronEngine.ChoiceParam.setValue(value)
Parameters:valueint

Same as set

NatronEngine.ChoiceParam.setValueAtTime(value, time)
Parameters:
  • valueint
  • timeint

Same as set(time)<NatronEngine.ChoiceParam.set()