diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-26 15:13:53 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-26 16:16:52 +0300 |
commit | 9270c15af8fc6b1fccf6dd6976f5bd0fe0342790 (patch) | |
tree | b12ee92a094db4d0b8ad5e7022df25ac3e0b071f /source/blender/editors/gpencil/gpencil_convert.c | |
parent | ad18d331d773518088b1b918038244bc5c5d253d (diff) |
GPencil: Get current frame from scene
This change makes it so current frame is queried from a scene rather
than from a dependency graph. This makes it possible to avoid the
fact that dependency graph might not be fully evaluated yet.
There are still some cases where it frame is queried from the graph,
but those seems to be in a code path where we need to ensure valid
dependency graph anyway.
Reviewers: brecht
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D5349
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_convert.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_convert.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index 5afa379e04f..0caf153817c 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -1274,8 +1274,8 @@ static void gp_layer_to_curve(bContext *C, struct Main *bmain = CTX_data_main(C); ViewLayer *view_layer = CTX_data_view_layer(C); Collection *collection = CTX_data_collection(C); - Depsgraph *depsgraph = CTX_data_depsgraph(C); - int cfra_eval = (int)DEG_get_ctime(depsgraph); + Scene *scene = CTX_data_scene(C); + int cfra_eval = CFRA; bGPDframe *gpf = BKE_gpencil_layer_getframe(gpl, cfra_eval, GP_GETFRAME_USE_PREV); bGPDstroke *gps, *prev_gps = NULL; @@ -1406,8 +1406,8 @@ static void gp_layer_to_curve(bContext *C, */ static bool gp_convert_check_has_valid_timing(bContext *C, bGPDlayer *gpl, wmOperator *op) { - Depsgraph *depsgraph = CTX_data_depsgraph(C); - int cfra_eval = (int)DEG_get_ctime(depsgraph); + Scene *scene = CTX_data_scene(C); + int cfra_eval = CFRA; bGPDframe *gpf = NULL; bGPDstroke *gps = NULL; @@ -1468,8 +1468,8 @@ static void gp_convert_set_end_frame(struct Main *UNUSED(main), static bool gp_convert_poll(bContext *C) { Object *ob = CTX_data_active_object(C); - Depsgraph *depsgraph = CTX_data_depsgraph(C); - int cfra_eval = (int)DEG_get_ctime(depsgraph); + Scene *scene = CTX_data_scene(C); + int cfra_eval = CFRA; if ((ob == NULL) || (ob->type != OB_GPENCIL)) { return false; |