OMC::BezierColumn Class Reference

Detailed Description

A column providing an interpolated value from a bezier curve defined by control points.


Generate an Example Column

from ToonBoom import harmony #Import the Harmony Module
sess = harmony.session() #Get access to the Harmony session, this class.
proj = sess.project #Get the active session's currently loaded project.
scene = proj.scene #Get the top scene in the project.
proj.history.begin( "Generating Test Column" )
columns = scene.columns #The overall node list of the scene.
#Create the new Bezier Column
new_column = columns.create( "BEZIER", "NEW_BEZIER_COLUMN" )
value_incremental = 0
#Add a keyframe value every 10 frames.
for frame in range(1,60)[::10]:
print( "Setting Key Value at %s : %s"%(frame, value_incremental) )
new_column[frame] = value_incremental
value_incremental = value_incremental + 1
proj.history.end()

Public Member Functions

OMC::BezierColumnValueoperator[int frame] ()
 The column object is is iterable and can provide values at given frames with the list operator. The frame value can be get and set from this interface. More...
 
void create_Point (double frame, double value, double handleLeftX, double handleLeftY, double handleRightX, double handleRightY, bool constSeg, QString continuity)
 Creates or sets a keyframe point on the Bezier column. More...
 
void keyframes_clear (int startFrame=1, int endFrame=-1)
 Removes the keyframe(s) located at the given range. More...
 
bool keyframe_exists (QList< int > frame)
 Returns true if the column has a keyframe at the given argument. More...
 
QVariant keyframe_create (QList< int > frame)
 Set or add a keyframe at the given frame. More...
 
void keyframe_remove (QList< int > frame)
 Remove the keyframe at the given frame, if any.
 
QList< int > keyframe_list () const
 Returns the list of frames at which there's a keyframe. More...
 
QVariant get_entry (double atFrame, int subColumnIndex=-1) const virtual QVariant getEntry(double atFrame
 Returns the value of a cell in a column. More...
 
void set_entry (double atFrame, QVariant value, int subColumnIndex=-1)
 Sets the value of a cell in a column. More...
 
void scale (double scale_factor)
 Scales the values in a column by a scaling factor.
 

Public Attributes

int hold_start
 The start value of the hold.
 
int hold_stop
 The stop value of the hold.
 
int hold_step
 The step value of the hold.
 
int control_point_size
 The number of control points in the column.
 
OMC::ControlPointListcontrol_points
 Get the controlpoints in the column.
 
QString name
 Get/set the name of the column. This is the internal name of the column which is used as a unique identifier.
 
QString display_name
 Get/Set the displayable name of the column (like it would appear in the xSheet view).
 
QString type
 Get the type of the node.
 
QString anonymous
 Get/set the anonymous state of the column.
 
QList< OMC::Node * > linked_nodes
 Identifies nodes that are linked to the column.
 
QList< OMC::Attribute * > linked_attributes
 Identifies attributes that are linked to the column.
 

Member Function Documentation

◆ create_Point()

void OMC::BezierColumn::create_Point ( double  frame,
double  value,
double  handleLeftX,
double  handleLeftY,
double  handleRightX,
double  handleRightY,
bool  constSeg,
QString  continuity 
)

Creates or sets a keyframe point on the Bezier column.

Parameters
frame: Frame number for the point.
value: Value of the column at the given point
handleLeftX: X value for the left handle of the point.
handleLeftY: Y value for the left handle.
handleRightX: X value for the right handle.
handleRightY: Y value for the right handle.
constSeg: Boolean expression (with a true or false value) to indicate whether the segment is constant or interpolated.
continuity: String value for the continuity of the point. The string must be in all upper-case. The following are the acceptable values: STRAIGHT, SMOOTH and CORNER.

◆ get_entry()

QVariant OMC::Column::get_entry ( double  atFrame,
int  subColumnIndex = -1 
) const
inherited

Returns the value of a cell in a column.

Parameters
atFrame: The frame number at which to retrieve the value from.
subColumnIndex: The index of the sub-column. Only 3D Path columns support sub-column. They have sub-columns for the X, Y, Z and velocity values on the 3D Path. Each sub-column has an index:
  • X = 1
  • Y = 2
  • Z = 3
  • Velocity = 4
Returns
Returns the value of a cell in a column.

◆ keyframe_create()

QVariant OMC::KeyframeableColumn::keyframe_create ( QList< int >  frame)
inherited

Set or add a keyframe at the given frame.

The value evaluated at the given frame will be the keyframe's value.

Parameters
frame: The frame number or list of frame numbers to retrieve the value from.

◆ keyframe_exists()

bool OMC::KeyframeableColumn::keyframe_exists ( QList< int >  frame)
inherited

Returns true if the column has a keyframe at the given argument.

Parameters
frame: The frame number or list of frame numbers to retrieve the value from.
Returns
Returns true there is a keyframe at the given frame.

◆ keyframe_list()

QList<int> OMC::KeyframeableColumn::keyframe_list ( ) const
inherited

Returns the list of frames at which there's a keyframe.

Returns
Returns the list of frames at which there's a keyframe

◆ keyframes_clear()

void OMC::KeyframeableColumn::keyframes_clear ( int  startFrame = 1,
int  endFrame = -1 
)
inherited

Removes the keyframe(s) located at the given range.

Parameters
startFrame: The starting frame number of the range, inclusive.
endFrame: The ending frame number of the range, inclusive.

◆ operator[int frame]()

OMC::BezierColumnValue* OMC::BezierColumn::operator[int frame] ( )

The column object is is iterable and can provide values at given frames with the list operator. The frame value can be get and set from this interface.


Print Column Values

from ToonBoom import harmony #Import the Harmony Module
sess = harmony.session() #Get access to the Harmony session, this class.
proj = sess.project #Get the active session's currently loaded project.
scene = proj.scene #Get the top scene in the project.
columns = scene.columns #The overall node list of the scene.
bez_col = columns["BEZIER_COLUMN_NAME"]
for n in range( 1, scene.frame_count ):
print( "Value at %s : %s"%(n, bez_col[n].value ) )

◆ set_entry()

void OMC::Column::set_entry ( double  atFrame,
QVariant  value,
int  subColumnIndex = -1 
)
inherited

Sets the value of a cell in a column.

Parameters
atFrameThe frame number at which to set the value to.
value: the new value
subColumnIndex: The index of the sub-column. Only 3D Path columns support sub-column. They have sub-columns for the X, Y, Z and velocity values on the 3D Path. Each sub-column has an index:
  • X = 1
  • Y = 2
  • Z = 3
  • Velocity = 4
Inheritance diagram for OMC::BezierColumn:
Collaboration diagram for OMC::BezierColumn: