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:
authorSergey Sharybin <sergey.vfx@gmail.com>2019-07-26 15:13:53 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2019-07-26 16:16:52 +0300
commit9270c15af8fc6b1fccf6dd6976f5bd0fe0342790 (patch)
treeb12ee92a094db4d0b8ad5e7022df25ac3e0b071f /source/blender/editors/gpencil/gpencil_primitive.c
parentad18d331d773518088b1b918038244bc5c5d253d (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_primitive.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_primitive.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index cca94925e6e..6c317b3ddb9 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -305,8 +305,8 @@ static void gpencil_primitive_allocate_memory(tGPDprimitive *tgpi)
/* Helper: Create internal strokes primitives data */
static void gp_primitive_set_initdata(bContext *C, tGPDprimitive *tgpi)
{
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
- int cfra_eval = (int)DEG_get_ctime(depsgraph);
+ Scene *scene = CTX_data_scene(C);
+ int cfra_eval = CFRA;
bGPDlayer *gpl = CTX_data_active_gpencil_layer(C);
@@ -1096,10 +1096,9 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op)
bGPdata *gpd = CTX_data_gpencil_data(C);
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
- Depsgraph *depsgraph = CTX_data_depsgraph(C);
Paint *paint = &ts->gp_paint->paint;
- int cfra_eval = (int)DEG_get_ctime(depsgraph);
+ int cfra_eval = CFRA;
/* create temporary operator data */
tGPDprimitive *tgpi = MEM_callocN(sizeof(tGPDprimitive), "GPencil Primitive Data");