Initial Grease Pencil 3.0 stage #106848
|
@ -25,7 +25,6 @@ void legacy_gpencil_frame_to_grease_pencil_drawing(GreasePencilDrawing &drawing,
|
||||||
new (&drawing.geometry) CurvesGeometry();
|
new (&drawing.geometry) CurvesGeometry();
|
||||||
drawing.base.type = GP_DRAWING;
|
drawing.base.type = GP_DRAWING;
|
||||||
drawing.runtime = MEM_new<bke::GreasePencilDrawingRuntime>(__func__);
|
drawing.runtime = MEM_new<bke::GreasePencilDrawingRuntime>(__func__);
|
||||||
/* TODO: set flag. */
|
|
||||||
|
|
||||||
/* Get the number of points, number of strokes and the offsets for each stroke. */
|
/* Get the number of points, number of strokes and the offsets for each stroke. */
|
||||||
Vector<int> offsets;
|
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. */
|
/* Convert the frame to a drawing. */
|
||||||
legacy_gpencil_frame_to_grease_pencil_drawing(drawing, *gpf);
|
legacy_gpencil_frame_to_grease_pencil_drawing(drawing, *gpf);
|
||||||
|
|
||||||
GreasePencilFrame frame;
|
GreasePencilFrame new_frame;
|
||||||
frame.drawing_index = i;
|
new_frame.drawing_index = i;
|
||||||
frame.type = gpf->key_type;
|
new_frame.type = gpf->key_type;
|
||||||
new_layer.insert_frame(gpf->framenum, std::move(frame));
|
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++;
|
i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,6 +119,13 @@ typedef struct GreasePencilDrawingReference {
|
||||||
struct GreasePencil *id_reference;
|
struct GreasePencil *id_reference;
|
||||||
} GreasePencilDrawingReference;
|
} 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.
|
* A GreasePencilFrame is a single keyframe in the timeline.
|
||||||
* It references a drawing by index into the drawing array.
|
* It references a drawing by index into the drawing array.
|
||||||
|
@ -128,14 +135,12 @@ typedef struct GreasePencilFrame {
|
||||||
* Index into the GreasePencil->drawings array.
|
* Index into the GreasePencil->drawings array.
|
||||||
*/
|
*/
|
||||||
int drawing_index;
|
int drawing_index;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag. Used to set e.g. the selection.
|
* Flag. Used to set e.g. the selection.
|
||||||
*/
|
*/
|
||||||
uint32_t flag;
|
uint32_t flag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Keyframe type.
|
* Keyframe type. See `eBezTriple_KeyframeType`.
|
||||||
*/
|
*/
|
||||||
int8_t type;
|
int8_t type;
|
||||||
char _pad[3];
|
char _pad[3];
|
||||||
|
@ -235,7 +240,7 @@ typedef struct GreasePencilLayer {
|
||||||
*/
|
*/
|
||||||
char *viewlayer_name;
|
char *viewlayer_name;
|
||||||
/**
|
/**
|
||||||
* List of `GreasePencilLayerMask`.
|
* List of `GreasePencilLayerMask`. Only used for storage in the .blend file.
|
||||||
*/
|
*/
|
||||||
ListBase masks_storage;
|
ListBase masks_storage;
|
||||||
/**
|
/**
|
||||||
|
@ -281,18 +286,15 @@ typedef struct GreasePencilLayerTreeNode {
|
||||||
* Indicates the type of struct this element is.
|
* Indicates the type of struct this element is.
|
||||||
*/
|
*/
|
||||||
int8_t type;
|
int8_t type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Color tag.
|
* Color tag.
|
||||||
*/
|
*/
|
||||||
uint8_t color[3];
|
uint8_t color[3];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag. Used to set e.g. the selection, visibility, ... status.
|
* Flag. Used to set e.g. the selection, visibility, ... status.
|
||||||
* See `GreasePencilLayerTreeNodeFlag`.
|
* See `GreasePencilLayerTreeNodeFlag`.
|
||||||
*/
|
*/
|
||||||
uint32_t flag;
|
uint32_t flag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Name of the layer/group. Dynamic length.
|
* Name of the layer/group. Dynamic length.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue