Initial Grease Pencil 3.0 stage #106848

Merged
Falk David merged 224 commits from filedescriptor/blender:grease-pencil-v3 into main 2023-05-30 11:14:22 +02:00
2 changed files with 14 additions and 12 deletions
Showing only changes of commit 6ec1320839 - Show all commits

View File

@ -25,7 +25,6 @@ void legacy_gpencil_frame_to_grease_pencil_drawing(GreasePencilDrawing &drawing,
new (&drawing.geometry) CurvesGeometry();
drawing.base.type = GP_DRAWING;
drawing.runtime = MEM_new<bke::GreasePencilDrawingRuntime>(__func__);
/* TODO: set flag. */
/* Get the number of points, number of strokes and the offsets for each stroke. */
Vector<int> offsets;
@ -244,10 +243,11 @@ void legacy_gpencil_to_grease_pencil(Main &bmain, GreasePencil &grease_pencil, b
/* Convert the frame to a drawing. */
legacy_gpencil_frame_to_grease_pencil_drawing(drawing, *gpf);
GreasePencilFrame frame;
frame.drawing_index = i;
frame.type = gpf->key_type;
new_layer.insert_frame(gpf->framenum, std::move(frame));
GreasePencilFrame new_frame;
new_frame.drawing_index = i;
new_frame.type = gpf->key_type;
SET_FLAG_FROM_TEST(new_frame.flag, (gpf->flag & GP_FRAME_SELECT), GP_FRAME_SELECTED);
new_layer.insert_frame(gpf->framenum, std::move(new_frame));
i++;
}
}

View File

@ -119,6 +119,13 @@ typedef struct GreasePencilDrawingReference {
struct GreasePencil *id_reference;
} GreasePencilDrawingReference;
/**
* Flag for grease pencil frames. #GreasePencilFrame.flag
*/
typedef enum GreasePencilFrameFlag {
GP_FRAME_SELECTED = (1 << 0),
} GreasePencilFrameFlag;
/**
* A GreasePencilFrame is a single keyframe in the timeline.
* It references a drawing by index into the drawing array.
@ -128,14 +135,12 @@ typedef struct GreasePencilFrame {
* Index into the GreasePencil->drawings array.
*/
int drawing_index;
/**
* Flag. Used to set e.g. the selection.
*/
uint32_t flag;
/**
* Keyframe type.
* Keyframe type. See `eBezTriple_KeyframeType`.
*/
int8_t type;
char _pad[3];
@ -235,7 +240,7 @@ typedef struct GreasePencilLayer {
*/
char *viewlayer_name;
/**
* List of `GreasePencilLayerMask`.
* List of `GreasePencilLayerMask`. Only used for storage in the .blend file.
*/
ListBase masks_storage;
/**
@ -281,18 +286,15 @@ typedef struct GreasePencilLayerTreeNode {
* Indicates the type of struct this element is.
*/
int8_t type;
/**
* Color tag.
*/
uint8_t color[3];
/**
* Flag. Used to set e.g. the selection, visibility, ... status.
* See `GreasePencilLayerTreeNodeFlag`.
*/
uint32_t flag;
/**
* Name of the layer/group. Dynamic length.
*/