![]() |
Provides copy and paste functionality.
The clipboard object is provided from the scene (OMH::HarmonyScene) and provides access to copy and paste functionality. It is useful for copying content from a scene or templates and reusing it in different locations.
Copying Content
Create a Template
Public Member Functions | |
void | paste_template (const QString &templateSrcPath, int insertFrame, const OMC::Column *column=null, const OMH::PasteOptions *options) |
Pastes the template into the scene. More... | |
void | paste_template_into_group (const QString &srcPath, int insertFrame, const OMC::Group *group, const OMH::PasteOptions *options) |
Pastes the template into a group of the scene. More... | |
void | paste_action_template (const QString &srcPath, int insertFrame, const OMC::Node *node, const OMH::PasteActionOptions *compositionOptions, const OMH::PasteOptions *options) |
Pastes the action template into the scene and excludes nodes that are in the list. More... | |
OMH::CopyObject * | copy (const QStringList &nodePaths, int startFrame=1, int numFrames=0, const OMC::CopyOptions *copyOptions=null) |
Create an object that represent a 'copy' of a selection of nodes and a range of frames. More... | |
void | paste (OMH::CopyObject *copyObject, const QStringList &nodePaths, int startFrame=1, int numFrames=0, const OMH::PasteOptions *pasteOptions=null) |
Pastes the drag object as an action template. Must paste over a selection of nodes. No new nodes are created by this action. More... | |
std::vector< OMC::Node * > | paste_new_nodes (OMH::CopyObject *copyObject, const OMC::Group *group, OMH::PasteOptions *pasteOptions=null) |
OMC::CopyObject * | copy_from_template (QString &filename, int startFrame=1, int numFrames=0, OMC::CopyOptions *copyOptions=null) |
Load a template from the file system onto a copy object, which can then be pasted onto the scene. More... | |
QString | create_selection_template (const QString &name, const QString &path, const OMC::CopyOptions *copyOptions=null) const |
Creates template from the current selection in the scene, using only the current drawing versions. More... | |
QString | create_template (OMH::CopyObject *copyObject, const QString &name, const QString &path, bool addDefaultCamera=false) const |
Creates template from the copy object using only the current drawing versions. More... | |
OMH::CopyObject* OMC::Clipboard::copy | ( | const QStringList & | nodePaths, |
int | startFrame = 1 , |
||
int | numFrames = 0 , |
||
const OMC::CopyOptions * | copyOptions = null |
||
) |
Create an object that represent a 'copy' of a selection of nodes and a range of frames.
Create an object that represent a 'copy' of a selection of nodes and a range of frames. This object can be pasted or saved in the template library. It is practically identical to what the user would copy from a selection of layers and frames in the timeline.
nodePaths | : The list of nodes to be copied. |
createOption | : Options that should be used when doing the creating the copy. See SCR_CopyOptions for more information about these options. |
OMC::CopyObject* OMC::Clipboard::copy_from_template | ( | QString & | filename, |
int | startFrame = 1 , |
||
int | numFrames = 0 , |
||
OMC::CopyOptions * | copyOptions = null |
||
) |
Load a template from the file system onto a copy object, which can then be pasted onto the scene.
filename | - the exact filename of the .tpl folder. Need to be the folder, not the .xstage file. |
startFrame | start frames for the data pasted. Starting at 1. However, if 0 is provided, the whole template is copied. |
numFrames | - number of frames to paste, up to the maximum number of frames. If 'startFrame' is 0, this parameter is disregarded. |
createOption | - options that should be used when doing the code. See SCR_CopyOptions for more information about these options. |
QString OMC::Clipboard::create_selection_template | ( | const QString & | name, |
const QString & | path, | ||
const OMC::CopyOptions * | copyOptions = null |
||
) | const |
Creates template from the current selection in the scene, using only the current drawing versions.
No template is created when there is nothing selected, when the path is not valid or when there is an IO error.
name | : The name of the new template. |
path | : The location of the new template. |
copyOptions | : Options to define how the selection is copied when templated. |
QString OMC::Clipboard::create_template | ( | OMH::CopyObject * | copyObject, |
const QString & | name, | ||
const QString & | path, | ||
bool | addDefaultCamera = false |
||
) | const |
Creates template from the copy object using only the current drawing versions.
No template is created when there is nothing selected, when the path is not valid or when there is an IO error.
name | : The name of the new template. |
path | : The location of the new template. |
addDefaultCamera | : Whether the default camera should be included in the template. |
void OMC::Clipboard::paste | ( | OMH::CopyObject * | copyObject, |
const QStringList & | nodePaths, | ||
int | startFrame = 1 , |
||
int | numFrames = 0 , |
||
const OMH::PasteOptions * | pasteOptions = null |
||
) |
Pastes the drag object as an action template. Must paste over a selection of nodes. No new nodes are created by this action.
copyObject | : The dragObject to be pasted. |
selectionOfNodes | : The list of nodes to be pasted over. |
startFrame | : The start frame for the selection. First frame is 1. |
numFrames | : The number of frames to paste across. |
pasteOptions | : Options that should be used when pasting. See SCR_PasteOptions for more information about these options. |
void OMC::Clipboard::paste_action_template | ( | const QString & | srcPath, |
int | insertFrame, | ||
const OMC::Node * | node, | ||
const OMH::PasteActionOptions * | compositionOptions, | ||
const OMH::PasteOptions * | options | ||
) |
Pastes the action template into the scene and excludes nodes that are in the list.
srcPath | : The path of the template. |
nodeName | : The name of the existing node in which we will insert template. |
insertFrame | : The frame at which insert commences. |
compositionOptions | : Defines how to handle the selection of nodes onto which to paste. Separately controls to paste of groups, effects and composite nodes when building the selection. Default value: { "groups": true, "effects": true, "composites": false } |
std::vector<OMC::Node*> OMC::Clipboard::paste_new_nodes | ( | OMH::CopyObject * | copyObject, |
const OMC::Group * | group, | ||
OMH::PasteOptions * | pasteOptions = null |
||
) |
Paste an external drag object as new nodes. This is similar to pasting on the node view where new nodes are created (from an external selection).
copyObject | - the actual drag object - see copy() or copyFromTemplate() to create this drag object. |
group | - root group where the new nodes will be created. If empty string is provided, it will paste at the root. |
pasteOptions | - paste special options (ie. create keyframes, drawings, new columns, or relink columns,.... - see paste special dialog and SCR_PasteOptions). |
void OMC::Clipboard::paste_template | ( | const QString & | templateSrcPath, |
int | insertFrame, | ||
const OMC::Column * | column = null , |
||
const OMH::PasteOptions * | options | ||
) |
Pastes the template into the scene.
templateSrcPath | : The path of the template. |
insertFrame | : The frame at which insert commences. |
column | : The name of the existing column in which template will be inserted. |
void OMC::Clipboard::paste_template_into_group | ( | const QString & | srcPath, |
int | insertFrame, | ||
const OMC::Group * | group, | ||
const OMH::PasteOptions * | options | ||
) |
Pastes the template into a group of the scene.
srcPath | : The path of the template. |
groupName | : The name of the group node into which the template will be pasted. |
insertFrame | : The frame at which insert commences. |