diff options
Diffstat (limited to 'source/blender/editors/gpencil')
18 files changed, 52 insertions, 50 deletions
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index f720f261ad5..ae09aea28d3 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -841,7 +841,8 @@ void ED_annotation_draw_2dimage(const bContext *C) } /* draw it! */ - annotation_draw_data_all(scene, gpd, offsx, offsy, sizex, sizey, CFRA, dflag, area->spacetype); + annotation_draw_data_all( + scene, gpd, offsx, offsy, sizex, sizey, scene->r.cfra, dflag, area->spacetype); } void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d) @@ -877,7 +878,7 @@ void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d) } annotation_draw_data_all( - scene, gpd, 0, 0, region->winx, region->winy, CFRA, dflag, area->spacetype); + scene, gpd, 0, 0, region->winx, region->winy, scene->r.cfra, dflag, area->spacetype); } void ED_annotation_draw_view3d( @@ -928,7 +929,8 @@ void ED_annotation_draw_view3d( } /* draw it! */ - annotation_draw_data_all(scene, gpd, offsx, offsy, winx, winy, CFRA, dflag, v3d->spacetype); + annotation_draw_data_all( + scene, gpd, offsx, offsy, winx, winy, scene->r.cfra, dflag, v3d->spacetype); } void ED_annotation_draw_ex( diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index 8c393cc4f3f..dd935e4f5f5 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -1568,7 +1568,7 @@ static void annotation_paint_initstroke(tGPsdata *p, add_frame_mode = GP_GETFRAME_ADD_NEW; } - p->gpf = BKE_gpencil_layer_frame_get(p->gpl, CFRA, add_frame_mode); + p->gpf = BKE_gpencil_layer_frame_get(p->gpl, scene->r.cfra, add_frame_mode); if (p->gpf == NULL) { p->status = GP_STATUS_ERROR; diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index c7d0d9e0e35..8a98dcb57fc 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -371,7 +371,7 @@ bool ED_gpencil_anim_copybuf_copy(bAnimContext *ac) } /* in case 'relative' paste method is used */ - gpencil_anim_copy_cfra = CFRA; + gpencil_anim_copy_cfra = scene->r.cfra; /* clean up */ ANIM_animdata_freelist(&anim_data); @@ -403,13 +403,13 @@ bool ED_gpencil_anim_copybuf_paste(bAnimContext *ac, const short offset_mode) /* methods of offset (eKeyPasteOffset) */ switch (offset_mode) { case KEYFRAME_PASTE_OFFSET_CFRA_START: - offset = (CFRA - gpencil_anim_copy_firstframe); + offset = (scene->r.cfra - gpencil_anim_copy_firstframe); break; case KEYFRAME_PASTE_OFFSET_CFRA_END: - offset = (CFRA - gpencil_anim_copy_lastframe); + offset = (scene->r.cfra - gpencil_anim_copy_lastframe); break; case KEYFRAME_PASTE_OFFSET_CFRA_RELATIVE: - offset = (CFRA - gpencil_anim_copy_cfra); + offset = (scene->r.cfra - gpencil_anim_copy_cfra); break; case KEYFRAME_PASTE_OFFSET_NONE: offset = 0; @@ -518,7 +518,7 @@ static bool gpencil_frame_snap_nearestsec(bGPDframe *gpf, Scene *scene) static bool gpencil_frame_snap_cframe(bGPDframe *gpf, Scene *scene) { if (gpf->flag & GP_FRAME_SELECT) { - gpf->framenum = (int)CFRA; + gpf->framenum = (int)scene->r.cfra; } return false; } @@ -560,8 +560,8 @@ static bool gpencil_frame_mirror_cframe(bGPDframe *gpf, Scene *scene) int diff; if (gpf->flag & GP_FRAME_SELECT) { - diff = CFRA - gpf->framenum; - gpf->framenum = CFRA + diff; + diff = scene->r.cfra - gpf->framenum; + gpf->framenum = scene->r.cfra + diff; } return false; diff --git a/source/blender/editors/gpencil/gpencil_add_blank.c b/source/blender/editors/gpencil/gpencil_add_blank.c index 2f22fad53e7..e8e6d328804 100644 --- a/source/blender/editors/gpencil/gpencil_add_blank.c +++ b/source/blender/editors/gpencil/gpencil_add_blank.c @@ -76,7 +76,7 @@ void ED_gpencil_create_blank(bContext *C, Object *ob, float UNUSED(mat[4][4])) bGPDlayer *layer = BKE_gpencil_layer_addnew(gpd, "GP_Layer", true, false); /* frames */ - BKE_gpencil_frame_addnew(layer, CFRA); + BKE_gpencil_frame_addnew(layer, scene->r.cfra); /* update depsgraph */ DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); diff --git a/source/blender/editors/gpencil/gpencil_add_monkey.c b/source/blender/editors/gpencil/gpencil_add_monkey.c index 65ee732f6a9..bc046e89d21 100644 --- a/source/blender/editors/gpencil/gpencil_add_monkey.c +++ b/source/blender/editors/gpencil/gpencil_add_monkey.c @@ -844,8 +844,8 @@ void ED_gpencil_create_monkey(bContext *C, Object *ob, float mat[4][4]) /* frames */ /* NOTE: No need to check for existing, as this will take care of it for us */ - bGPDframe *frameFills = BKE_gpencil_frame_addnew(Fills, CFRA); - bGPDframe *frameLines = BKE_gpencil_frame_addnew(Lines, CFRA); + bGPDframe *frameFills = BKE_gpencil_frame_addnew(Fills, scene->r.cfra); + bGPDframe *frameLines = BKE_gpencil_frame_addnew(Lines, scene->r.cfra); /* generate strokes */ gps = BKE_gpencil_stroke_add(frameFills, color_Skin, 270, 75, false); diff --git a/source/blender/editors/gpencil/gpencil_add_stroke.c b/source/blender/editors/gpencil/gpencil_add_stroke.c index bc5fe9b5cfb..e24964c4832 100644 --- a/source/blender/editors/gpencil/gpencil_add_stroke.c +++ b/source/blender/editors/gpencil/gpencil_add_stroke.c @@ -211,8 +211,8 @@ void ED_gpencil_create_stroke(bContext *C, Object *ob, float mat[4][4]) bGPDlayer *lines = BKE_gpencil_layer_addnew(gpd, "Lines", true, false); /* frames */ - bGPDframe *frame_color = BKE_gpencil_frame_addnew(colors, CFRA); - bGPDframe *frame_lines = BKE_gpencil_frame_addnew(lines, CFRA); + bGPDframe *frame_color = BKE_gpencil_frame_addnew(colors, scene->r.cfra); + bGPDframe *frame_lines = BKE_gpencil_frame_addnew(lines, scene->r.cfra); UNUSED_VARS(frame_color); /* generate stroke */ diff --git a/source/blender/editors/gpencil/gpencil_bake_animation.cc b/source/blender/editors/gpencil/gpencil_bake_animation.cc index 66f53bea326..e480852a9bb 100644 --- a/source/blender/editors/gpencil/gpencil_bake_animation.cc +++ b/source/blender/editors/gpencil/gpencil_bake_animation.cc @@ -265,7 +265,7 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op } /* Move scene to new frame. */ - CFRA = i; + scene->r.cfra = i; BKE_scene_graph_update_for_newframe(depsgraph); /* Loop all objects in the list. */ @@ -285,7 +285,7 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op /* Apply time modifier. */ int remap_cfra = BKE_gpencil_time_modifier_cfra( - depsgraph, scene, elem->ob, gpl_src, CFRA, false); + depsgraph, scene, elem->ob, gpl_src, scene->r.cfra, false); /* Duplicate frame. */ bGPDframe *gpf_src = BKE_gpencil_layer_frame_get( gpl_src, remap_cfra, GP_GETFRAME_USE_PREV); @@ -293,7 +293,7 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op continue; } bGPDframe *gpf_dst = BKE_gpencil_frame_duplicate(gpf_src, true); - gpf_dst->framenum = CFRA + frame_offset; + gpf_dst->framenum = scene->r.cfra + frame_offset; gpf_dst->flag &= ~GP_FRAME_SELECT; BLI_addtail(&gpl_dst->frames, gpf_dst); @@ -337,7 +337,7 @@ static int gpencil_bake_grease_pencil_animation_exec(bContext *C, wmOperator *op } } /* Return scene frame state and DB to original state. */ - CFRA = oldframe; + scene->r.cfra = oldframe; BKE_scene_graph_update_for_newframe(depsgraph); /* Free memory. */ diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index 0601d009bf7..25b5466e260 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -1271,7 +1271,7 @@ static void gpencil_layer_to_curve(bContext *C, Collection *collection = CTX_data_collection(C); Scene *scene = CTX_data_scene(C); - bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV); + bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV); bGPDstroke *prev_gps = NULL; Object *ob; Curve *cu; @@ -1414,7 +1414,7 @@ static bool gpencil_convert_check_has_valid_timing(bContext *C, bGPDlayer *gpl, int i; bool valid = true; - if (!gpl || !(gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV)) || + if (!gpl || !(gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV)) || !(gps = gpf->strokes.first)) { return false; } @@ -1481,7 +1481,7 @@ static bool gpencil_convert_poll(bContext *C) * and if we are not in edit mode! */ return ((area && area->spacetype == SPACE_VIEW3D) && (gpl = BKE_gpencil_layer_active_get(gpd)) && - (gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV)) && + (gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV)) && (gpf->strokes.first) && (!GPENCIL_ANY_EDIT_MODE(gpd))); } @@ -1811,7 +1811,7 @@ static int image_to_gpencil_exec(bContext *C, wmOperator *op) /* Add layer and frame. */ bGPdata *gpd = (bGPdata *)ob->data; bGPDlayer *gpl = BKE_gpencil_layer_addnew(gpd, "Image Layer", true, false); - bGPDframe *gpf = BKE_gpencil_frame_addnew(gpl, CFRA); + bGPDframe *gpf = BKE_gpencil_frame_addnew(gpl, scene->r.cfra); done = BKE_gpencil_from_image(sima, gpd, gpf, size, is_mask); if (done) { diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 6843c42d2d0..b7ac73b9692 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -226,7 +226,7 @@ static int gpencil_layer_add_exec(bContext *C, wmOperator *op) bGPDlayer *gpl = BKE_gpencil_layer_addnew(gpd, DATA_("GP_Layer"), true, false); /* 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); + gpl->actframe = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_ADD_NEW); } } } @@ -646,12 +646,12 @@ static int gpencil_frame_duplicate_exec(bContext *C, wmOperator *op) } if (mode == 0) { - BKE_gpencil_frame_addcopy(gpl_active, CFRA); + BKE_gpencil_frame_addcopy(gpl_active, scene->r.cfra); } else { LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { if ((gpl->flag & GP_LAYER_LOCKED) == 0) { - BKE_gpencil_frame_addcopy(gpl, CFRA); + BKE_gpencil_frame_addcopy(gpl, scene->r.cfra); } } } diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 5028baf1589..06f3c169fa9 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1718,7 +1718,7 @@ static int gpencil_strokes_paste_exec(bContext *C, wmOperator *op) * we are obliged to add a new frame if one * doesn't exist already */ - gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_ADD_NEW); + gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_ADD_NEW); if (gpf) { /* Create new stroke */ bGPDstroke *new_stroke = BKE_gpencil_stroke_duplicate(gps, true, true); @@ -1971,7 +1971,7 @@ static int gpencil_blank_frame_add_exec(bContext *C, wmOperator *op) { bGPdata *gpd = ED_gpencil_data_get_active(C); Scene *scene = CTX_data_scene(C); - int cfra = CFRA; + int cfra = scene->r.cfra; bGPDlayer *active_gpl = BKE_gpencil_layer_active_get(gpd); @@ -2075,7 +2075,7 @@ static int gpencil_actframe_delete_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); - bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV); + bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV); /* if there's no existing Grease-Pencil data there, add some */ if (gpd == NULL) { @@ -2150,7 +2150,7 @@ static int gpencil_actframe_delete_all_exec(bContext *C, wmOperator *op) CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) { /* try to get the "active" frame - but only if it actually occurs on this frame */ - bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV); + bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV); if (gpf == NULL) { continue; @@ -3818,7 +3818,7 @@ static int gpencil_strokes_reproject_exec(bContext *C, wmOperator *op) /* update frame to get the new location of objects */ if ((mode == GP_REPROJECT_SURFACE) && (cfra_prv != gpf->framenum)) { cfra_prv = gpf->framenum; - CFRA = gpf->framenum; + scene->r.cfra = gpf->framenum; BKE_scene_graph_update_for_newframe(depsgraph); } @@ -3846,7 +3846,7 @@ static int gpencil_strokes_reproject_exec(bContext *C, wmOperator *op) CTX_DATA_END; /* return frame state and DB to original state */ - CFRA = oldframe; + scene->r.cfra = oldframe; BKE_scene_graph_update_for_newframe(depsgraph); if (sctx != NULL) { diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index 3f06dbfdbb3..5305c764b3a 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -1748,7 +1748,7 @@ static tGPDfill *gpencil_session_init_fill(bContext *C, wmOperator *op) tgpf->v3d = tgpf->area->spacedata.first; tgpf->depsgraph = CTX_data_ensure_evaluated_depsgraph(C); tgpf->win = CTX_wm_window(C); - tgpf->active_cfra = CFRA; + tgpf->active_cfra = scene->r.cfra; tgpf->reports = op->reports; /* Setup space conversions. */ @@ -2222,8 +2222,8 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event) /* Hash of selected frames. */ GHash *frame_list = BLI_ghash_int_new_ex(__func__, 64); - /* If not multi-frame and there is no frame in CFRA for the active layer, create - * a new frame. */ + /* If not multi-frame and there is no frame in scene->r.cfra for the active layer, + * create a new frame. */ if (!is_multiedit) { tgpf->gpf = BKE_gpencil_layer_frame_get( tgpf->gpl, diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index 0039dbae674..e7a4f2fe2dc 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -483,10 +483,10 @@ static void gpencil_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi) tgpil = MEM_callocN(sizeof(tGPDinterpolate_layer), "GPencil Interpolate Layer"); tgpil->gpl = gpl; - bGPDframe *gpf = gpencil_get_previous_keyframe(gpl, CFRA); + bGPDframe *gpf = gpencil_get_previous_keyframe(gpl, scene->r.cfra); tgpil->prevFrame = BKE_gpencil_frame_duplicate(gpf, true); - gpf = gpencil_get_next_keyframe(gpl, CFRA); + gpf = gpencil_get_next_keyframe(gpl, scene->r.cfra); tgpil->nextFrame = BKE_gpencil_frame_duplicate(gpf, true); BLI_addtail(&tgpi->ilayers, tgpil); @@ -750,7 +750,7 @@ static int gpencil_interpolate_invoke(bContext *C, wmOperator *op, const wmEvent tGPDinterpolate *tgpi = NULL; /* Cannot interpolate if not between 2 frames. */ - int cfra = CFRA; + int cfra = scene->r.cfra; bGPDframe *gpf_prv = gpencil_get_previous_keyframe(gpl, cfra); bGPDframe *gpf_next = gpencil_get_next_keyframe(gpl, cfra); if (ELEM(NULL, gpf_prv, gpf_next)) { @@ -1221,7 +1221,7 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op) GP_SpaceConversion gsc; gpencil_point_conversion_init(C, &gsc); - int cfra = CFRA; + int cfra = scene->r.cfra; GP_Interpolate_Settings *ipo_settings = &ts->gp_interpolate; const int step = RNA_int_get(op->ptr, "step"); diff --git a/source/blender/editors/gpencil/gpencil_merge.c b/source/blender/editors/gpencil/gpencil_merge.c index 06343dcad43..8ff3f20cef3 100644 --- a/source/blender/editors/gpencil/gpencil_merge.c +++ b/source/blender/editors/gpencil/gpencil_merge.c @@ -113,7 +113,7 @@ static bGPDstroke *gpencil_prepare_stroke(bContext *C, wmOperator *op, int totpo else { add_frame_mode = GP_GETFRAME_ADD_NEW; } - bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, add_frame_mode); + bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, add_frame_mode); /* stroke */ bGPDstroke *gps = BKE_gpencil_stroke_new(MAX2(ob->actcol - 1, 0), totpoints, brush->size); diff --git a/source/blender/editors/gpencil/gpencil_mesh.cc b/source/blender/editors/gpencil/gpencil_mesh.cc index aee00d4ede3..b27e1c75746 100644 --- a/source/blender/editors/gpencil/gpencil_mesh.cc +++ b/source/blender/editors/gpencil/gpencil_mesh.cc @@ -283,7 +283,7 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op) } /* Move scene to new frame. */ - CFRA = i; + scene->r.cfra = i; BKE_scene_graph_update_for_newframe(depsgraph); /* Loop all objects in the list. */ @@ -325,7 +325,7 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op) } /* Return scene frame state and DB to original state. */ - CFRA = oldframe; + scene->r.cfra = oldframe; BKE_scene_graph_update_for_newframe(depsgraph); /* Remove unused materials. */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 7c7f532f087..70486138556 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -2166,7 +2166,7 @@ static void gpencil_paint_initstroke(tGPsdata *p, if (gpl->actframe && gpl->actframe->strokes.first) { if (ts->gpencil_flags & GP_TOOL_FLAG_RETAIN_LAST) { short frame_mode = IS_AUTOKEY_ON(scene) ? GP_GETFRAME_ADD_COPY : GP_GETFRAME_USE_PREV; - gpl->actframe = BKE_gpencil_layer_frame_get(gpl, CFRA, frame_mode); + gpl->actframe = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, frame_mode); } has_layer_to_erase = true; break; @@ -2204,7 +2204,7 @@ static void gpencil_paint_initstroke(tGPsdata *p, bool need_tag = p->gpl->actframe == NULL; bGPDframe *actframe = p->gpl->actframe; - p->gpf = BKE_gpencil_layer_frame_get(p->gpl, CFRA, add_frame_mode); + p->gpf = BKE_gpencil_layer_frame_get(p->gpl, scene->r.cfra, add_frame_mode); /* Only if there wasn't an active frame, need update. */ if (need_tag) { DEG_id_tag_update(&p->gpd->id, ID_RECALC_GEOMETRY); diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index b57b8145749..befff611d58 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -292,7 +292,7 @@ static void gpencil_primitive_set_initdata(bContext *C, tGPDprimitive *tgpi) Scene *scene = CTX_data_scene(C); ToolSettings *ts = scene->toolsettings; Brush *brush = tgpi->brush; - int cfra = CFRA; + int cfra = scene->r.cfra; bGPDlayer *gpl = CTX_data_active_gpencil_layer(C); @@ -1195,7 +1195,7 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op) tgpi->orign_type = RNA_enum_get(op->ptr, "type"); /* set current frame number */ - tgpi->cframe = CFRA; + tgpi->cframe = scene->r.cfra; /* set GP datablock */ tgpi->gpd = gpd; diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c index f25d5937ac4..b68240362c5 100644 --- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c +++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c @@ -1013,7 +1013,7 @@ static void gpencil_brush_clone_add(bContext *C, tGP_BrushEditData *gso) gpl = CTX_data_active_gpencil_layer(C); } bGPDframe *gpf = BKE_gpencil_layer_frame_get( - gpl, CFRA, IS_AUTOKEY_ON(scene) ? GP_GETFRAME_ADD_NEW : GP_GETFRAME_USE_PREV); + gpl, scene->r.cfra, IS_AUTOKEY_ON(scene) ? GP_GETFRAME_ADD_NEW : GP_GETFRAME_USE_PREV); if (gpf == NULL) { continue; } @@ -1336,7 +1336,7 @@ static void gpencil_sculpt_brush_init_stroke(bContext *C, tGP_BrushEditData *gso bGPdata *gpd = gso->gpd; Scene *scene = gso->scene; - int cfra = CFRA; + int cfra = scene->r.cfra; /* only try to add a new frame if this is the first stroke, or the frame has changed */ if ((gpd == NULL) || (cfra == gso->cfra)) { diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index e903d11a1e0..a19265720e8 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -759,7 +759,7 @@ static bool gpencil_select_same_layer(bContext *C) bool changed = false; CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) { - bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, GP_GETFRAME_USE_PREV); + bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV); bGPDstroke *gps; bool found = false; |