From 7b4b115b0245ec4484d1a99749da5b3c97b2b3ba Mon Sep 17 00:00:00 2001 From: Exeldro Date: Fri, 4 Aug 2023 14:45:29 +0200 Subject: [PATCH] fix move transition in show and hide transitions --- CMakeLists.txt | 2 +- buildspec.json | 2 +- move-transition.c | 13 ++++++------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dbe1a7e..603be24 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ else() cmake_minimum_required(VERSION 3.18) endif() -project(move-transition VERSION 2.9.2) +project(move-transition VERSION 2.9.3) set(PROJECT_FULL_NAME "Move Transition") # Set new UUIDs when you start to create a new plugin. diff --git a/buildspec.json b/buildspec.json index ae85e05..41872bd 100644 --- a/buildspec.json +++ b/buildspec.json @@ -79,5 +79,5 @@ } }, "name": "move-transition", - "version": "2.9.2" + "version": "2.9.3" } diff --git a/move-transition.c b/move-transition.c index 127befe..4a52eda 100644 --- a/move-transition.c +++ b/move-transition.c @@ -2060,8 +2060,9 @@ void sceneitem_start_move(obs_sceneitem_t *item, const char *start_move) move_filter_start(obs_obj_get_data(filter)); } -static void move_start_init(struct move_info *move) +static void move_start_init(struct move_info *move, bool in_graphics) { + move->t = obs_transition_get_time(move->source); if (!move->start_init) return; move->start_init = false; @@ -2076,7 +2077,7 @@ static void move_start_init(struct move_info *move) obs_source_release(old_scene_a); obs_source_release(old_scene_b); - clear_items(move, true); + clear_items(move, in_graphics); move->matched_items = 0; move->transition_pool_move_index = 0; move->transition_pool_in_index = 0; @@ -2489,18 +2490,16 @@ static void move_video_tick(void *data, float seconds) { UNUSED_PARAMETER(seconds); struct move_info *move = data; - move_start_init(move); + move_start_init(move, false); } static void move_video_render(void *data, gs_effect_t *effect) { struct move_info *move = data; - move->t = obs_transition_get_time(move->source); - - move_start_init(move); + move_start_init(move, true); - if (move->t > 0.0f && move->t < 1.0f) { + if (move->t >= 0.0f && move->t < 1.0f) { if (!move->scene_source_a) move->scene_source_a = obs_transition_get_source( move->source, OBS_TRANSITION_SOURCE_A);