Skip to content

Latest commit

 

History

History
231 lines (105 loc) · 5.71 KB

File metadata and controls

231 lines (105 loc) · 5.71 KB

NatronEngine

ChoiceParam

Inherits : AnimatedParam

Synopsis

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

Functions

  • def addOption<NatronEngine.ChoiceParam.addOption> (option, help)
  • def get<NatronEngine.ChoiceParam.get> ()
  • def get<NatronEngine.ChoiceParam.get> (frame)
  • def getDefaultValue<NatronEngine.ChoiceParam.getDefaultValue> ()
  • def getOption<NatronEngine.ChoiceParam.getOption> (index)
  • def getNumOptions<NatronEngine.ChoiceParam.getNumOptions> ()
  • def getOptions<NatronEngine.ChoiceParam.getOptions> ()
  • def getValue<NatronEngine.ChoiceParam.getValue> ()
  • def getValueAtTime<NatronEngine.ChoiceParam.getValueAtTime> (time)
  • def restoreDefaultValue<NatronEngine.ChoiceParam.restoreDefaultValue> ()
  • def set<NatronEngine.ChoiceParam.set> (x)
  • def set<NatronEngine.ChoiceParam.set> (x, frame)
  • def set<NatronEngine.ChoiceParam.set> (label)
  • def setDefaultValue<NatronEngine.ChoiceParam.setDefaultValue> (value)
  • def setDefaultValue<NatronEngine.ChoiceParam.setDefaultValue> (label)
  • def setOptions<NatronEngine.ChoiceParam.setOptions> (options)
  • def setValue<NatronEngine.ChoiceParam.setValue> (value)
  • def setValueAtTime<NatronEngine.ChoiceParam.setValueAtTime> (value, time)

Detailed Description

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

You can add options to the menu using the addOption(option, help)<NatronEngine.ChoiceParam.addOption> function. You can also set them all at once using the setOptions(options)<NatronEngine.ChoiceParam.setOptions> 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)

param option

str<NatronEngine.std::string>

param help

str<NatronEngine.std::string>

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)

param frame

float<PySide.QtCore.float>

rtype

int<PySide.QtCore.int>

Get the value of the parameter at the given frame.

NatronEngine.ChoiceParam.get()

rtype

int<PySide.QtCore.int>

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

NatronEngine.ChoiceParam.getDefaultValue()

rtype

int<PySide.QtCore.int>

Get the default value for this parameter.

NatronEngine.ChoiceParam.getOption(index)

param index

int<PySide.QtCore.int>

rtype

str<NatronEngine.std::string>

Get the menu entry at the given index.

NatronEngine.ChoiceParam.getNumOptions()

rtype

int

Returns the number of menu entries.

NatronEngine.ChoiceParam.getOptions()

rtype

sequence

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

NatronEngine.ChoiceParam.getValue()

rtype

int<PySide.QtCore.int>

Same as get()<NatronEngine.ChoiceParam.get>

NatronEngine.ChoiceParam.getValueAtTime(time)

param time

float<PySide.QtCore.float>

rtype

float<PySide.QtCore.float>

Same as get(frame)<NatronEngine.ChoiceParam.get>

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)

param x

int<PySide.QtCore.int>

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

NatronEngine.ChoiceParam.set(x, frame)

param x

int<PySide.QtCore.int>

param frame

float<PySide.QtCore.float>

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

NatronEngine.ChoiceParam.set(label)

param label

str<NatronEngine.std::string>

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)

param value

int<PySide.QtCore.int>

Set the default value for this parameter.

NatronEngine.ChoiceParam.setDefaultValue(label)

param label

str<Natron.std::string>

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)

param options

class::sequence

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

NatronEngine.ChoiceParam.setValue(value)

param value

int<PySide.QtCore.int>

Same as set<NatronEngine.ChoiceParam.setValue>

NatronEngine.ChoiceParam.setValueAtTime(value, time)

param value

int<PySide.QtCore.int>

param time

int<PySide.QtCore.int>

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