copyPaste Class Reference

The copyPaste JavaScript global object. Copy paste to/from templates. More...

Public Slots

String createTemplateFromSelection (String name, String &path)
 
void useCreateTemplateSpecial (bool flag, bool addModellingDir=true, bool addScanFiles=true, bool includeDefaultCameraName=true)
 
bool pasteTemplateIntoScene (String &templateSrcPath, String &insertColumnName, int insertFrame)
 
bool pasteTemplateIntoGroup (String &srcPath, String &groupName, int insertFrame)
 
bool pasteActionTemplateIntoNode (String &srcPath, String &nodeName, int insertFrame)
 
void usePasteSpecial (bool flag)
 
void setExtendScene (bool flag)
 
Module Section
void setPasteSpecialCreateNewColumn (bool flag)
 
void setPasteSpecialElementTimingColumnMode (String mode)
 
Pegs and Functions Section
void setPasteSpecialAddRemoveMotionKeyFrame (bool flag)
 
void setPasteSpecialAddRemoveVelocityKeyFrame (bool flag)
 
void setPasteSpecialAddRemoveAngleKeyFrame (bool flag)
 
void setPasteSpecialAddRemoveSkewKeyFrame (bool flag)
 
void setPasteSpecialAddRemoveScalingKeyFrame (bool flag)
 
void setPasteSpecialForcesKeyFrameAtBegAndEnd (bool flag)
 
void setPasteSpecialOffsetKeyFrames (bool flag)
 
void setPasteSpecialReplaceExpressionColumns (bool flag)
 
Drawings Section
void setPasteSpecialDrawingAction (String &mode)
 
void setPasteSpecialDrawingFileMode (String &mode)
 
void setPasteSpecialDrawingAutomaticExtendExposure (bool extendExposure, bool keyFrameMode)
 
void setPasteSpecialColorPaletteOption (String &mode)
 

Public Member Functions

 copyPaste (QObject *parent, char *name)
 

Static Public Member Functions

static void registerObjects (QScriptEngine &engine)
 

Misc section

void setPasteSpecialCopyScanFiles (bool copy)
 
void setPasteSpecialCopyModelDir (bool copy)
 
void setPasteSpecialTVPreserveName (bool preserve)
 
void setPasteSpecialDefaultCameraName (bool flag)
 
void setPasteSpecialMatchNodeName (bool flag)
 
void setPasteSpecialFullTransfer (bool flag)
 
void setStartFrameSrc (int startFrame)
 
void setNumFramesSrc (int nFrames)
 
CopyOptionsgetCurrentCreateOptions ()
 
PasteOptionsgetCurrentPasteOptions ()
 
DragObjectcopy (StringList &selectionOfNodes, int startFrame, int numFrames, CopyOptions *createOption)
 Create an object that represent a 'copy' of a selection of nodes and a range of frames. More...
 
bool paste (DragObject *dragObject, StringList &selectionOfNodes, int startFrame, int numFrames, PasteOptions *pasteOptions)
 paste drag object as an action template. Must past over a selection of nodes. No new modules created by this action. More...
 
bool pasteNewNodes (DragObject *dragObject, String &groupWhereToDrop, PasteOptions *pasteOptions)
 
DragObjectcopyFromTemplate (String &filename, int startFrame, int numFrames, CopyOptions *createOption)
 

Detailed Description

The copyPaste JavaScript global object. Copy paste to/from templates.

Copy paste to/from templates.

Constructor & Destructor Documentation

◆ copyPaste()

copyPaste::copyPaste ( QObject *  parent,
char *  name 
)

Member Function Documentation

◆ copy

DragObject* copyPaste::copy ( StringList &  selectionOfNodes,
int  startFrame,
int  numFrames,
CopyOptions createOption 
)
slot

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.

Parameters
selectionOfNodesa list of nodes to be copied.
startFramethe start frame for the selection. First frame is 1.
numFramesnumber of frames to copy.
createOptionoptions that should be used when doing the code. See CopyOptions for more information about these options.
Returns
a newly created 'drag object' that represent a copy of the selection. The drag object can be saved or pasted back to the scene (using the paste() function)
NULL if unable to create a dragobject.

◆ copyFromTemplate

DragObject* copyPaste::copyFromTemplate ( String &  filename,
int  startFrame,
int  numFrames,
CopyOptions createOption 
)
slot

Load a template from the file system onto a drag object, which can then be pasted onto the scene.

Parameters
filename- the exact filename of the .tpl folder. Need to be the folder, not the .xstage file.
startFramestart 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 CopyOptions for more information about these options.

◆ createTemplateFromSelection

String copyPaste::createTemplateFromSelection ( String  name,
String &  path 
)
slot

Creates template from the current selection in the scene, using only the current drawing versions

Parameters
name= name of new template
path= location of new template
Returns
the full path of the new template. Will return an empty string if no template file was created.

