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:
authorAntonio Vazquez <blendergit@gmail.com>2020-03-24 18:19:11 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-03-24 18:19:11 +0300
commita40f2c30ff64b6cdca557287b173398d9a4e9275 (patch)
treea1a65b5cd70ce9b8fa4e52e10eb32368d33482dc /source/blender/editors/gpencil/gpencil_data.c
parent7ac5c5b08cdda9f05f17f27d2ffbeb57929eef1e (diff)
GPencil: Cleanup previous commit
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_data.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index f96b7c172a2..898facb86e8 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -211,8 +211,6 @@ void GPENCIL_OT_data_unlink(wmOperatorType *ot)
static int gp_layer_add_exec(bContext *C, wmOperator *op)
{
const bool is_annotation = STREQ(op->idname, "GPENCIL_OT_layer_annotation_add");
- ScrArea *sa = CTX_wm_area(C);
- const bool is_dopesheet = (sa->spacetype == SPACE_ACTION);
PointerRNA gpd_owner = {NULL};
Main *bmain = CTX_data_main(C);
@@ -242,8 +240,10 @@ static int gp_layer_add_exec(bContext *C, wmOperator *op)
if ((ob != NULL) && (ob->type == OB_GPENCIL)) {
gpd = (bGPdata *)ob->data;
bGPDlayer *gpl = BKE_gpencil_layer_addnew(gpd, DATA_("GP_Layer"), true);
+ ScrArea *sa = CTX_wm_area(C);
+
/* In dopesheet add a new frame. */
- if ((gpl != NULL) && (is_dopesheet)) {
+ if ((gpl != NULL) && (sa->spacetype == SPACE_ACTION)) {
gpl->actframe = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_ADD_NEW);
}
}