Merge branch 'tahoma2d:master' into libdeflate-linker-fix
This commit is contained in:
commit
7c03b12d9a
|
@ -46,8 +46,7 @@ public:
|
|||
};
|
||||
|
||||
public:
|
||||
OnionSkinMask()
|
||||
: m_enabled(false), m_wholeScene(false), m_LightTableStatus(false) {}
|
||||
OnionSkinMask();
|
||||
|
||||
void clear();
|
||||
|
||||
|
@ -87,7 +86,10 @@ public:
|
|||
void enable(bool on) { m_enabled = on; }
|
||||
|
||||
bool isWholeScene() const { return m_wholeScene; }
|
||||
void setIsWholeScene(bool wholeScene) { m_wholeScene = wholeScene; }
|
||||
void setIsWholeScene(bool wholeScene);
|
||||
|
||||
bool isEveryFrame() const { return m_everyFrame; }
|
||||
void setIsEveryFrame(bool everyFrame);
|
||||
|
||||
/*!
|
||||
Returns the fade (transparency) value, in the [0.0, 1.0] range, corresponding to
|
||||
|
@ -142,6 +144,7 @@ private:
|
|||
std::vector<int> m_fos, m_mos; //!< Fixed and Mobile Onion Skin indices
|
||||
bool m_enabled; //!< Whether onion skin is enabled
|
||||
bool m_wholeScene; //!< Whether the OS works on the entire scene
|
||||
bool m_everyFrame; //!< Whether the OS renders every frame or only on new exposures.
|
||||
|
||||
ShiftTraceStatus m_shiftTraceStatus;
|
||||
TAffine m_ghostAff[2];
|
||||
|
|
|
@ -44,6 +44,13 @@ bool OnioniSkinMaskGUI::OnionSkinSwitcher::isWholeScene() const {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
bool OnioniSkinMaskGUI::OnionSkinSwitcher::isEveryFrame() const {
|
||||
OnionSkinMask osm = getMask();
|
||||
return osm.isEveryFrame();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void OnioniSkinMaskGUI::OnionSkinSwitcher::activate() {
|
||||
OnionSkinMask osm = getMask();
|
||||
if (osm.isEnabled() && !osm.isEmpty()) return;
|
||||
|
@ -81,6 +88,22 @@ void OnioniSkinMaskGUI::OnionSkinSwitcher::setSingleLevel() {
|
|||
setMask(osm);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void OnioniSkinMaskGUI::OnionSkinSwitcher::setEveryFrame() {
|
||||
OnionSkinMask osm = getMask();
|
||||
osm.setIsEveryFrame(true);
|
||||
setMask(osm);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
void OnioniSkinMaskGUI::OnionSkinSwitcher::setNewExposure() {
|
||||
OnionSkinMask osm = getMask();
|
||||
osm.setIsEveryFrame(false);
|
||||
setMask(osm);
|
||||
}
|
||||
|
||||
void OnioniSkinMaskGUI::OnionSkinSwitcher::clearFOS() {
|
||||
OnionSkinMask osm = getMask();
|
||||
|
||||
|
@ -125,6 +148,17 @@ void OnioniSkinMaskGUI::addOnionSkinCommand(QMenu *menu, bool isFilmStrip) {
|
|||
menu->connect(extendOnionSkinToScene, SIGNAL(triggered()), &switcher,
|
||||
SLOT(setWholeScene()));
|
||||
}
|
||||
if (!switcher.isEveryFrame()) {
|
||||
QAction *onionSkinEveryFrame =
|
||||
menu->addAction(QString(QObject::tr("Onion Skin On All Frames")));
|
||||
menu->connect(onionSkinEveryFrame, SIGNAL(triggered()), &switcher,
|
||||
SLOT(setEveryFrame()));
|
||||
} else {
|
||||
QAction *onionSkinNewExposure =
|
||||
menu->addAction(QString(QObject::tr("Onion Skin On Drawings")));
|
||||
menu->connect(onionSkinNewExposure, SIGNAL(triggered()), &switcher,
|
||||
SLOT(setNewExposure()));
|
||||
}
|
||||
OnionSkinMask osm = switcher.getMask();
|
||||
if (osm.getFosCount() || osm.getMosCount()) {
|
||||
QAction *clearAllOnionSkins = menu->addAction(
|
||||
|
|
|
@ -33,12 +33,15 @@ public:
|
|||
|
||||
bool isActive() const;
|
||||
bool isWholeScene() const;
|
||||
bool isEveryFrame() const;
|
||||
|
||||
public slots:
|
||||
void activate();
|
||||
void deactivate();
|
||||
void setWholeScene();
|
||||
void setSingleLevel();
|
||||
void setEveryFrame();
|
||||
void setNewExposure();
|
||||
void clearFOS();
|
||||
void clearMOS();
|
||||
void clearOS();
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
// TnzCore includes
|
||||
#include "tfilepath.h"
|
||||
#include "tenv.h"
|
||||
|
||||
// TnzLib includes
|
||||
#include "toonz/txshsimplelevel.h"
|
||||
|
@ -54,6 +55,16 @@ double inline getIncrement(int paperThickness) {
|
|||
// OnionSkinMask implementation
|
||||
//***************************************************************************
|
||||
|
||||
TEnv::IntVar WholeScene("OnionSkinWholeScene", 0);
|
||||
TEnv::IntVar EveryFrame("OnionSkinEveryFrame", 1);
|
||||
|
||||
OnionSkinMask::OnionSkinMask() {
|
||||
m_enabled = false;
|
||||
m_wholeScene = WholeScene;
|
||||
m_everyFrame = EveryFrame;
|
||||
m_LightTableStatus = false;
|
||||
}
|
||||
|
||||
void OnionSkinMask::clear() {
|
||||
m_fos.clear();
|
||||
m_mos.clear();
|
||||
|
@ -155,6 +166,20 @@ bool OnionSkinMask::getMosRange(int &drow0, int &drow1) const {
|
|||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
void OnionSkinMask::setIsWholeScene(bool wholeScene) {
|
||||
m_wholeScene = wholeScene;
|
||||
WholeScene = (int)m_wholeScene;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
void OnionSkinMask::setIsEveryFrame(bool everyFrame) {
|
||||
m_everyFrame = everyFrame;
|
||||
EveryFrame = (int)m_everyFrame;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
double OnionSkinMask::getOnionSkinFade(int rowsDistance) {
|
||||
if (rowsDistance == 0) return 0.9;
|
||||
|
||||
|
|
|
@ -258,7 +258,8 @@ void TSceneProperties::saveData(TOStream &os) const {
|
|||
if (rs.m_colorSpaceGamma >= 1. &&
|
||||
!areAlmostEqual(rs.m_colorSpaceGamma, 2.2))
|
||||
os.child("colorSpaceGamma") << rs.m_colorSpaceGamma;
|
||||
if (i == 1) // preview
|
||||
// Only save syncColorSetting if not the default value
|
||||
if (i == 1 && !out.isColorSettingsSynced()) // preview
|
||||
os.child("syncColorSettings") << (out.isColorSettingsSynced() ? 1 : 0);
|
||||
|
||||
os.child("multimedia") << out.getMultimediaRendering();
|
||||
|
|
|
@ -633,7 +633,7 @@ void StageBuilder::addCellWithOnionSkin(PlayerSet &players, ToonzScene *scene,
|
|||
#ifdef NUOVO_ONION
|
||||
m_onionSkinDistance = rows[i] - row;
|
||||
#else
|
||||
if (!Preferences::instance()->isAnimationSheetEnabled() ||
|
||||
if (m_onionSkinMask.isEveryFrame() ||
|
||||
!alreadyAdded(xsh, row, i, rows, col)) {
|
||||
m_onionSkinDistance = (rows[i] - row) < 0 ? --backPos : ++frontPos;
|
||||
addCell(players, scene, xsh, rows[i], col, level, subSheetColIndex);
|
||||
|
|
Loading…
Reference in a new issue