Skip to content

Commit

Permalink
fix move transition in show and hide transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Aug 4, 2023
1 parent 63cbcfb commit 7b4b115
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion buildspec.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@
}
},
"name": "move-transition",
"version": "2.9.2"
"version": "2.9.3"
}
13 changes: 6 additions & 7 deletions move-transition.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7b4b115

Please sign in to comment.