[Bf-blender-cvs] [54df4699c3d] draw-deferred-compilation-experiment: Fix T70844: Incorrect snappping of strips when effects attached
Commit: 54df4699c3d3abfd171a42050dc96e63ebd8be78 Author: Shrey Aggarwal Date: Thu Apr 21 00:44:57 2022 +0200 Branches: draw-deferred-compilation-experiment https://developer.blender.org/rB54df4699c3d3abfd171a42050dc96e63ebd8be78 Fix T70844: Incorrect snappping of strips when effects attached Sometimes, when moving strip with 2 input effect attached and causing strip overlap, this overlap is resolved incorrectly - too big offset is applied. This is because effects are not taken into consideration when "shuffeling" to resolve overlap. To fix usual cases (transitions), overlap between strip and it's effect is considered to be impossible. There are edge cases, but these would be much more complicated to implement and could have negative impact on performance. Reviewed By: ISS Differential Revision: https://developer.blender.org/D14578 === M source/blender/sequencer/SEQ_relations.h M source/blender/sequencer/intern/strip_relations.c M source/blender/sequencer/intern/strip_transform.c === diff --git a/source/blender/sequencer/SEQ_relations.h b/source/blender/sequencer/SEQ_relations.h index 735b5659ca9..917f549f16d 100644 --- a/source/blender/sequencer/SEQ_relations.h +++ b/source/blender/sequencer/SEQ_relations.h @@ -18,6 +18,10 @@ struct ReportList; struct Scene; struct Sequence; +/** + * Check if one sequence is input to the other. + */ +bool SEQ_relation_is_effect_of_strip(const struct Sequence *effect, const struct Sequence *input); /** * Function to free imbuf and anim data on changes. */ @@ -64,6 +68,7 @@ void SEQ_cache_iterate( struct Sequence *SEQ_find_metastrip_by_sequence(ListBase *seqbase /* = ed->seqbase */, struct Sequence *meta /* = NULL */, struct Sequence *seq); + #ifdef __cplusplus } #endif diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c index a65a331c650..ff6d9481f42 100644 --- a/source/blender/sequencer/intern/strip_relations.c +++ b/source/blender/sequencer/intern/strip_relations.c @@ -34,6 +34,11 @@ #include "image_cache.h" #include "utils.h" +bool SEQ_relation_is_effect_of_strip(const Sequence *effect, const Sequence *input) +{ + return ELEM(input, effect->seq1, effect->seq2); +} + /* check whether sequence cur depends on seq */ static bool seq_relations_check_depend(Sequence *seq, Sequence *cur) { diff --git a/source/blender/sequencer/intern/strip_transform.c b/source/blender/sequencer/intern/strip_transform.c index e614dfa9b82..2c9ab0a3335 100644 --- a/source/blender/sequencer/intern/strip_transform.c +++ b/source/blender/sequencer/intern/strip_transform.c @@ -297,6 +297,9 @@ static int shuffle_seq_time_offset_test(SeqCollection *strips_to_shuffle, if (!SEQ_transform_test_overlap_seq_seq(seq, seq_other)) { continue; } + if (SEQ_relation_is_effect_of_strip(seq_other, seq)) { +continue; + } if (UNLIKELY(SEQ_collection_has_strip(seq_other, strips_to_shuffle))) { CLOG_WARN(, "Strip overlaps with itself or another strip, that is to be shuffled. " ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [502f3debf9a] master: Fix T70844: Incorrect snappping of strips when effects attached
Commit: 502f3debf9a683280d12a5fa19bf4b3a2e2731bf Author: Shrey Aggarwal Date: Thu Apr 21 00:44:57 2022 +0200 Branches: master https://developer.blender.org/rB502f3debf9a683280d12a5fa19bf4b3a2e2731bf Fix T70844: Incorrect snappping of strips when effects attached Sometimes, when moving strip with 2 input effect attached and causing strip overlap, this overlap is resolved incorrectly - too big offset is applied. This is because effects are not taken into consideration when "shuffeling" to resolve overlap. To fix usual cases (transitions), overlap between strip and it's effect is considered to be impossible. There are edge cases, but these would be much more complicated to implement and could have negative impact on performance. Reviewed By: ISS Differential Revision: https://developer.blender.org/D14578 === M source/blender/sequencer/SEQ_relations.h M source/blender/sequencer/intern/strip_relations.c M source/blender/sequencer/intern/strip_transform.c === diff --git a/source/blender/sequencer/SEQ_relations.h b/source/blender/sequencer/SEQ_relations.h index 735b5659ca9..917f549f16d 100644 --- a/source/blender/sequencer/SEQ_relations.h +++ b/source/blender/sequencer/SEQ_relations.h @@ -18,6 +18,10 @@ struct ReportList; struct Scene; struct Sequence; +/** + * Check if one sequence is input to the other. + */ +bool SEQ_relation_is_effect_of_strip(const struct Sequence *effect, const struct Sequence *input); /** * Function to free imbuf and anim data on changes. */ @@ -64,6 +68,7 @@ void SEQ_cache_iterate( struct Sequence *SEQ_find_metastrip_by_sequence(ListBase *seqbase /* = ed->seqbase */, struct Sequence *meta /* = NULL */, struct Sequence *seq); + #ifdef __cplusplus } #endif diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c index a65a331c650..ff6d9481f42 100644 --- a/source/blender/sequencer/intern/strip_relations.c +++ b/source/blender/sequencer/intern/strip_relations.c @@ -34,6 +34,11 @@ #include "image_cache.h" #include "utils.h" +bool SEQ_relation_is_effect_of_strip(const Sequence *effect, const Sequence *input) +{ + return ELEM(input, effect->seq1, effect->seq2); +} + /* check whether sequence cur depends on seq */ static bool seq_relations_check_depend(Sequence *seq, Sequence *cur) { diff --git a/source/blender/sequencer/intern/strip_transform.c b/source/blender/sequencer/intern/strip_transform.c index e614dfa9b82..2c9ab0a3335 100644 --- a/source/blender/sequencer/intern/strip_transform.c +++ b/source/blender/sequencer/intern/strip_transform.c @@ -297,6 +297,9 @@ static int shuffle_seq_time_offset_test(SeqCollection *strips_to_shuffle, if (!SEQ_transform_test_overlap_seq_seq(seq, seq_other)) { continue; } + if (SEQ_relation_is_effect_of_strip(seq_other, seq)) { +continue; + } if (UNLIKELY(SEQ_collection_has_strip(seq_other, strips_to_shuffle))) { CLOG_WARN(, "Strip overlaps with itself or another strip, that is to be shuffled. " ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [f021d467526] master: Cleanup: GHOST_ISystem::toggleConsole API
Commit: f021d467526af3f3fc839c0ca48acc61dd781d56 Author: Shrey Aggarwal Date: Tue Feb 8 17:40:48 2022 -0700 Branches: master https://developer.blender.org/rBf021d467526af3f3fc839c0ca48acc61dd781d56 Cleanup: GHOST_ISystem::toggleConsole API GHOST_ISystem::toggleConsole had a somewhat misleading name it could be fed 4 different values, so it was not as much a toggle as a set console window state. This change renames `toggleConsole` to a more appropriately named `setConsoleWindowState` and replaces the integer it had to an enum so it's easy to tell what is being asked of it at the call site. Reviewed By: LazyDodo Differential Revision: https://developer.blender.org/D14020 === M intern/ghost/GHOST_C-api.h M intern/ghost/GHOST_ISystem.h M intern/ghost/GHOST_Types.h M intern/ghost/intern/GHOST_C-api.cpp M intern/ghost/intern/GHOST_SystemCocoa.h M intern/ghost/intern/GHOST_SystemNULL.h M intern/ghost/intern/GHOST_SystemSDL.h M intern/ghost/intern/GHOST_SystemWayland.cpp M intern/ghost/intern/GHOST_SystemWayland.h M intern/ghost/intern/GHOST_SystemWin32.cpp M intern/ghost/intern/GHOST_SystemWin32.h M intern/ghost/intern/GHOST_SystemX11.h M source/blender/windowmanager/intern/wm_init_exit.c M source/blender/windowmanager/intern/wm_operators.c === diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h index 98094cc0669..38adf81f877 100644 --- a/intern/ghost/GHOST_C-api.h +++ b/intern/ghost/GHOST_C-api.h @@ -889,16 +889,11 @@ extern char *GHOST_getClipboard(bool selection); extern void GHOST_putClipboard(const char *buffer, bool selection); /** - * Toggles console - * \param action: - * - 0: Hides - * - 1: Shows - * - 2: Toggles - * - 3: Hides if it runs not from command line - * - *: Does nothing + * Set the Console State + * \param action: console state * \return current status (1 -visible, 0 - hidden) */ -extern int GHOST_toggleConsole(int action); +extern int setConsoleWindowState(GHOST_TConsoleWindowState action); /** * Use native pixel size (MacBook pro 'retina'), if supported. diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h index 05c6c9d907f..3edc7605d41 100644 --- a/intern/ghost/GHOST_ISystem.h +++ b/intern/ghost/GHOST_ISystem.h @@ -411,16 +411,11 @@ class GHOST_ISystem { #endif /** - * Toggles console - * \param action: - * - 0: Hides. - * - 1: Shows - * - 2: Toggles - * - 3: Hides if it runs not from command line - * - *: Does nothing + * Set the Console State + * \param action: console state * \return current status (1 -visible, 0 - hidden) */ - virtual int toggleConsole(int action) = 0; + virtual int setConsoleWindowState(GHOST_TConsoleWindowState action) = 0; /*** * Access to clipboard. diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index 7fe9300ec3f..4e190d09234 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -140,6 +140,13 @@ typedef enum { // GHOST_kWindowStateUnModified, } GHOST_TWindowState; +typedef enum { + GHOST_kConsoleWindowStateHide = 0, + GHOST_kConsoleWindowStateShow, + GHOST_kConsoleWindowStateToggle, + GHOST_kConsoleWindowStateHideForNonConsoleLaunch +} GHOST_TConsoleWindowState; + typedef enum { GHOST_kWindowOrderTop = 0, GHOST_kWindowOrderBottom } GHOST_TWindowOrder; typedef enum { diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp index a21c3a90c06..a2d1c143316 100644 --- a/intern/ghost/intern/GHOST_C-api.cpp +++ b/intern/ghost/intern/GHOST_C-api.cpp @@ -809,10 +809,10 @@ void GHOST_putClipboard(const char *buffer, bool selection) system->putClipboard(buffer, selection); } -int GHOST_toggleConsole(int action) +int setConsoleWindowState(GHOST_TConsoleWindowState action) { GHOST_ISystem *system = GHOST_ISystem::getSystem(); - return system->toggleConsole(action); + return system->setConsoleWindowState(action); } int GHOST_UseNativePixels(void) diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h index 5950da6813d..02216f9d1f8 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.h +++ b/intern/ghost/intern/GHOST_SystemCocoa.h @@ -244,7 +244,7 @@ class GHOST_SystemCocoa : public GHOST_System { /** * \see GHOST_ISystem */ - int toggleConsole(int action) + int setConsoleWindowState(GHOST_TConsoleWindowState action) { return 0; } diff --git a/intern/ghost/intern/GHOST_SystemNULL.h b/intern/ghost/intern/GHOST_SystemNULL.h index 5dbc42b53a2..53cd97e8e57 100644 --- a/intern/ghost/intern/GHOST_SystemNULL.h +++ b/intern/ghost/intern/GHOST_SystemNULL.h @@ -40,7 +40,7 @@ class GHOST_SystemNULL : public GHO
[Bf-blender-cvs] [a5dd1bc53d4] master: Fix T90868: Console window flash when exiting
Commit: a5dd1bc53d4bf7994745124f58de674068d1d598 Author: Shrey Aggarwal Date: Mon Feb 7 08:20:12 2022 -0700 Branches: master https://developer.blender.org/rBa5dd1bc53d4bf7994745124f58de674068d1d598 Fix T90868: Console window flash when exiting If the console was hidden on windows, it would be made visible during shutdown in an effort not hide a potentially active interactive console session. This however did not take in account if blender was actually launched from an interactive console causing the console window to briefly flash during shutdown even when launched from the new launcher, the brief flash concerned some users. This change adjusts the behaviour to restore the console only when blender was started from the console. Reviewed By: LazyDodo Differential Revision: https://developer.blender.org/D14016 === M intern/ghost/intern/GHOST_SystemWin32.cpp === diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index 64e1ac3b9b3..923453d6c6f 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -105,6 +105,8 @@ */ #define BROKEN_PEEK_TOUCHPAD +static bool isStartedFromCommandPrompt(); + static void initRawInput() { #ifdef WITH_INPUT_NDOF @@ -166,7 +168,10 @@ GHOST_SystemWin32::~GHOST_SystemWin32() { // Shutdown COM OleUninitialize(); - toggleConsole(1); + + if (isStartedFromCommandPrompt()) { +toggleConsole(1); + } } uint64_t GHOST_SystemWin32::performanceCounterToMillis(__int64 perf_ticks) const ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org List details, subscription details or unsubscribe: https://lists.blender.org/mailman/listinfo/bf-blender-cvs