No template is created when there is nothing selected, when the path is not valid or when there is an IO error.

◆ getCurrentCreateOptions

CopyOptions* copyPaste::getCurrentCreateOptions ( )
slot

return a copy of the current copy options - to be used with copy(). There used to be an API to set these parameters globally, for the next drag&drop

◆ getCurrentPasteOptions

PasteOptions* copyPaste::getCurrentPasteOptions ( )
slot

return a copy of the current paste options - to be used with paste()

◆ paste

bool copyPaste::paste ( DragObject dragObject,
StringList &  selectionOfNodes,
int  startFrame,
int  numFrames,
PasteOptions pasteOptions 
)
slot

paste drag object as an action template. Must past over a selection of nodes. No new modules created by this action.

◆ pasteActionTemplateIntoNode

bool copyPaste::pasteActionTemplateIntoNode ( String &  srcPath,
String &  nodeName,
int  insertFrame 
)
slot

Pastes the action template into the scene and excludes modules that are in the list

Parameters
srcPath- path of the template
nodeName- name of existing node in which we will insert template
insertFrame- frame at which insert commences

◆ pasteNewNodes

bool copyPaste::pasteNewNodes ( DragObject dragObject,
String &  groupWhereToDrop,
PasteOptions pasteOptions 
)
slot

Paste an external drag object as new modules. This is similar to pasting on the node view where new modules are created (from an external selection).

Parameters
dragObject- the actual drag object - see copy() or copyFromTemplate() to create this drag object.
groupWhereToDrop- 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 PasteOptions).
Returns
true if successful

◆ pasteTemplateIntoGroup

bool copyPaste::pasteTemplateIntoGroup ( String &  srcPath,
String &  groupName,
int  insertFrame 
)
slot

Pastes the template into a group of the scene

Parameters
srcPath- path of the template
groupName- name of existing column in which we will insert template
insertFrame- frame at which insert commences

◆ pasteTemplateIntoScene

bool copyPaste::pasteTemplateIntoScene ( String &  templateSrcPath,
String &  insertColumnName,
int  insertFrame 
)
slot

Pastes the template into the scene

Parameters
templateSrcPath- path of the template
insertColumnName- name of existing column in which we will insert template
insertFrame- frame at which insert commences

◆ registerObjects()

static void copyPaste::registerObjects ( QScriptEngine &  engine)
static

◆ setExtendScene

void copyPaste::setExtendScene ( bool  flag)
slot

◆ setNumFramesSrc

void copyPaste::setNumFramesSrc ( int  nFrames)
slot

◆ setPasteSpecialAddRemoveAngleKeyFrame

void copyPaste::setPasteSpecialAddRemoveAngleKeyFrame ( bool  flag)
slot

◆ setPasteSpecialAddRemoveMotionKeyFrame

void copyPaste::setPasteSpecialAddRemoveMotionKeyFrame ( bool  flag)
slot

◆ setPasteSpecialAddRemoveScalingKeyFrame

void copyPaste::setPasteSpecialAddRemoveScalingKeyFrame ( bool  flag)
slot

◆ setPasteSpecialAddRemoveSkewKeyFrame

void copyPaste::setPasteSpecialAddRemoveSkewKeyFrame ( bool  flag)
slot

◆ setPasteSpecialAddRemoveVelocityKeyFrame

void copyPaste::setPasteSpecialAddRemoveVelocityKeyFrame ( bool  flag)
slot

◆ setPasteSpecialColorPaletteOption

void copyPaste::setPasteSpecialColorPaletteOption ( String &  mode)
slot

Acceptable Strings are: DO_NOTHING REUSE_PALETTES COPY_AND_OVERWRITE_EXISTING_PALETTES COPY_AND_CREATE_NEW_PALETTES COPY_AND_CREATE_NEW_PALETTES_IN_ELEMENT_FOLDER COPY_PALETTE_AND_MERGE_COLOURS COPY_PALETTE_AND_UPDATE_COLOURS LINK_TO_ORIGINAL COPY_SCENE_PALETTE_AND_MERGE_COLOURS COPY_SCENE_PALETTE_AND_UPDATE_COLOURS

◆ setPasteSpecialCopyModelDir

void copyPaste::setPasteSpecialCopyModelDir ( bool  copy)
slot

◆ setPasteSpecialCopyScanFiles

void copyPaste::setPasteSpecialCopyScanFiles ( bool  copy)
slot

◆ setPasteSpecialCreateNewColumn

void copyPaste::setPasteSpecialCreateNewColumn ( bool  flag)
slot

◆ setPasteSpecialDefaultCameraName

void copyPaste::setPasteSpecialDefaultCameraName ( bool  flag)
slot

Use this when you want the camera in a template to be set as default camera in the target scene. Note that this is not necessary if there is NO camera assigned in the target scene, as the incoming camera will automatically be set as default camera.

