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
3 changed files with 7 additions and 5 deletions
Showing only changes of commit a182f4ebf2 - Show all commits

View File

@ -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

View File

@ -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

View File

@ -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);