Initial Grease Pencil 3.0 stage #106848
|
@ -219,7 +219,7 @@ class LayerGroup : public TreeNode {
|
|||
namespace convert {
|
||||
|
||||
void legacy_gpencil_frame_to_grease_pencil_drawing(GreasePencilDrawing &drawing, bGPDframe &gpf);
|
||||
void legacy_gpencil_to_grease_pencil(GreasePencil &grease_pencil, bGPdata &gpd);
|
||||
void legacy_gpencil_to_grease_pencil(Main &main, GreasePencil &grease_pencil, bGPdata &gpd);
|
||||
|
||||
} // namespace convert
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include "BKE_curves.hh"
|
||||
#include "BKE_grease_pencil.hh"
|
||||
#include "BKE_material.h"
|
||||
|
||||
#include "BLI_color.hh"
|
||||
#include "BLI_listbase.h"
|
||||
|
@ -167,7 +168,7 @@ void legacy_gpencil_frame_to_grease_pencil_drawing(GreasePencilDrawing &drawing,
|
|||
#undef POINT_ATTRIBUTE
|
||||
}
|
||||
|
||||
void legacy_gpencil_to_grease_pencil(GreasePencil &grease_pencil, bGPdata &gpd)
|
||||
void legacy_gpencil_to_grease_pencil(Main &bmain, GreasePencil &grease_pencil, bGPdata &gpd)
|
||||
{
|
||||
using namespace blender::bke::greasepencil;
|
||||
|
||||
|
@ -210,6 +211,8 @@ void legacy_gpencil_to_grease_pencil(GreasePencil &grease_pencil, bGPdata &gpd)
|
|||
}
|
||||
|
||||
grease_pencil.runtime->set_active_layer_index(active_layer_index);
|
||||
|
||||
BKE_id_materials_copy(&bmain, &gpd.id, &grease_pencil.id);
|
||||
}
|
||||
|
||||
} // namespace blender::bke::greasepencil::convert
|
|
@ -3087,9 +3087,8 @@ static int object_convert_exec(bContext *C, wmOperator *op)
|
|||
newob->data = new_grease_pencil;
|
||||
newob->type = OB_GREASE_PENCIL;
|
||||
|
||||
bke::greasepencil::convert::legacy_gpencil_to_grease_pencil(*new_grease_pencil, *gpd);
|
||||
|
||||
BKE_id_materials_copy(bmain, &gpd->id, &new_grease_pencil->id);
|
||||
bke::greasepencil::convert::legacy_gpencil_to_grease_pencil(
|
||||
*bmain, *new_grease_pencil, *gpd);
|
||||
|
||||
BKE_object_free_derived_caches(newob);
|
||||
BKE_object_free_modifiers(newob, 0);
|
||||
|
|
Loading…
Reference in New Issue