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 34 additions and 0 deletions
Showing only changes of commit 6e627b37e9 - Show all commits

View File

@ -351,3 +351,6 @@ BoundBox *BKE_grease_pencil_boundbox_get(Object *ob);
void BKE_grease_pencil_data_update(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object);
bool BKE_grease_pencil_references_cyclic_check(const GreasePencil *id_reference,
const GreasePencil *grease_pencil);

View File

@ -733,6 +733,37 @@ void BKE_grease_pencil_data_update(struct Depsgraph * /*depsgraph*/,
/** \} */
/* ------------------------------------------------------------------- */
/** \name Grease Pencil reference functions
* \{ */
static bool grease_pencil_references_cyclic_check_internal(const GreasePencil *id_reference,
const GreasePencil *grease_pencil)
{
for (GreasePencilDrawingBase *base : grease_pencil->drawings()) {
if (base->type == GP_DRAWING_REFERENCE) {
GreasePencilDrawingReference *reference = reinterpret_cast<GreasePencilDrawingReference *>(
base);
if (id_reference == reference->id_reference) {
return true;
}
if (grease_pencil_references_cyclic_check_internal(id_reference, reference->id_reference)) {
return true;
}
}
}
return false;
}
bool BKE_grease_pencil_references_cyclic_check(const GreasePencil *id_reference,
const GreasePencil *grease_pencil)
{
return grease_pencil_references_cyclic_check_internal(id_reference, grease_pencil);
}
/** \} */
/* ------------------------------------------------------------------- */
/** \name Draw Cache
* \{ */