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-04-16 23:43:41 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-04-17 09:24:22 +0300
commit42224bf6237bd7bfd4a81510bdd533648463b5aa (patch)
tree5e931d42dd56a968c413415f559c44cc63ad5b97
parent0733bd0d644a3f1f1d6b74cd6a11c686e06b40a3 (diff)
GPencil: Add always empty frame when add new layer
The dopesheet needs to have a frame to display the channel, so an empty frame is created in the current frame. See T66505 for details of why an empty channel cannot be displayed.
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 1e49195140c..c05162510d7 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -241,10 +241,8 @@ 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 *area = CTX_wm_area(C);
-
- /* In dopesheet add a new frame. */
- if ((gpl != NULL) && (area->spacetype == SPACE_ACTION)) {
+ /* Add a new frame to make it visible in Dopesheet. */
+ if (gpl != NULL) {
gpl->actframe = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_ADD_NEW);
}
}