Skip to content

Commit

Permalink
- Changed VFX Effects add behavior: Chroma-Key is being added, if non…
Browse files Browse the repository at this point in the history
…e existed already, when applying any of the VFX effects.

- Opacity now adds after Chroma-key, so no more weird unexpected color behavior because of the wrong effects order.
- Changed `Scale` effect to have filtering off by default.
- Some additional FAQ pages.
  • Loading branch information
Zly-u committed May 5, 2024
1 parent ad14a4d commit ee339a1
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Video/VideoAutoFlipper/VP_Presets/Scale.eel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//@param1:p_scale 'Scale' 1 0.01 2 1
//@param2:p_scale_x 'X Scale' 1 0.01 2 1
//@param3:p_scale_y 'Y Scale' 1 0.01 2 1
//@param4:filter 'filter' 1 0 1 0.5 1
//@param4:filter 'filter' 0 0 1 0.5 1

//@param6:p_bg_clr 'green/blue bg' 1 0 1 0.1 1

Expand Down
131 changes: 124 additions & 7 deletions Video/VideoAutoFlipper/Zly_VideoAutoFlipper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ end
--[[===================================================]]--

local GUI = {
version = "1.1",
version = "1.1.2",
name = "Video Auto-Flipper",

timer = 0.0,
Expand Down Expand Up @@ -685,13 +685,19 @@ local VAF = {


AddVFX = function(self, track, name, presset_name, force_add)
local fx_chroma = reaper.TrackFX_GetByName(track, "VAF: Chroma-key", false)
local fx = reaper.TrackFX_GetByName(track, name, false)
local fx_chroma = reaper.TrackFX_GetByName(track, "VAF: Chroma-key", false)
local fx = reaper.TrackFX_GetByName(track, name, false)

if fx == -1 or force_add then
fx = reaper.TrackFX_AddByName(track, "Video processor", 0, fx_chroma ~= -1 and -1000-fx_chroma or 1)
if presset_name ~= "Opacity.eel" then
fx = reaper.TrackFX_AddByName(track, "Video processor", 0, fx_chroma ~= -1 and -1000-fx_chroma or 1)
else
fx = reaper.TrackFX_AddByName(track, "Video processor", 0, fx_chroma ~= -1 and fx_chroma+1 or 1)
end
reaper.TrackFX_SetNamedConfigParm(track, fx, "renamed_name", name)
reaper.TrackFX_SetNamedConfigParm(track, fx, "VIDEO_CODE", self.VP_Presets[presset_name])
end

return fx
end,

Expand Down Expand Up @@ -1056,11 +1062,17 @@ local function Add_fx(name, presset_name, force_add)
end

for i = 0, track_count-1 do
local track = reaper.GetSelectedTrack(0, i)
VAF:AddVFX(
reaper.GetSelectedTrack(0, i),
track,
name, presset_name,
force_add
)

-- Finilizing with Chroma-key
if presset_name ~= "Opacity.eel" then
local _ = VAF:AddVFX(track, "VAF: Chroma-key", "Chroma.eel")
end
end
end

Expand Down Expand Up @@ -1422,7 +1434,52 @@ function GUI:TAB_FAQ()

if ImGui.BeginChild(self.ctx, "AI", 0, 0, child_flags, window_flags) then
local max_line_len = 36


if ImGui.CollapsingHeader(self.ctx, "What is this for?") then
ImGui.Text(self.ctx,
TextWrapper(
"This script is for SIMPLE video editing in Reaper with easy functionality and relatively flexible capabilities.",
max_line_len,
true
)
)
ImGui.Text(self.ctx,
TextWrapper(
"This script is NOT a replacement for any already existing video editing programs. It's made solely just for myself and for people who want to quickly sketch/make something simple out right away in Reaper.",
max_line_len,
true
)
)
ImGui.Text(self.ctx,
TextWrapper(
"This script, with its techniques, will take a bit of getting used to for sure, but once you do then it will become a nice little tool for simple presentable stuff, in my opinion.",
max_line_len,
true
)
)
end

----------------------------------------------------------------------------------------------------------------

if ImGui.CollapsingHeader(self.ctx, "Why does this exist?") then
ImGui.Text(self.ctx,
TextWrapper(
"As a proof of concept, made it for fun and mostly for myself.",
max_line_len,
true
)
)
ImGui.Text(self.ctx,
TextWrapper(
"I tried my best to make it as intuitive as possible, UI/UX is hard.",
max_line_len,
true
)
)
end

----------------------------------------------------------------------------------------------------------------

if ImGui.CollapsingHeader(self.ctx, "Why Chroma Key thing?") then
ImGui.Text(self.ctx,
TextWrapper(
Expand Down Expand Up @@ -1459,11 +1516,71 @@ function GUI:TAB_FAQ()
true
)
)
ImGui.Text(self.ctx,
TextWrapper(
"This is the only way I figured how to do effects compositing on top of each other with relative ease...",
max_line_len,
true
)
)
end

----------------------------------------------------------------------------------------------------------------

if ImGui.CollapsingHeader(self.ctx, "Opacity makes the image blue.") then
ImGui.Text(self.ctx,
TextWrapper(
"You need to use the Opacity effect AFTER Chroma-key in order for it to work correctly.",
max_line_len,
true
)
)
ImGui.Text(self.ctx,
TextWrapper(
"I tried to automate this effect's placement so there are potentially less confusions to happen.",
max_line_len,
true
)
)
end

----------------------------------------------------------------------------------------------------------------

if ImGui.CollapsingHeader(self.ctx, "Blue/Green border appears.") then
ImGui.Text(self.ctx,
TextWrapper(
"It's essentailly a Chroma-key's keying error, happens when the edges of the videos getting smoothed.",

max_line_len,
true
)
)
ImGui.Text(self.ctx,
TextWrapper(
"You can get rid of it by disabling flitering in some of the effects.",
max_line_len,
true
)
)
ImGui.Text(self.ctx,
TextWrapper(
"You can try to tweak the Chroma-Key to make it work in such scenarios, I couldn't figure it out myself.",
max_line_len,
true
)
)
ImGui.Text(self.ctx,
TextWrapper(
"And if you do figure it out then Please tell me about your settings, or a better way of utilising Chroma-key, I will add those changes into this script's presets.",
max_line_len,
true
)
)
end

----------------------------------------------------------------------------------------------------------------

if ImGui.CollapsingHeader(self.ctx, "VFX: Chroma Key interfere?") then
if ImGui.CollapsingHeader(self.ctx, "VFX: Will Chroma Key interfere?") then
ImGui.Text(self.ctx,
TextWrapper(
"Every VFX that you add will be added before existing Chroma Key, so you don't have to do that manually.",
Expand Down
10 changes: 6 additions & 4 deletions Video/meta_VideoAutoFlipper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@metapackage
@description Video Auto-Flipper [YTPMV]
@author Zly
@version 1.1.1
@version 1.1.2
@provides
[main] .\VideoAutoFlipper\Zly_VideoAutoFlipper.lua
.\VideoAutoFlipper\images\*.png
Expand All @@ -19,9 +19,11 @@
- Has additional settings for the flipping.
- Flips preview in the GUI.
- Has a tab for VFX chains for ease of making simple but yet presentable and easilty animatable visuals in Reaper.
- Has a tab for Helper functions.
- Has a tab for Helper functions to assist with video animation and such.
- Has some brief FAQ page, just in case.
@changelog
- Adapted `ImGui.BeginChild` to new version of ReaImGui to prevent crashes.
- Made it so Flip Envelopes stretch to the start of the next items now, so potentially making it more practical for editing.
- Changed VFX Effects add behavior: Chroma-Key is being added, if none existed already, when applying any of the VFX effects.
- Opacity now adds after Chroma-key, so no more weird unexpected color behavior because of the wrong effects order.
- Changed `Scale` effect to have filtering off by default.
- Some additional FAQ pages.
--]]

0 comments on commit ee339a1

Please sign in to comment.