Skip to content

Commit

Permalink
Merge branch 'main' into markers_ui
Browse files Browse the repository at this point in the history
  • Loading branch information
rodlie committed Nov 25, 2024
2 parents d04a2de + 4c1371a commit 6013121
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 22 deletions.
3 changes: 2 additions & 1 deletion src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ include(friction-ffmpeg)
add_definitions(-DPROJECT_VERSION="${PROJECT_VERSION}")

if(${LINUX_DEPLOY})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
endif()

option(USE_SKIA_SYSTEM_LIBS "Use skia (third-party) system libraries on Linux" ON)
Expand Down
6 changes: 3 additions & 3 deletions src/app/GUI/extraactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void MainWindow::setupMenuExtras()
}
// add in
{
const auto act = menu->addAction(QIcon::fromTheme("pivot-align-left"),
const auto act = menu->addAction(QIcon::fromTheme("range-in"),
tr("In at ..."));
act->setData("cmd:in");
act->setToolTip(QString("<p><b>%1</b> %2 <i>%3</i></p>").arg(tr("Frame In"),
Expand All @@ -94,7 +94,7 @@ void MainWindow::setupMenuExtras()
}
// add out
{
const auto act = menu->addAction(QIcon::fromTheme("pivot-align-right"),
const auto act = menu->addAction(QIcon::fromTheme("range-out"),
tr("Out at ..."));
act->setData("cmd:out");
act->setToolTip(QString("<p><b>%1</b> %2 <i>%3</i></p>").arg(tr("Frame Out"),
Expand Down Expand Up @@ -126,7 +126,7 @@ void MainWindow::setupMenuExtras()
cmdAddAction(act);
}
{
const auto act = menu->addAction(QIcon::fromTheme("trash"/* TODO: find new (blender) icon! */),
const auto act = menu->addAction(QIcon::fromTheme("range-clear"),
tr("Clear In/Out"));
connect(act, &QAction::triggered,
this, [this](){
Expand Down
10 changes: 5 additions & 5 deletions src/app/GUI/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1126,27 +1126,27 @@ void MainWindow::setupMenuScene()
cmdAddAction(mAddToQueAct);

mSceneMenu->addSeparator();
mSceneMenu->addAction(QIcon::fromTheme("sequence"),
mSceneMenu->addAction(QIcon::fromTheme("range-in"),
tr("Set In"), this, [this]() {
const auto scene = *mDocument.fActiveScene;
if (!scene) { return; }
scene->setFrameIn(true, scene->getCurrentFrame());
});
mSceneMenu->addAction(QIcon::fromTheme("sequence"),
mSceneMenu->addAction(QIcon::fromTheme("range-out"),
tr("Set Out"), this, [this]() {
const auto scene = *mDocument.fActiveScene;
if (!scene) { return; }
scene->setFrameOut(true, scene->getCurrentFrame());
});
mSceneMenu->addAction(QIcon::fromTheme("sequence"),
mSceneMenu->addAction(QIcon::fromTheme("range-clear"),
tr("Clear In/Out"), this, [this]() {
const auto scene = *mDocument.fActiveScene;
if (!scene) { return; }
scene->setFrameIn(false, 0);
scene->setFrameOut(false, 0);
});
mSceneMenu->addSeparator();
mSceneMenu->addAction(QIcon::fromTheme("dialog-information"),
mSceneMenu->addAction(QIcon::fromTheme("markers-add"),
tr("Add Marker"), this, [this]() {
const auto scene = *mDocument.fActiveScene;
if (!scene) { return; }
Expand All @@ -1158,7 +1158,7 @@ void MainWindow::setupMenuScene()
if (!scene) { return; }
scene->clearMarkers();
});
mSceneMenu->addAction(QIcon::fromTheme("dialog-information"),
mSceneMenu->addAction(QIcon::fromTheme("markers-edit"),
tr("Edit Markers"), this, [this]() {
openMarkerEditor();
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/icons
Submodule icons updated 129 files
11 changes: 11 additions & 0 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ void setDefaultFormat()
//format.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
//format.setSwapInterval(0); // Disable vertical refresh syncing
QSurfaceFormat::setDefaultFormat(format);

const QString oVersion = QString("%1.%2").arg(QString::number(QSurfaceFormat::defaultFormat().version().first),
QString::number(QSurfaceFormat::defaultFormat().version().second));
const auto oDepth = QSurfaceFormat::defaultFormat().depthBufferSize();
const auto oStencil = QSurfaceFormat::defaultFormat().stencilBufferSize();
const auto oSamples = QSurfaceFormat::defaultFormat().samples();
qWarning() << "OpenGL Format:"
<< "version" << oVersion.toDouble()
<< "depth" << oDepth
<< "stencil" << oStencil
<< "samples" << oSamples;
}

void generateAlphaMesh(QPixmap& alphaMesh,
Expand Down
4 changes: 4 additions & 0 deletions src/core/Animators/staticcomplexanimator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ void StaticComplexAnimator::prp_readProperty_impl(eReadStream &src)
{
const auto& children = ca_getChildren();
const auto SVGProperties = QStringList() << "begin event" << "end event";
const bool isSubPathEffect = prp_getName() == "sub-path effect";

for (const auto& prop : children) {
if (src.evFileVersion() < EvFormat::svgBeginEnd &&
SVGProperties.contains(prop->prp_getName())) { continue; }
if (src.evFileVersion() < EvFormat::subPathOffset &&
isSubPathEffect && prop->prp_getName() == "offset") { continue; }
prop->prp_readProperty(src);
}
}
Expand Down
11 changes: 9 additions & 2 deletions src/core/PathEffects/subpatheffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ SubPathEffect::SubPathEffect() :
mMax->setValueRange(-999, 999);
mMax->setCurrentBaseValue(100);

mOffset = enve::make_shared<QrealAnimator>("offset");
mOffset->setValueRange(-999, 999);
mOffset->setCurrentBaseValue(0);

ca_addChild(mPathWise);
ca_addChild(mMin);
ca_addChild(mMax);
ca_addChild(mOffset);
}

class SubPathEffectCaller : public PathEffectCaller {
Expand Down Expand Up @@ -121,7 +126,9 @@ void SubPathEffectCaller::apply(SkPath &path) {
stdsptr<PathEffectCaller> SubPathEffect::getEffectCaller(
const qreal relFrame, const qreal influence) const {
const bool pathWise = mPathWise->getValue();
const qreal minFrac = mMin->getEffectiveValue(relFrame)*0.01*influence;
const qreal maxFrac = mMax->getEffectiveValue(relFrame)*0.01*influence + 1 - influence;
const qreal offset = mOffset->getEffectiveValue(relFrame);
const qreal minFrac = (mMin->getEffectiveValue(relFrame) + offset) * 0.01 * influence;
const qreal maxFrac = (mMax->getEffectiveValue(relFrame) + offset) * 0.01 * influence + 1 - influence;

return enve::make_shared<SubPathEffectCaller>(pathWise, minFrac, maxFrac);
}
1 change: 1 addition & 0 deletions src/core/PathEffects/subpatheffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class CORE_EXPORT SubPathEffect : public PathEffect {
qsptr<BoolProperty> mPathWise;
qsptr<QrealAnimator> mMin;
qsptr<QrealAnimator> mMax;
qsptr<QrealAnimator> mOffset;
};

#endif // SUBPATHEFFECT_H
1 change: 1 addition & 0 deletions src/core/ReadWrite/evformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ namespace EvFormat {
svgBeginEnd = 29,
formatOptions = 30,
formatOptions2 = 31,
subPathOffset = 32,

nextVersion
};
Expand Down
3 changes: 2 additions & 1 deletion src/scripts/build_vfxplatform_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ echo "[Paths]" > ${BUILD}/${FRICTION_PKG}/opt/friction/bin/qt.conf
echo "Prefix = .." >> ${BUILD}/${FRICTION_PKG}/opt/friction/bin/qt.conf
echo "Plugins = plugins" >> ${BUILD}/${FRICTION_PKG}/opt/friction/bin/qt.conf

(cd ${BUILD}/${FRICTION_PKG}/opt/friction/bin ; patchelf --set-rpath '$ORIGIN/../lib' friction)
#(cd ${BUILD}/${FRICTION_PKG}/opt/friction/bin ; patchelf --set-rpath '$ORIGIN/../lib' friction)

(cd ${BUILD}/${FRICTION_PKG}/opt/friction/lib ;
for so in *.so*; do
patchelf --set-rpath '$ORIGIN' ${so}
Expand Down
11 changes: 7 additions & 4 deletions src/scripts/git-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,18 @@ DATE=`date +%Y%m%d%H%M`
URL=https://github.com/friction2d
BACKUP_DIR=${DIR}/friction-git-backup-${DATE}
REPOS="
friction-icon-theme
friction
friction2d.github.io
skia
gperftools
sfntly
friction2d.github.io
friction-shader-plugins
friction-sdk
mxe
friction-svgo
friction-unit-tests
gperftools
friction-examples
friction-icon-theme
sfntly
"

mkdir -p ${BACKUP_DIR}
Expand Down
2 changes: 2 additions & 0 deletions src/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ set(
dialogs/adjustscenedialog.cpp
dialogs/applyexpressiondialog.cpp
dialogs/commandpalette.cpp
dialogs/dialog.cpp
dialogs/durationrectsettingsdialog.cpp
dialogs/exportsvgdialog.cpp
dialogs/markereditordialog.cpp
Expand Down Expand Up @@ -116,6 +117,7 @@ set(
dialogs/adjustscenedialog.h
dialogs/applyexpressiondialog.h
dialogs/commandpalette.h
dialogs/dialog.h
dialogs/durationrectsettingsdialog.h
dialogs/exportsvgdialog.h
dialogs/markereditordialog.h
Expand Down
34 changes: 34 additions & 0 deletions src/ui/dialogs/dialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
#
# Friction - https://friction.graphics
#
# Copyright (c) Ole-André Rodlie and contributors
#
# 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/>.
#
# See 'README.md' for more information.
#
*/

#include "dialog.h"

using namespace Friction::Ui;

Dialog::Dialog(QWidget *parent)
: QDialog(parent)
{
#ifdef Q_OS_MAC
setWindowFlag(Qt::Tool);
#endif
}
44 changes: 44 additions & 0 deletions src/ui/dialogs/dialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
#
# Friction - https://friction.graphics
#
# Copyright (c) Ole-André Rodlie and contributors
#
# 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/>.
#
# See 'README.md' for more information.
#
*/

#ifndef DIALOG_H
#define DIALOG_H

#include "ui_global.h"

#include <QDialog>

namespace Friction
{
namespace Ui
{
class UI_EXPORT Dialog : public QDialog
{
Q_OBJECT
public:
explicit Dialog(QWidget *parent = nullptr);
};
}
}

#endif // DIALOG_H
10 changes: 5 additions & 5 deletions src/ui/widgets/framescrollbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,17 +341,17 @@ void FrameScrollBar::mousePressEvent(QMouseEvent *event)

bool hasMarker = mCurrentCanvas ? mCurrentCanvas->hasMarker(mCurrentCanvas->getCurrentFrame()) : false;

const auto setFrameInAct = new QAction(QIcon::fromTheme("sequence"),
const auto setFrameInAct = new QAction(QIcon::fromTheme("range-in"),
tr("Set In"), this);
const auto setFrameOutAct = new QAction(QIcon::fromTheme("sequence"),
const auto setFrameOutAct = new QAction(QIcon::fromTheme("range-out"),
tr("Set Out"), this);
const auto clearFrameOutAct = new QAction(QIcon::fromTheme("trash"),
const auto clearFrameOutAct = new QAction(QIcon::fromTheme("range-clear"),
tr("Clear In/Out"), this);
const auto setMarkerAct = new QAction(QIcon::fromTheme("dialog-information"),
const auto setMarkerAct = new QAction(QIcon::fromTheme("markers-add"),
tr(hasMarker ? "Remove Marker" : "Add Marker"), this);
const auto clearMarkersAct = new QAction(QIcon::fromTheme("trash"),
tr("Clear Markers"), this);
const auto openMarkerEditorAct = new QAction(QIcon::fromTheme("dialog-information"),
const auto openMarkerEditorAct = new QAction(QIcon::fromTheme("markers-edit"),
tr("Edit Markers"), this);
const auto splitDurationAct = new QAction(QIcon::fromTheme("cut"),
tr("Split Clip"), this);
Expand Down

0 comments on commit 6013121

Please sign in to comment.