# Class: oAttribute

## $. oAttribute

The $.oAttribute class holds the smart version of the parameter you can find in layer property.
It is used internally to get and set values and link a oColumn to a parameter in order to animate it.
For a list of attributes existing in each node type and their type, as well as examples of the values they can hold, refer to :
NodeType.

#### new $.oAttribute(oNodeObject, attributeObject, parentAttribute)

openHarmony/openHarmony_attribute.js, line 81
  The constructor for the $.oAttribute class.

  Name | Type | Description
  --- | --- | ---
  `oNodeObject` | $.oNode | The oNodeObject that the attribute is associated to.
  `attributeObject` | attr | The internal harmony Attribute Object.
  `parentAttribute` | $.oAttribute | The parent attribute of the subattribute.

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `node` | $.oNode | The name of the drawing.
  `attributeObject` | attr | The element object associated to the element.
  `keyword` | string | The name of the drawing.
  `shortKeyword` | string | The element object associated to the element.
  `parentAttribute` | $.oAttribute | The element object associated to the element.
  `subAttributes` | Array.<$.oAttribute> | The subattributes, if any exist, of this attribute.

  ##### Example

      // oAttribute objects can be grabbed from the node .attributes object with dot notation, by calling the attribute keyword in lowercase.

      var myNode = $.scn.getSelectedNodes()[0];          // grab the first selected node
      var Xattribute = myNode.attributes.position.x;     // gets the position.x attribute of the node if it has it (for example, PEG nodes have it)

      var Xcolumn = Xattribute.column;                   // retrieve the linked column to the element (The object that holds the animation)

      Xattribute.setValue(5, 5);                         // sets the value to 5 at frame 5

### Members

#### column$.oColumn

  The column attached to the attribute.

#### defaultValuebool

  Returns the default value of the attribute for most keywords
  TODO
    - switch the implentation to types?

  ##### Example

      // to reset an attribute to its default value:
      // (mostly used for position/angle/skew parameters of pegs and drawing nodes)
      var myAttribute = $.scn.nodes[0].attributes.position.x;

      myAttribute.setValue(myAttribute.defaultValue);

#### framesArray.<$.oFrame>

  The frames array holding the values of the animation. Starts at 1, as array indexes correspond to frame numbers.

#### keyframesArray.<$.oFrame>

  An array of only the keyframes (frames with a set value) of the animation.

#### keywordstring

  The full keyword of the attribute.

#### shortKeywordstring

  The part of the attribute's keyword that is after the "." for subAttributes.

#### typestring

  The type of the attribute.

### Methods

#### getKeyframes(){Array.<$.oFrame>}

openHarmony/openHarmony_attribute.js, line 387
  Provides the keyframes of the attribute.

  ##### Returns:

  Type | Description
  --- | ---
  Array.<$.oFrame> | The filtered keyframes.

#### getKeyFrames(){Array.<$.oFrame>}

openHarmony/openHarmony_attribute.js, line 399
  Provides the keyframes of the attribute.
  Deprecated
    - For case consistency, keyframe will never have a capital F

  ##### Returns:

  Type | Description
  --- | ---
  Array.<$.oFrame> | The filtered keyframes.

#### getLinkedColumns(){Array.<$.oColumn>}

openHarmony/openHarmony_attribute.js, line 411
  Recursively get all the columns linked to the attribute and its subattributes

  ##### Returns:

  Type | Description
  --- | ---
  Array.<$.oColumn> | the list of columns linked to the subattributes

#### getValue(frame){object}

openHarmony/openHarmony_attribute.js, line 459
  Gets the value of the attribute at the given frame.

  Name | Type | Description
  --- | --- | ---
  `frame` | int | The frame at which to set the value, if not set, assumes 1

  ##### Returns:

  Type | Description
  --- | ---
  object | The value of the attribute in the native format of that attribute (contextual to the attribute).

#### setValue(value, frame)

openHarmony/openHarmony_attribute.js, line 559
  Sets the value of the attribute at the given frame.

  Name | Type | Description
  --- | --- | ---
  `value` | string | The value to set on the attribute.
  `frame` | int | optional The frame at which to set the value, if not set, assumes 1

#### value(frame){object}

openHarmony/openHarmony_attribute.js, line 657
  Gets the value of the attribute at the given frame.

  Name | Type | Description
  --- | --- | ---
  `frame` | int | The frame at which to set the value, if not set, assumes 1

  ##### Returns:

  Type | Description
  --- | ---
  object | The value of the attribute in the native format of that attribute (contextual to the attribute).