◆ setPasteSpecialDrawingAction

void copyPaste::setPasteSpecialDrawingAction ( String &  mode)
slot

Drawings action Acceptable Strings are: DO_NOTHING ADD_OR_REMOVE_EXPOSURE UPDATE_PIVOT

◆ setPasteSpecialDrawingAutomaticExtendExposure

void copyPaste::setPasteSpecialDrawingAutomaticExtendExposure ( bool  extendExposure,
bool  keyFrameMode 
)
slot

◆ setPasteSpecialDrawingFileMode

void copyPaste::setPasteSpecialDrawingFileMode ( String &  mode)
slot

Sets the drawing file mode - only used if the DrawingAction is set to ADD_OR_REMOVE_EXPOSURE Acceptable Strings are: NEVER_CREATE ONLY_CREATE_IF_DOES_NOT_EXIST ALWAYS_CREATE ALWAYS_CREATE_AND_VERSION_IF_NECESSARY REPLACE_EXISTING

◆ setPasteSpecialElementTimingColumnMode

void copyPaste::setPasteSpecialElementTimingColumnMode ( String  mode)
slot

Sets the paste special elementtiming mode for calls to pasteTemplateIntoScene Acceptable strings are:

ELEMENT_AS_ELEMENT_AND_TIMING_AS_TIMING ALL_DRWGS_AS_ELEMENTS ALL_DRWGS_LINKED_THRU_TIMING_COLS

◆ setPasteSpecialForcesKeyFrameAtBegAndEnd

void copyPaste::setPasteSpecialForcesKeyFrameAtBegAndEnd ( bool  flag)
slot

◆ setPasteSpecialFullTransfer

void copyPaste::setPasteSpecialFullTransfer ( bool  flag)
slot

use this when you want to control the paste of all non animated attribute and all local values of a module. The default is 'true'

◆ setPasteSpecialMatchNodeName

void copyPaste::setPasteSpecialMatchNodeName ( bool  flag)
slot

Use this when you want to paste a template and use the actual node names for matching nodes instead of basic algorithm of composition order.

In this mode, it is important to make sure that all nodes of the template are found in the destination's group.

◆ setPasteSpecialOffsetKeyFrames

void copyPaste::setPasteSpecialOffsetKeyFrames ( bool  flag)
slot

◆ setPasteSpecialReplaceExpressionColumns

void copyPaste::setPasteSpecialReplaceExpressionColumns ( bool  flag)
slot

◆ setPasteSpecialTVPreserveName

void copyPaste::setPasteSpecialTVPreserveName ( bool  preserve)
slot

◆ setStartFrameSrc

void copyPaste::setStartFrameSrc ( int  startFrame)
slot

When pasting an external template or local content, these two functions controls the # of frames and the start frame of the content that will be pasted.

The default start frame is 1, which means that it will be pasting starting from the first frame of the copied content. Set this to a value >= 1 to specific the frame to use as a starting frame.

The default number of frames is 0, which effectively turn off this override feature and make it paste the entire copied content length. Set this length to anything >0 to override the number of frames pasted.

Must be using the paste special mode.

◆ useCreateTemplateSpecial

void copyPaste::useCreateTemplateSpecial ( bool  flag,
bool  addModellingDir = true,
bool  addScanFiles = true,
bool  includeDefaultCameraName = true 
)
slot

Allows 2 extra options in the template creation

Parameters
flagset that the copy paste manager is in use.
addModellingDir- copies the modeling directory into the template
addScanFiles- copies the *.scans that match the drawings
includeDefaultCameraName- Deprecated in 7.8. As long as the camera node is in the selection, it will be copied into the template automatically.

◆ usePasteSpecial

void copyPaste::usePasteSpecial ( bool  flag)
slot

Enables PasteSpecial This is a STATIC structure - once initialized it may be re-used for the duration of the session By default, it is NOT used until usePasteSpecial(true) is called

The structure defaults are:

extendScene = false

MODULE createNewColumn = false elementTimingColumnMode = ELEMENT_AS_ELEMENT_AND_TIMING_AS_TIMING

PEG add/remove motion KF = true add/remove velocity KF = true add/remove angle KF = true add/remove skew KF = true add/remove scaling KF = true force keyframes at functions beginning and end = true offset keyframes = false; replace expression columns = true

DRAWING drawing action = add or remove exposure

PALETTE palette mode = REUSE_PALETTES

SRC FRAMES start frame source = 1 - start frame frame of the copied sequenced). num frame source = 0 - 0 indicate to use the original length of the source

If Drawing add/remove exposure is set, the following modes are available drawing file mode = ALWAYS_CREATE if the preference LIBRARY_PASTE_CREATE_NEW_DRAWING is set, otherwise it is ONLY_CREATE_IF_DOES_NOT_EXIST automatically extend exposure = false drawing as key frame = true ( note, only used if automatic extend exposure = true )