GPv3: Insert grease pencil keyframe from the dopesheet #110649
|
@ -1430,16 +1430,22 @@ bool GreasePencil::insert_duplicate_frame(blender::bke::greasepencil::Layer &lay
|
|||
duplicate_frame->type = frame.type;
|
||||
|
||||
const GreasePencilDrawingBase *drawing_base = this->drawings(frame.drawing_index);
|
||||
BLI_assert_msg((drawing_base->type == GP_DRAWING),
|
||||
"Drawing references cannot be duplicated yet.");
|
||||
const GreasePencilDrawing *drawing = reinterpret_cast<const GreasePencilDrawing *>(drawing_base);
|
||||
if (do_instance) {
|
||||
/* TODO : add user to the drawing. */
|
||||
switch (drawing_base->type) {
|
||||
case GP_DRAWING: {
|
||||
const GreasePencilDrawing *drawing = reinterpret_cast<const GreasePencilDrawing *>(
|
||||
drawing_base);
|
||||
if (do_instance) {
|
||||
/* TODO : add user to the drawing. */
|
||||
}
|
||||
amelief marked this conversation as resolved
Outdated
|
||||
else {
|
||||
this->add_duplicate_drawings(1, drawing->wrap());
|
||||
amelief marked this conversation as resolved
Outdated
Falk David
commented
Rather than asserting here, I think we can return Rather than asserting here, I think we can return `false`. I don't think we should crash here if the `frame_number` isn't found.
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GP_DRAWING_REFERENCE:
|
||||
/* TODO: Duplicate drawing references. */
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
this->add_duplicate_drawings(1, drawing->wrap());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
using namespace blender::bke::greasepencil;
here so we can useDrawing
below.