Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-03-28 19:07:49 +0300
committerAntonioya <blendergit@gmail.com>2019-03-28 19:07:49 +0300
commiteeefea86cddbfea47e8026e3a10210a43e70fc90 (patch)
treeec6d72b1489efb7af3e18887a9efea0178c02639 /source/blender/editors/gpencil/gpencil_data.c
parent1dddb47e48ca0661d343a21100de8219bf85ae6a (diff)
Fix T63054: Crash on "Grease Pencil Unlink"
This operator was used only by annotations and it was part of the old legacy code. Now, the operator is limited to annotations and cannot be used with grease pencil objects. Also changed the tooltip to clarify it's only for annotations.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_data.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index a8b31b20182..2d5ec4c5055 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -175,6 +175,13 @@ static bool gp_data_unlink_poll(bContext *C)
{
bGPdata **gpd_ptr = ED_gpencil_data_get_pointers(C, NULL);
+ /* only unlink annotation datablocks */
+ if (gpd_ptr != NULL) {
+ bGPdata *gpd = (*gpd_ptr);
+ if ((gpd->flag & GP_DATA_ANNOTATIONS) == 0) {
+ return false;
+ }
+ }
/* if we have access to some active data, make sure there's a datablock before enabling this */
return (gpd_ptr && *gpd_ptr);
}
@@ -206,9 +213,9 @@ static int gp_data_unlink_exec(bContext *C, wmOperator *op)
void GPENCIL_OT_data_unlink(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Grease Pencil Unlink";
+ ot->name = "Annotation Unlink";
ot->idname = "GPENCIL_OT_data_unlink";
- ot->description = "Unlink active Grease Pencil data-block";
+ ot->description = "Unlink active Annotation data-block";
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* callbacks */