Expand description
Copying layers from another .clip (from name-studio’s clip-core).
A layer is copied with the rows its row links to, following the id links
ParamScheme lists (LinkTable, for example Layer → VectorObjectList),
as CSP itself links them. Every copied row gets a new MainId (see
ClipFile::next_main_id), columns owned by the canvas or the layer
(OwnerType 2 and 4) get the target’s ids, and external chunks (vector
data) are copied under new ids.
The target file may lack the tables and columns the copied rows use (CSP
creates VectorObjectList only when a file first has a vector layer):
merge_schema and merge_columns add them with their ParamScheme
and ElemScheme rows. Vector objects name their brush by
BrushStyle.MainId, so brush styles are copied keeping their ids
(share_rows) when the target has none, together with the rows brush
styles link to (tip and texture images, spray shapes, effector graphs):
CSP crashes on opening a file whose brush style names a texture that is
not there.
Structs§
- Column
Info - What
ParamSchemesays about one column. - Copy
Layer - Options for
ClipFile::copy_layer_from. - RowCopier
- Copies rows, and everything they link to, from one file’s database to another’s.
Constants§
- DROPPED_
LAYER_ LINKS - Layer columns that would tie a copy to data that is not copied: masks,
frame images, 3D, rulers and the like. A copy gets NULL in them, as CSP’s
own layers without these have: CSP crashes drawing a vector layer whose
ComicFrameLineMipmapis 0 rather than NULL. - LAYER_
CANVAS_ COLUMNS - The
Canvascolumns copied with the tables ofLAYER_TABLES. - LAYER_
TABLES - Tables (and Canvas columns) a vector or text layer copied from another
file needs: vector lines find their brush styles through
Canvas.BrushStyleManager, and without it CSP opens them empty.Canvas.BrushStyleReadProtect070(1 in newer files) comes with the brush styles: it seems to tell CSP how to read them (not needed by any file tried so far, but the styles were saved with it). - OWNER_
CANVAS ParamScheme.OwnerTypeof a column holding the canvas id.- OWNER_
LAYER ParamScheme.OwnerTypeof a column holding the owning layer’s id.- SHARED_
TABLES - Rows vector objects refer to by id, copied keeping their ids: the brush
styles and every table
BrushStyleManagerandBrushStylelink to.
Functions§
- brush_
style_ in idwhentargethas that brush style, else its first brush style (oridwhen it has none): the brush a copied vector object should name.- column_
infos ParamSchemeinformation for the columns oftable.- external_
columns - (table, column) pairs whose values are external chunk ids.
- insert_
row - Insert
rowintotable, keeping only the columns the table has. - merge_
columns - Give
target’s existingtablethe columnssourcehas (only those inonly, when given), with theirParamSchemerows. - merge_
schema - Give
targetevery table and column oftablesthatsourcehas, with theirParamSchemeandElemSchemerows. - share_
rows - Copy the rows of
tableskeeping their ids, for each table that is empty intarget, and pointCanvas.BrushStyleManagerat the copied manager when the target has none. When brush styles are copied, the source’sCanvas.BrushStyleReadProtect070comes with them. Returns the tables copied. Links out of the copied rows are left as they are (seeClipFile::prepare_copy_fromfor brush textures).
Type Aliases§
- Payload
Hook - Rewrites an external payload while it is copied: (table, column, payload).
- RowHook
- Rewrites the copied Layer row before it is inserted.