Refactor of effect handling, to allow effects to be applied BEFORE or AFTER a clip's keyframes are applied. For example, this allows for a mask to apply after an animation/movement is applied to the clip image, like an animated scrolling credits to be masked/faded in a static location.

This commit is contained in:
Jonathan Thomas
2023-05-24 17:12:15 -05:00
parent e91bd82727
commit 26c18fd76c
8 changed files with 92 additions and 62 deletions

View File

@@ -30,7 +30,6 @@ void EffectBase::InitEffectInfo()
End(0.0);
Order(0);
ParentClip(NULL);
parentEffect = NULL;
info.has_video = false;
@@ -39,6 +38,7 @@ void EffectBase::InitEffectInfo()
info.name = "";
info.description = "";
info.parent_effect_id = "";
info.apply_before_clip = true;
}
// Display file information
@@ -51,6 +51,8 @@ void EffectBase::DisplayInfo(std::ostream* out) {
*out << "--> Description: " << info.description << std::endl;
*out << "--> Has Video: " << info.has_video << std::endl;
*out << "--> Has Audio: " << info.has_audio << std::endl;
*out << "--> Apply Before Clip Keyframes: " << info.apply_before_clip << std::endl;
*out << "--> Order: " << order << std::endl;
*out << "----------------------------" << std::endl;
}
@@ -85,6 +87,7 @@ Json::Value EffectBase::JsonValue() const {
root["has_video"] = info.has_video;
root["has_audio"] = info.has_audio;
root["has_tracked_object"] = info.has_tracked_object;
root["apply_before_clip"] = info.apply_before_clip;
root["order"] = Order();
// return JsonValue
@@ -145,6 +148,9 @@ void EffectBase::SetJsonValue(const Json::Value root) {
if (!my_root["order"].isNull())
Order(my_root["order"].asInt());
if (!my_root["apply_before_clip"].isNull())
info.apply_before_clip = my_root["apply_before_clip"].asBool();
if (!my_root["parent_effect_id"].isNull()){
info.parent_effect_id = my_root["parent_effect_id"].asString();
if (info.parent_effect_id.size() > 0 && info.parent_effect_id != "" && parentEffect == NULL)