From 1693a5efe91999b60b3dc0bdff727473b3bd00bb Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 24 Jul 2019 12:40:33 +0200 Subject: Fix T66378: Missing animation update when switching view layer Current frame is stored in a scene, and scene might have multiple view layers. The inactive view layers were not informed about scene's frame being changed, so when user switched back to view after changing scene frame it was in an inconsistent state between current scene frame and animation. Now we tag scene for time changes, so dependency graph can catch up and do proper update. Currently tagging is from quite generic place. Probably better approach would be to tag from where frame is actually being assigned. Downside of this is that it's easy to miss some places. Reviewers: brecht, mont29 Reviewed By: brecht Maniphest Tasks: T66378 Differential Revision: https://developer.blender.org/D5332 --- source/blender/makesdna/DNA_ID.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index cad1af8eb50..dc4164169f9 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -616,6 +616,10 @@ typedef enum IDRecalcFlag { ID_RECALC_PARAMETERS = (1 << 21), + /* Makes it so everything what depends on time. + * Basically, the same what changing frame in a timeline will do. */ + ID_RECALC_TIME = (1 << 22), + /*************************************************************************** * Pseudonyms, to have more semantic meaning in the actual code without * using too much low-level and implementation specific tags. */ -- cgit v1.2.3 From 2cce65de9695943c5189b74d1c3a480d2b72889f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 28 Jul 2019 13:24:18 +0200 Subject: Fix T66872: Changing clip color space does not update background images Such reload can no longer happen directly and is to be done via dependency graph. Eventually, the movie cache will become shared across all copies of the clip, but even then we still need to have dependency graph mechanism because we need to update FFmpeg animation handle (which can not be shared across the copies). --- source/blender/makesdna/DNA_ID.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index dc4164169f9..ef9069acb78 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -620,6 +620,11 @@ typedef enum IDRecalcFlag { * Basically, the same what changing frame in a timeline will do. */ ID_RECALC_TIME = (1 << 22), + /* Input has changed and datablock is to be reload from disk. + * Applies to movie clips to inform that copy-on-written version is to be refreshed for the new + * input file or for color space changes. */ + ID_RECALC_SOURCE = (1 << 23), + /*************************************************************************** * Pseudonyms, to have more semantic meaning in the actual code without * using too much low-level and implementation specific tags. */ -- cgit v1.2.3 From ae7db53744845897154c9d2b54390850d3615093 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Tue, 30 Jul 2019 13:04:00 +0200 Subject: Fix T66629: Library override - fails when armature and mesh are in separate collections. Some ugly very low-level collection code was using the generic LIB_TAG_DOIT tag... should never happen, that one is for rather high-level code to use, core process shall use own tags. --- source/blender/makesdna/DNA_collection_types.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_collection_types.h b/source/blender/makesdna/DNA_collection_types.h index c7f3ef4156d..af543864536 100644 --- a/source/blender/makesdna/DNA_collection_types.h +++ b/source/blender/makesdna/DNA_collection_types.h @@ -57,7 +57,9 @@ typedef struct Collection { float instance_offset[3]; short flag; - char _pad[6]; + /* Runtime-only, always cleared on file load. */ + short tag; + char _pad[4]; /* Runtime. Cache of objects in this collection and all its * children. This is created on demand when e.g. some physics @@ -84,4 +86,12 @@ enum { COLLECTION_IS_MASTER = (1 << 5), /* Is master collection embedded in the scene. */ }; +/* Collection->tag */ +enum { + /* That code (BKE_main_collections_parent_relations_rebuild and the like) + * is called from very low-level places, like e.g ID remapping... + * Using a generic tag like LIB_TAG_DOIT for this is just impossible, we need our very own. */ + COLLECTION_TAG_RELATION_REBUILD = (1 << 0), +}; + #endif /* __DNA_COLLECTION_TYPES_H__ */ -- cgit v1.2.3 From 7f29fc7415a49d5688efbe10fa0a81b174d49435 Mon Sep 17 00:00:00 2001 From: Antonioya Date: Sat, 20 Jul 2019 23:01:19 +0200 Subject: Fix T65691: GPencil Drawing long strokes turn invisible There was a fixed limit to the number of points available in a buffer stroke. Now, the array is expanded as needed using a predefined number of points for each expansion, instead to add one by one. This is done to reduce the number of times the memory allocation is required. As part of the fix, some variables have been renamed to reflect better their use. --- source/blender/makesdna/DNA_gpencil_types.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 307a6f2fe16..9134e603a87 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -412,7 +412,7 @@ typedef enum eGPLayerBlendModes { typedef struct bGPdata_Runtime { /** Last region where drawing was originated. */ struct ARegion *ar; - /** Stroke buffer (can hold GP_STROKE_BUFFER_MAX). */ + /** Stroke buffer. */ void *sbuffer; /* GP Object drawing */ @@ -431,11 +431,13 @@ typedef struct bGPdata_Runtime { * - buffer must be initialized before use, but freed after * whole paint operation is over */ - /** Number of elements currently in cache. */ - short sbuffer_size; + /** Number of elements currently used in cache. */ + short sbuffer_used; /** Flags for stroke that cache represents. */ short sbuffer_sflag; - char _pad[6]; + /** Number of total elements available in cache. */ + short sbuffer_size; + char _pad[4]; /** Number of control-points for stroke. */ int tot_cp_points; -- cgit v1.2.3 From 9d7a03ab1177f7227653ec691e10ce328771a4eb Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Tue, 30 Jul 2019 19:42:43 +0200 Subject: Fix T67939: GPencil Noise modifier step is ignored in render The value of the step was calculated using a variable that was removed when the render frame change. Now, the step is calculated using the modulus of the current frame and recalculate noise only if the remainder that results from performing integer division is equal to 0. To calculate current frame, the first used frame is calculated to adjust real frame range. This approach is more stable in viewport and render. --- source/blender/makesdna/DNA_gpencil_modifier_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index 8b756ff2937..c2a9d3cf296 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -92,7 +92,7 @@ typedef struct NoiseGpencilModifierData { int step; /** Last gp frame used. */ int gp_frame; - /** Last scene frame used. */ + /** First scene frame used. */ int scene_frame; /** Random values. */ float vrand1, vrand2; -- cgit v1.2.3