Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
50a066e
Added basic text animation feature
WileECoder Jul 15, 2022
6286231
Merge branch 'olive-editor:master' into Text-animation
WileECoder Jul 16, 2022
af535b7
Merge branch 'olive-editor:master' into Text-animation
WileECoder Jul 17, 2022
4552266
Fixed a bug in cascaded animations
WileECoder Jul 17, 2022
a2110cf
Restore a change that must not be pushed
WileECoder Jul 17, 2022
1122422
Merge branch 'master' into Text-animation
WileECoder Jul 18, 2022
ba8a7a3
Merge branch 'olive-editor:master' into Text-animation
WileECoder Jul 20, 2022
28ec3a3
Merge branch 'olive-editor:master' into Text-animation
WileECoder Jul 21, 2022
c4e7c2e
Removed "text html only" input to Text node bacause no longer needed.…
WileECoder Jul 23, 2022
8a85484
Merge branch 'olive-editor:master' into Text-animation
WileECoder Jul 31, 2022
f39dee5
Added more flexibility to effects
WileECoder Jul 31, 2022
2ba85d1
Merge branch 'olive-editor:master' into Text-animation
WileECoder Sep 11, 2022
56f09b0
Merge branch 'master' into Text-animation
WileECoder Oct 9, 2022
cbb914d
Merge branch 'olive-editor:master' into Text-animation
WileECoder Oct 11, 2022
afae074
Added tooltip for inputs and improved their names
WileECoder Oct 11, 2022
f50353f
Merge branch 'Text-animation' of https://github.com/WileECoder/olive …
WileECoder Oct 11, 2022
27bfe45
Merge branch 'olive-editor:master' into Text-animation
WileECoder Oct 14, 2022
e3af124
Draw non-animated text when text gizmo is activated
WileECoder Oct 16, 2022
7a32d8c
Removed TextAnimationRenderNode. Animators are now plugged into the text
WileECoder Oct 26, 2022
4a511c4
Merge branch 'Text-animation' of https://github.com/WileECoder/olive …
WileECoder Oct 26, 2022
541e98f
Merge branch 'olive-editor:master' into Text-animation
WileECoder Oct 29, 2022
1f5dc85
Merge branch 'olive-editor:master' into Text-animation
WileECoder Oct 31, 2022
81b2682
Trivial changes
WileECoder Oct 31, 2022
3da1890
Added LastToFirst input
WileECoder Oct 31, 2022
4ebfa59
Merge branch 'olive-editor:master' into Text-animation
WileECoder Nov 7, 2022
cbc777d
Merge branch 'Text-animation' of https://github.com/WileECoder/olive …
WileECoder Nov 7, 2022
c3716b0
Changed policy for "spacing"
WileECoder Nov 7, 2022
5de32b1
Merge branch 'olive-editor:master' into Text-animation
WileECoder Nov 20, 2022
8c512f8
Merge branch 'master' into Text-animation
WileECoder Jul 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/node/factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "generator/text/textv1.h"
#include "generator/text/textv2.h"
#include "generator/text/textv3.h"
#include "generator/animation/textanimationnode.h"
#include "input/multicam/multicamnode.h"
#include "input/time/timeinput.h"
#include "input/value/valuenode.h"
Expand Down Expand Up @@ -249,6 +250,8 @@ Node *NodeFactory::CreateFromFactoryIndex(const NodeFactory::InternalID &id)
return new TextGeneratorV2();
case kTextGeneratorV3:
return new TextGeneratorV3();
case kTextAnimation:
return new TextAnimationNode();
case kCrossDissolveTransition:
return new CrossDissolveTransition();
case kDipToColorTransition:
Expand Down
1 change: 1 addition & 0 deletions app/node/factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class NodeFactory
kTextGeneratorV1,
kTextGeneratorV2,
kTextGeneratorV3,
kTextAnimation,
kCrossDissolveTransition,
kDipToColorTransition,
kMosaicFilter,
Expand Down
1 change: 1 addition & 0 deletions app/node/generator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ add_subdirectory(polygon)
add_subdirectory(shape)
add_subdirectory(solid)
add_subdirectory(text)
add_subdirectory(animation)

set(OLIVE_SOURCES
${OLIVE_SOURCES}
Expand Down
31 changes: 31 additions & 0 deletions app/node/generator/animation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Olive - Non-Linear Video Editor
# Copyright (C) 2022 Olive Team
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

set(OLIVE_SOURCES
${OLIVE_SOURCES}
node/generator/animation/textanimation.h
node/generator/animation/textanimationengine.cpp
node/generator/animation/textanimationengine.h
node/generator/animation/textanimationxmlformatter.cpp
node/generator/animation/textanimationxmlformatter.h
node/generator/animation/textanimationxmlparser.cpp
node/generator/animation/textanimationxmlparser.h
node/generator/animation/textanimationnode.cpp
node/generator/animation/textanimationnode.h
node/generator/animation/textanimationrender.cpp
node/generator/animation/textanimationrender.h
PARENT_SCOPE
)
114 changes: 114 additions & 0 deletions app/node/generator/animation/textanimation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#ifndef ANIMATION_H
#define ANIMATION_H

#include <QMap>

namespace olive {

namespace TextAnimation {

/// The feature of the text that is being animated
enum Feature{
// invalid value
None,
// vertical offset for each character
PositionVertical,
// horizontal offset for each character
PositionHorizontal,
// rotation of each character around its bottom left corner
Rotation,
// space between letters
SpacingFactor,
// vertical stretch of each character
StretchVertical,
// horizontal stretch of each character
StretchHorizontal,
// opacity in range 0 - 255
Transparency
};

const QMap< Feature, QString> FEATURE_TABLE = {{None, "NONE"},
{PositionVertical, "POSITION_VER"},
{PositionHorizontal, "POSITION_HOR"},
{Rotation, "ROTATION"},
{SpacingFactor, "SPACING"},
{StretchVertical, "STRETCH_VER"},
{StretchHorizontal, "STRETCH_HOR"},
{Transparency, "TRANSPARENCY"},
};
const QMap< QString, Feature> FEATURE_TABLE_REV = {{"NONE", None},
{"POSITION_VER", PositionVertical},
{"POSITION_HOR", PositionHorizontal},
{"ROTATION", Rotation},
{"SPACING", SpacingFactor},
{"STRETCH_VER", StretchVertical},
{"STRETCH_HOR", StretchHorizontal},
{"TRANSPARENCY", Transparency}
};

/// shape of animation curve
enum Curve {
Step,
Linear,
Ease_Sine,
Ease_Quad,
Ease_Back,
Ease_Elastic,
Ease_Bounce
};

const QMap< Curve, QString> CURVE_TABLE = {{Step, "STEP"},
{Linear, "LINEAR"},
{Ease_Sine, "EASE_SINE"},
{Ease_Quad, "EASE_QUAD"},
{Ease_Back, "EASE_BACK"},
{Ease_Elastic, "EASE_ELASTIC"},
{Ease_Bounce, "EASE_BOUNCE"}
};

const QMap< QString, Curve> CURVE_TABLE_REV = { { "STEP", Step},
{ "LINEAR", Linear },
{ "EASE_SINE", Ease_Sine },
{ "EASE_QUAD", Ease_Quad },
{ "EASE_BACK", Ease_Back },
{ "EASE_ELASTIC", Ease_Elastic },
{ "EASE_BOUNCE", Ease_Bounce}
};

/// full descriptor of an animation
struct Descriptor {
TextAnimation::Feature feature;
// first character to be animated. Use 0 for the first character
int character_from;
// last character to be animated. Use -1 to indicate the end of the text
int character_to;
// When true, the animation starts from 'character_to' and ends to 'character_from'
bool last_to_first;
// When 0 (or negative), the effect is applied to all characetrs.
// When 1 or more, 'stride' items are skipped for evry one that is applied.
int stride;
// range [0,1]. The lower this value, the more all characters start
// their animation together
double overlap_in;
// range [0,1]. The lower this value, the more all characters end
// their animation together
double overlap_out;
TextAnimation::Curve curve;
// coefficient that modifies the curve. May or may not have effect for each curve.
// Value 1 should always be a good default.
double c1;
// coefficient that modifies the curve. May or may not have effect for each curve.
// Value 1 should always be a good default.
double c2;
// value of the feature at the begin of the transition
double value;
// Evolution of the transition in range [0,1]. When 0, the animated value is equal to 'value';
// When 1, the animated value is equal to 0.
double progress;
};

} // TextAnimation

} // olive

#endif // ANIMATION_H
Loading