OMC::CopyObject Class Reference

Detailed Description

An object that represents copied content in memory.

This object is used within OMC::Clipboard and is provided when copying content into memory. It can be used in various methods to reference and paste data afterwards.

The object doesn't provide any direct utility, but references a unique clipboard object in memory.

Copying Content

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.
clipboard = scene.clipboard #The clipboard object.
selection_handler = scene.selection #The selection handler.
selection_handler.nodes.select_all() #Select all nodes in the scene.
copy_object = clipboard.copy( selection_handler.nodes.list() ) #Create a copy_object in memory from the selection.
selection_handler.select_none()
new_nodes = clipboard.paste_new_nodes( copy_object, scene.top ) #Paste duplicate nodes into the top-group of the scene.
for node in new_nodes:
print( "Pasted: %s"%(node.path) ) #Announce the new node's path
if node.parent_group().path == scene.top.path:
node.position.y = node.position.y + 300 #Move it up, to avoid overlap with existing content
Inheritance diagram for OMC::CopyObject:
Collaboration diagram for OMC::CopyObject: