GPv3: Add function to copy GreasePencil parameters
Adds a kernel function to copy only the `GreasePencil` parameters and not the layer tree or drawings.
This commit is contained in:
@@ -1033,6 +1033,8 @@ bool BKE_grease_pencil_drawing_attribute_required(const GreasePencilDrawing *, c
|
||||
void *BKE_grease_pencil_add(Main *bmain, const char *name);
|
||||
GreasePencil *BKE_grease_pencil_new_nomain();
|
||||
GreasePencil *BKE_grease_pencil_copy_for_eval(const GreasePencil *grease_pencil_src);
|
||||
/** Copy everything except the layer tree and the drawings. */
|
||||
void BKE_grease_pencil_copy_parameters(const GreasePencil &src, GreasePencil &dst);
|
||||
/**
|
||||
* Move data from a grease pencil outside of the main data-base into a grease pencil in the
|
||||
* data-base. Takes ownership of the source grease pencil. */
|
||||
|
||||
@@ -1792,6 +1792,17 @@ GreasePencil *BKE_grease_pencil_copy_for_eval(const GreasePencil *grease_pencil_
|
||||
return grease_pencil;
|
||||
}
|
||||
|
||||
void BKE_grease_pencil_copy_parameters(const GreasePencil &src, GreasePencil &dst)
|
||||
{
|
||||
dst.material_array_num = src.material_array_num;
|
||||
dst.material_array = static_cast<Material **>(MEM_dupallocN(src.material_array));
|
||||
dst.attributes_active_index = src.attributes_active_index;
|
||||
dst.flag = src.flag;
|
||||
BLI_duplicatelist(&dst.vertex_group_names, &src.vertex_group_names);
|
||||
dst.vertex_group_active_index = src.vertex_group_active_index;
|
||||
dst.onion_skinning_settings = src.onion_skinning_settings;
|
||||
}
|
||||
|
||||
void BKE_grease_pencil_nomain_to_grease_pencil(GreasePencil *grease_pencil_src,
|
||||
GreasePencil *grease_pencil_dst)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user