&srcRas, double blur, int dx,
r1->lock();
fbuffer = (BlurPixel *)r1->getRawData(); // new CASM_FPIXEL [llx *ly];
row1 = new T[llx + 2 * brad];
- col1 = new BlurPixel
[lly + 2 * brad];
+ col1 = new BlurPixel
[ lly + 2 * brad ];
col2 = new T[lly];
}
diff --git a/toonz/sources/common/tunit/tunit.cpp b/toonz/sources/common/tunit/tunit.cpp
index 2d38202..1d6063e 100644
--- a/toonz/sources/common/tunit/tunit.cpp
+++ b/toonz/sources/common/tunit/tunit.cpp
@@ -347,14 +347,15 @@ TMeasureManager::TMeasureManager() {
m->add(cameraYFld.clone());
add(m);
- const double stage_inch = 53.33333; // Consider changing to 120 or 160
+ const double stage_inch = 53.33333;
+ const double stage_standardDpi = 120;
TUnit fxLength(L"fxLength"),
fxInch(L"in", new TSimpleUnitConverter(1 / stage_inch)),
fxCm(L"cm", new TSimpleUnitConverter(2.54 / stage_inch)),
fxMm(L"mm", new TSimpleUnitConverter(25.4 / stage_inch)),
fxXfld(L"fld", new TSimpleUnitConverter(2 / stage_inch)),
- fxPx(L"px", new TSimpleUnitConverter(1));
+ fxPx(L"px", new TSimpleUnitConverter(stage_standardDpi / stage_inch));
fxInch.addExtension(L"inch");
fxInch.addExtension(L"\"");
fxInch.addExtension(L"''");
diff --git a/toonz/sources/common/twain/twain.h b/toonz/sources/common/twain/twain.h
index fc05afc..c7dee17 100644
--- a/toonz/sources/common/twain/twain.h
+++ b/toonz/sources/common/twain/twain.h
@@ -1483,23 +1483,15 @@ typedef struct {
0x0203 /* TW_UINT32 handle to WAV, (AIFF Mac) Added 1.8 */
/* misplaced */
-#define DAT_ICCPROFILE \
- 0x0401 /* TW_MEMORY Added 1.91 This Data Argument is misplaced but \ \ \ \
- \ \
- belongs to the DG_IMAGE Data Group */
-#define DAT_IMAGEMEMFILEXFER \
- 0x0402 /* TW_IMAGEMEMXFER Added 1.91 This Data Argument is misplaced but \
- \ \
- \ \ \
- \ \ \ \
- \ \ \ \ \
- belongs to the DG_IMAGE Data Group */
-#define DAT_ENTRYPOINT \
- 0x0403 /* TW_ENTRYPOINT Added 2.0 This Data Argument is misplaced but \ \
- \ \
- \ \ \
- \ \ \ \
- belongs to the DG_CONTROL Data Group */
+/* TW_MEMORY Added 1.91 This Data Argument is misplaced but belongs to the
+ * DG_IMAGE Data Group */
+#define DAT_ICCPROFILE 0x0401
+/* TW_IMAGEMEMXFER Added 1.91 This Data Argument is misplaced but belongs to
+ * the DG_IMAGE Data Group */
+#define DAT_IMAGEMEMFILEXFER 0x0402
+/* TW_ENTRYPOINT Added 2.0 This Data Argument is misplaced but belongs to
+ * the DG_CONTROL Data Group */
+#define DAT_ENTRYPOINT 0x0403
/****************************************************************************
* Messages *
diff --git a/toonz/sources/include/tfx.h b/toonz/sources/include/tfx.h
index fe2b81b..c26028b 100644
--- a/toonz/sources/include/tfx.h
+++ b/toonz/sources/include/tfx.h
@@ -539,7 +539,6 @@ inline std::string TFx::getFxType() const { return getDeclaration()->getId(); }
//-------------------------------------------------------------------
#define FX_DECLARATION(T) \
- \
public: \
const TPersistDeclaration *getDeclaration() const override;
diff --git a/toonz/sources/include/toonz/preferences.h b/toonz/sources/include/toonz/preferences.h
index 4a1c251..968fe06 100644
--- a/toonz/sources/include/toonz/preferences.h
+++ b/toonz/sources/include/toonz/preferences.h
@@ -360,7 +360,8 @@ public:
frontOnionColor = m_frontOnionColor, backOnionColor = m_backOnionColor,
inksOnly = m_inksOnly;
}
-
+ bool getOnionSkinDuringPlayback() { return m_onionSkinDuringPlayback; }
+ void setOnionSkinDuringPlayback(bool on);
// Transparency Check tab
void setTranspCheckData(const TPixel &bg, const TPixel &ink,
@@ -457,7 +458,7 @@ private:
m_levelsBackupEnabled, m_minimizeSaveboxAfterEditing,
m_sceneNumberingEnabled, m_animationSheetEnabled, m_inksOnly;
bool m_fillOnlySavebox, m_show0ThickLines, m_regionAntialias;
-
+ bool m_onionSkinDuringPlayback;
TPixel32 m_viewerBGColor, m_previewBGColor, m_chessboardColor1,
m_chessboardColor2;
bool m_showRasterImagesDarkenBlendedInViewer,
diff --git a/toonz/sources/include/toonz/stage.h b/toonz/sources/include/toonz/stage.h
index af6f99e..c490aa8 100644
--- a/toonz/sources/include/toonz/stage.h
+++ b/toonz/sources/include/toonz/stage.h
@@ -43,7 +43,7 @@ namespace Stage {
//=============================================================================
DVVAR extern const double inch;
-DVVAR extern const double vectorDpi;
+DVVAR extern const double standardDpi;
class Visitor;
struct VisitArgs;
diff --git a/toonz/sources/include/toonz/tcamera.h b/toonz/sources/include/toonz/tcamera.h
index 3bf62b7..a713606 100644
--- a/toonz/sources/include/toonz/tcamera.h
+++ b/toonz/sources/include/toonz/tcamera.h
@@ -42,6 +42,9 @@ Constructs TCamera with default value, size (12,9) and resolution (768,576).
Constructs TCamera with default value, size (36, 20.25) and resolution
(1920,1080).
- 05/31/16
+Constructs TCamera with default value, size (16, 9) and resolution
+(1920,1080).
+- 08/16/16
*/
TCamera();
diff --git a/toonz/sources/include/toonz/tscenehandle.h b/toonz/sources/include/toonz/tscenehandle.h
index fab6259..bc8ded5 100644
--- a/toonz/sources/include/toonz/tscenehandle.h
+++ b/toonz/sources/include/toonz/tscenehandle.h
@@ -54,6 +54,8 @@ public:
void notifyPreferenceChanged() { emit preferenceChanged(); }
+ void notifyPixelUnitSelected(bool on) { emit pixelUnitSelected(on); }
+
void setDirtyFlag(bool dirtyFlag) {
if (m_dirtyFlag == dirtyFlag) return;
m_dirtyFlag = dirtyFlag;
@@ -75,6 +77,7 @@ signals:
void castFolderAdded(const TFilePath &path);
void nameSceneChanged();
void preferenceChanged();
+ void pixelUnitSelected(bool on);
};
#endif // TSCENEHANDLE_H
diff --git a/toonz/sources/include/toonzqt/lineedit.h b/toonz/sources/include/toonzqt/lineedit.h
index 7351702..88fde3b 100644
--- a/toonz/sources/include/toonzqt/lineedit.h
+++ b/toonz/sources/include/toonzqt/lineedit.h
@@ -49,6 +49,7 @@ protected:
signals:
void focusIn();
+ void returnPressedNow();
};
//-----------------------------------------------------------------------------
diff --git a/toonz/sources/include/tpersist.h b/toonz/sources/include/tpersist.h
index c5b15b8..769c31c 100644
--- a/toonz/sources/include/tpersist.h
+++ b/toonz/sources/include/tpersist.h
@@ -142,10 +142,9 @@ public:
class TPersistDeclarationT
*/
#define PERSIST_DECLARATION(T) \
- \
private: \
static TPersistDeclarationT m_declaration; \
- \
+ \
public: \
const TPersistDeclaration *getDeclaration() const override { \
return &m_declaration; \
diff --git a/toonz/sources/include/trenderresourcemanager.h b/toonz/sources/include/trenderresourcemanager.h
index 559274a..cbb6da7 100644
--- a/toonz/sources/include/trenderresourcemanager.h
+++ b/toonz/sources/include/trenderresourcemanager.h
@@ -132,11 +132,10 @@ static TRenderResourceManagerGenerator* gen();
*/
#define T_RENDER_RESOURCE_MANAGER \
- \
public: \
static TRenderResourceManagerGenerator *gen(); \
static TRenderResourceManagerGenerator *deps(); \
- \
+ \
private:
//--------------------------------------------------------------------------------
diff --git a/toonz/sources/include/tsmartpointer.h b/toonz/sources/include/tsmartpointer.h
index 2cebef1..7f14e23 100644
--- a/toonz/sources/include/tsmartpointer.h
+++ b/toonz/sources/include/tsmartpointer.h
@@ -87,10 +87,9 @@ private:
};
#define DECLARE_CLASS_CODE \
- \
private: \
static const TSmartObject::ClassCode m_classCode; \
- \
+ \
public: \
inline static TINT32 getInstanceCount() { \
return TSmartObject::getInstanceCount(m_classCode); \
diff --git a/toonz/sources/stdfx/stdfx.h b/toonz/sources/stdfx/stdfx.h
index bd0cb0a..d32644d 100644
--- a/toonz/sources/stdfx/stdfx.h
+++ b/toonz/sources/stdfx/stdfx.h
@@ -15,7 +15,6 @@ class PaletteFilterFxRenderData;
static const std::string PLUGIN_PREFIX("STD");
#define FX_PLUGIN_DECLARATION(T) \
- \
public: \
const TPersistDeclaration *getDeclaration() const override;
diff --git a/toonz/sources/toonz/Resources/geometric.svg b/toonz/sources/toonz/Resources/geometric.svg
index b89c6f9..0a427bd 100644
--- a/toonz/sources/toonz/Resources/geometric.svg
+++ b/toonz/sources/toonz/Resources/geometric.svg
@@ -1,63 +1,88 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-]>
-
+
+
+
+
diff --git a/toonz/sources/toonz/Resources/geometric_old.svg b/toonz/sources/toonz/Resources/geometric_old.svg
new file mode 100644
index 0000000..ef86a81
--- /dev/null
+++ b/toonz/sources/toonz/Resources/geometric_old.svg
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
diff --git a/toonz/sources/toonz/Resources/geometric_rollover.svg b/toonz/sources/toonz/Resources/geometric_rollover.svg
index c65e430..256b653 100644
--- a/toonz/sources/toonz/Resources/geometric_rollover.svg
+++ b/toonz/sources/toonz/Resources/geometric_rollover.svg
@@ -1,63 +1,88 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-]>
-
+
+
+
+
diff --git a/toonz/sources/toonz/Resources/geometric_rollover_old.svg b/toonz/sources/toonz/Resources/geometric_rollover_old.svg
new file mode 100644
index 0000000..a7270e2
--- /dev/null
+++ b/toonz/sources/toonz/Resources/geometric_rollover_old.svg
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
diff --git a/toonz/sources/toonz/camerasettingspopup.cpp b/toonz/sources/toonz/camerasettingspopup.cpp
index ec52cd0..75da3d1 100644
--- a/toonz/sources/toonz/camerasettingspopup.cpp
+++ b/toonz/sources/toonz/camerasettingspopup.cpp
@@ -244,7 +244,8 @@ void CameraSettingsPopup::updateFields() {
TCamera *camera = cameraObject->getCamera();
if (Preferences::instance()->getPixelsOnly()) {
TDimension res = camera->getRes();
- camera->setSize(TDimensionD(res.lx / Stage::inch, res.ly / Stage::inch));
+ camera->setSize(
+ TDimensionD(res.lx / Stage::standardDpi, res.ly / Stage::standardDpi));
}
if (camera) m_cameraSettingsWidget->setFields(camera);
}
diff --git a/toonz/sources/toonz/cellselection.cpp b/toonz/sources/toonz/cellselection.cpp
index 6774dcf..b73a4d4 100644
--- a/toonz/sources/toonz/cellselection.cpp
+++ b/toonz/sources/toonz/cellselection.cpp
@@ -15,6 +15,7 @@
// TnzTools includes
#include "tools/toolutils.h"
+#include "tools/toolhandle.h"
// TnzQt includes
#include "toonzqt/strokesdata.h"
@@ -44,6 +45,7 @@
#include "toonz/toonzimageutils.h"
#include "toonz/trasterimageutils.h"
#include "toonz/levelset.h"
+#include "toonz/tstageobjecttree.h"
// TnzCore includes
#include "timagecache.h"
@@ -1030,6 +1032,94 @@ public:
};
//-----------------------------------------------------------------------------
+// if at least one of the cell in the range, return false
+bool checkIfCellsHaveTheSameContent(int &r0, int &c0, int &r1, int &c1,
+ TXshCell &cell) {
+ TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
+ for (int c = c0; c <= c1; c++) {
+ for (int r = r0; r <= r1; r++) {
+ if (cell != xsh->getCell(r, c)) return false;
+ }
+ }
+ return true;
+}
+
+void renameCellsWithoutUndo(int &r0, int &c0, int &r1, int &c1,
+ const TXshCell &cell) {
+ TApp *app = TApp::instance();
+ TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
+ for (int c = c0; c <= c1; c++) {
+ for (int r = r0; r <= r1; r++) {
+ xsh->setCell(r, c, TXshCell(cell));
+ }
+ }
+ app->getCurrentXsheet()->notifyXsheetChanged();
+ int currentFrame = app->getCurrentFrame()->getFrame();
+ if (r0 <= currentFrame && currentFrame <= r1) {
+ app->getCurrentTool()->onImageChanged(
+ (TImage::Type)app->getCurrentImageType());
+ xsh->getStageObjectTree()->invalidateAll();
+ }
+}
+
+class RenameCellsUndo final : public TUndo {
+ TCellSelection *m_selection;
+ QMimeData *m_data;
+ TXshCell m_cell;
+
+public:
+ RenameCellsUndo(TCellSelection *selection, QMimeData *data, TXshCell &cell)
+ : m_data(data), m_cell(cell) {
+ int r0, c0, r1, c1;
+ selection->getSelectedCells(r0, c0, r1, c1);
+ m_selection = new TCellSelection();
+ m_selection->selectCells(r0, c0, r1, c1);
+ }
+
+ ~RenameCellsUndo() {
+ delete m_selection;
+ delete m_data;
+ }
+
+ void undo() const override {
+ int r0, c0, r1, c1;
+ m_selection->getSelectedCells(r0, c0, r1, c1);
+ TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
+ for (int c = c0; c <= c1; c++) {
+ xsh->clearCells(r0, c, r1 - r0 + 1);
+ }
+ const TCellData *cellData = dynamic_cast(m_data);
+ pasteCellsWithoutUndo(cellData, r0, c0, r1, c1, false, false);
+ TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
+ }
+
+ void redo() const override {
+ int r0, c0, r1, c1;
+ m_selection->getSelectedCells(r0, c0, r1, c1);
+ renameCellsWithoutUndo(r0, c0, r1, c1, m_cell);
+ }
+
+ int getSize() const override { return sizeof(*this); }
+
+ QString getHistoryString() override {
+ int r0, c0, r1, c1;
+ m_selection->getSelectedCells(r0, c0, r1, c1);
+ QString colRange = QString::number(c0 + 1);
+ if (c0 != c1)
+ colRange.append(QString(" - %1").arg(QString::number(c1 + 1)));
+ QString frameRange = QString::number(r0 + 1);
+ if (r0 != r1)
+ frameRange.append(QString(" - %1").arg(QString::number(r1 + 1)));
+
+ return QObject::tr("Rename Cell at Column %1 Frame %2")
+ .arg(colRange)
+ .arg(frameRange);
+ }
+
+ int getHistoryType() override { return HistoryType::Xsheet; }
+};
+
+//-----------------------------------------------------------------------------
} // namespace
//-----------------------------------------------------------------------------
@@ -1467,10 +1557,12 @@ void TCellSelection::pasteCells() {
void TCellSelection::deleteCells() {
if (isEmpty()) return;
- TCellData *data = new TCellData();
- TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
int r0, c0, r1, c1;
getSelectedCells(r0, c0, r1, c1);
+ TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
+ // if all the selected cells are already empty, then do nothing
+ if (xsh->isRectEmpty(r0, c0, r1, c1)) return;
+ TCellData *data = new TCellData();
data->setCells(xsh, r0, c0, r1, c1);
DeleteCellsUndo *undo =
new DeleteCellsUndo(new TCellSelection(m_range), data);
@@ -1942,3 +2034,21 @@ void TCellSelection::overWritePasteCells() {
}
//-----------------------------------------------------------------------------
+// called from RenameCellField::RenameCell
+
+void TCellSelection::renameCells(TXshCell &cell) {
+ if (isEmpty()) return;
+ int r0, c0, r1, c1;
+ getSelectedCells(r0, c0, r1, c1);
+ // register undo only if the cell is modified
+ if (checkIfCellsHaveTheSameContent(r0, c0, r1, c1, cell)) return;
+ TCellData *data = new TCellData();
+ TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
+ data->setCells(xsh, r0, c0, r1, c1);
+ RenameCellsUndo *undo = new RenameCellsUndo(this, data, cell);
+ undo->redo();
+
+ TUndoManager::manager()->add(undo);
+}
+
+//-----------------------------------------------------------------------------
diff --git a/toonz/sources/toonz/cellselection.h b/toonz/sources/toonz/cellselection.h
index c410344..9b9091d 100644
--- a/toonz/sources/toonz/cellselection.h
+++ b/toonz/sources/toonz/cellselection.h
@@ -8,6 +8,7 @@
#include
class TimeStretchPopup;
+class TXshCell;
//=============================================================================
// TCellSelection
@@ -97,6 +98,8 @@ public:
void reframe2Cells() { reframeCells(2); }
void reframe3Cells() { reframeCells(3); }
void reframe4Cells() { reframeCells(4); }
+
+ void renameCells(TXshCell &cell);
};
#endif // TCELLSELECTION_H
diff --git a/toonz/sources/toonz/comboviewerpane.cpp b/toonz/sources/toonz/comboviewerpane.cpp
index 65668d0..6a10ad9 100644
--- a/toonz/sources/toonz/comboviewerpane.cpp
+++ b/toonz/sources/toonz/comboviewerpane.cpp
@@ -180,6 +180,8 @@ ComboViewerPanel::ComboViewerPanel(QWidget *parent, Qt::WFlags flags)
ret = ret &&
connect(m_flipConsole, SIGNAL(playStateChanged(bool)),
TApp::instance()->getCurrentFrame(), SLOT(setPlaying(bool)));
+ ret = ret && connect(m_flipConsole, SIGNAL(playStateChanged(bool)), this,
+ SLOT(onPlayingStatusChanged(bool)));
ret = ret &&
connect(m_flipConsole, SIGNAL(buttonPressed(FlipConsole::EGadget)),
m_sceneViewer, SLOT(onButtonPressed(FlipConsole::EGadget)));
@@ -574,6 +576,28 @@ void ComboViewerPanel::onXshLevelSwitched(TXshLevel *) {
//-----------------------------------------------------------------------------
+void ComboViewerPanel::onPlayingStatusChanged(bool playing) {
+ if (Preferences::instance()->getOnionSkinDuringPlayback()) return;
+ OnionSkinMask osm =
+ TApp::instance()->getCurrentOnionSkin()->getOnionSkinMask();
+ if (playing) {
+ m_onionSkinActive = osm.isEnabled();
+ if (m_onionSkinActive) {
+ osm.enable(false);
+ TApp::instance()->getCurrentOnionSkin()->setOnionSkinMask(osm);
+ TApp::instance()->getCurrentOnionSkin()->notifyOnionSkinMaskChanged();
+ }
+ } else {
+ if (m_onionSkinActive) {
+ osm.enable(true);
+ TApp::instance()->getCurrentOnionSkin()->setOnionSkinMask(osm);
+ TApp::instance()->getCurrentOnionSkin()->notifyOnionSkinMaskChanged();
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
+
void ComboViewerPanel::changeWindowTitle() {
TApp *app = TApp::instance();
ToonzScene *scene = app->getCurrentScene()->getScene();
diff --git a/toonz/sources/toonz/comboviewerpane.h b/toonz/sources/toonz/comboviewerpane.h
index c49f00e..8f935ca 100644
--- a/toonz/sources/toonz/comboviewerpane.h
+++ b/toonz/sources/toonz/comboviewerpane.h
@@ -50,6 +50,7 @@ class ComboViewerPanel final : public TPanel, public FlipConsoleOwner {
Ruler *m_vRuler;
Ruler *m_hRuler;
bool m_visibleFlag[CVPARTS_COUNT];
+ bool m_onionSkinActive = false;
TPanelTitleBarButton *m_previewButton;
TPanelTitleBarButton *m_subcameraPreviewButton;
@@ -103,7 +104,7 @@ public slots:
void changeWindowTitle();
void updateFrameRange();
void onXshLevelSwitched(TXshLevel *);
-
+ void onPlayingStatusChanged(bool playing);
// for showing/hiding the parts
void onShowHideActionTriggered(QAction *);
void enableFlipConsoleForCamerastand(bool on);
diff --git a/toonz/sources/toonz/filebrowserpopup.cpp b/toonz/sources/toonz/filebrowserpopup.cpp
index 4064a89..8bbda39 100644
--- a/toonz/sources/toonz/filebrowserpopup.cpp
+++ b/toonz/sources/toonz/filebrowserpopup.cpp
@@ -407,7 +407,10 @@ TFilePath GenericLoadFilePopup::getPath() {
//***********************************************************************************
GenericSaveFilePopup::GenericSaveFilePopup(const QString &title)
- : FileBrowserPopup(title) {}
+ : FileBrowserPopup(title) {
+ connect(m_nameField, SIGNAL(returnPressedNow()), m_okButton,
+ SLOT(animateClick()));
+}
//-----------------------------------------------------------------------------
@@ -546,6 +549,8 @@ void LoadSubScenePopup::showEvent(QShowEvent *e) {
SaveSceneAsPopup::SaveSceneAsPopup() : FileBrowserPopup(tr("Save Scene")) {
setOkText(tr("Save"));
addFilterType("tnz");
+ connect(m_nameField, SIGNAL(returnPressedNow()), m_okButton,
+ SLOT(animateClick()));
}
bool SaveSceneAsPopup::execute() {
@@ -575,6 +580,8 @@ void SaveSceneAsPopup::initFolder() {
SaveSubSceneAsPopup::SaveSubSceneAsPopup()
: FileBrowserPopup(tr("Sub-xsheet")) {
setOkText(tr("Save"));
+ connect(m_nameField, SIGNAL(returnPressedNow()), m_okButton,
+ SLOT(animateClick()));
}
bool SaveSubSceneAsPopup::execute() {
@@ -1323,6 +1330,8 @@ void LoadLevelPopup::onSelectionChanged(TSelection *selection) {
SaveLevelAsPopup::SaveLevelAsPopup() : FileBrowserPopup(tr("Save Level")) {
setOkText(tr("Save"));
+ connect(m_nameField, SIGNAL(returnPressedNow()), m_okButton,
+ SLOT(animateClick()));
}
bool SaveLevelAsPopup::execute() {
@@ -1603,6 +1612,8 @@ SavePaletteAsPopup::SavePaletteAsPopup()
: FileBrowserPopup(tr("Save Palette")) {
setOkText(tr("Save"));
addFilterType("tpl");
+ connect(m_nameField, SIGNAL(returnPressedNow()), m_okButton,
+ SLOT(animateClick()));
}
bool SavePaletteAsPopup::execute() {
diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cpp
index d9f6345..f1b35d0 100644
--- a/toonz/sources/toonz/iocommand.cpp
+++ b/toonz/sources/toonz/iocommand.cpp
@@ -1257,8 +1257,8 @@ bool IoCmd::saveSceneIfNeeded(QString msg) {
void IoCmd::newScene() {
RenderingSuspender suspender;
TApp *app = TApp::instance();
- double cameraDpi = 53.33333; // used to be 64, consider changing to 120 or
- // 160
+ double cameraDpi = 120; // used to be 64 and 53.33333
+
if (!saveSceneIfNeeded(QApplication::tr("New Scene"))) return;
IconGenerator::instance()->clearRequests();
@@ -1861,6 +1861,35 @@ bool IoCmd::loadScene(const TFilePath &path, bool updateRecentFile,
QAction *act = CommandManager::instance()->getAction(MI_RevertScene);
if (act) act->setEnabled(exist);
+ // check if the output dpi is incompatible with pixels only mode
+ if (Preferences::instance()->getPixelsOnly()) {
+ TPointD dpi = scene->getCurrentCamera()->getDpi();
+ if (!areAlmostEqual(dpi.x, Stage::standardDpi) ||
+ !areAlmostEqual(dpi.y, Stage::standardDpi)) {
+ QString question = QObject::tr(
+ "This scene is incompatible with pixels only mode of the current "
+ "OpenToonz version.\nWhat would you like to do?");
+ QString turnOffPixelAnswer = QObject::tr("Turn off pixels only mode");
+ QString resizeSceneAnswer =
+ QObject::tr("Keep pixels only mode on and resize the scene");
+ int ret =
+ DVGui::MsgBox(question, turnOffPixelAnswer, resizeSceneAnswer, 0);
+ if (ret == 0) {
+ } // do nothing
+ else if (ret == 1) { // Turn off pixels only mode
+ Preferences::instance()->setPixelsOnly(false);
+ app->getCurrentScene()->notifyPixelUnitSelected(false);
+ } else { // ret = 2 : Resize the scene
+ TDimensionD camSize = scene->getCurrentCamera()->getSize();
+ TDimension camRes(camSize.lx * Stage::standardDpi,
+ camSize.ly * Stage::standardDpi);
+ scene->getCurrentCamera()->setRes(camRes);
+ app->getCurrentScene()->setDirtyFlag(true);
+ app->getCurrentXsheet()->notifyXsheetChanged();
+ }
+ }
+ }
+
printf("%s:%s loadScene() completed :\n", __FILE__, __FUNCTION__);
return true;
}
diff --git a/toonz/sources/toonz/levelsettingspopup.cpp b/toonz/sources/toonz/levelsettingspopup.cpp
index 993b58b..d973c61 100644
--- a/toonz/sources/toonz/levelsettingspopup.cpp
+++ b/toonz/sources/toonz/levelsettingspopup.cpp
@@ -661,12 +661,13 @@ void LevelSettingsPopup::onNameChanged() {
error("The name " + text +
" you entered for the level is not valid.\n Please enter a different "
"name.");
+ m_nameFld->setFocus();
return;
}
/*-- Level名に変更がない場合 --*/
if (level->getName() == text.toStdWString()) {
- warning("Level name unchanged.");
+ // warning("Level name unchanged.");
return;
}
@@ -677,6 +678,7 @@ void LevelSettingsPopup::onNameChanged() {
error("The name " + text +
" you entered for the level is already used.\nPlease enter a "
"different name.");
+ m_nameFld->setFocus();
return;
}
diff --git a/toonz/sources/toonz/menubar.cpp b/toonz/sources/toonz/menubar.cpp
index 0e15726..512c136 100644
--- a/toonz/sources/toonz/menubar.cpp
+++ b/toonz/sources/toonz/menubar.cpp
@@ -1232,6 +1232,15 @@ QMenuBar *StackedMenuBar::createFullMenuBar() {
addMenuItem(xsheetMenu, MI_RemoveSceneFrame);
addMenuItem(xsheetMenu, MI_InsertGlobalKeyframe);
addMenuItem(xsheetMenu, MI_RemoveGlobalKeyframe);
+ xsheetMenu->addSeparator();
+ addMenuItem(xsheetMenu, MI_NextFrame);
+ addMenuItem(xsheetMenu, MI_PrevFrame);
+ addMenuItem(xsheetMenu, MI_FirstFrame);
+ addMenuItem(xsheetMenu, MI_LastFrame);
+ addMenuItem(xsheetMenu, MI_NextDrawing);
+ addMenuItem(xsheetMenu, MI_PrevDrawing);
+ addMenuItem(xsheetMenu, MI_NextStep);
+ addMenuItem(xsheetMenu, MI_PrevStep);
// Menu' CELLS
QMenu *cellsMenu = addMenu(tr("Cells"), fullMenuBar);
@@ -1253,8 +1262,11 @@ QMenuBar *StackedMenuBar::createFullMenuBar() {
addMenuItem(cellsMenu, MI_Rollup);
addMenuItem(cellsMenu, MI_Rolldown);
addMenuItem(cellsMenu, MI_TimeStretch);
- addMenuItem(xsheetMenu, MI_DrawingSubForward);
- addMenuItem(xsheetMenu, MI_DrawingSubBackward);
+ cellsMenu->addSeparator();
+ addMenuItem(cellsMenu, MI_DrawingSubForward);
+ addMenuItem(cellsMenu, MI_DrawingSubBackward);
+ addMenuItem(cellsMenu, MI_DrawingSubGroupForward);
+ addMenuItem(cellsMenu, MI_DrawingSubGroupBackward);
cellsMenu->addSeparator();
addMenuItem(cellsMenu, MI_Autorenumber);
addMenuItem(cellsMenu, MI_Duplicate);
diff --git a/toonz/sources/toonz/menubarpopup.cpp b/toonz/sources/toonz/menubarpopup.cpp
index 06e3828..f104416 100644
--- a/toonz/sources/toonz/menubarpopup.cpp
+++ b/toonz/sources/toonz/menubarpopup.cpp
@@ -362,6 +362,7 @@ CommandListTree::CommandListTree(QWidget* parent) : QTreeWidget(parent) {
menuCommandFolder);
addFolder(ShortcutTree::tr("Tools"), ToolCommandType);
+ addFolder(ShortcutTree::tr("Playback"), PlaybackCommandType);
MenuBarSeparatorItem* sep = new MenuBarSeparatorItem(0);
sep->setToolTip(0, QObject::tr("[Drag&Drop] to copy separator to menu bar"));
diff --git a/toonz/sources/toonz/pane.cpp b/toonz/sources/toonz/pane.cpp
index 15989f2..e94ee83 100644
--- a/toonz/sources/toonz/pane.cpp
+++ b/toonz/sources/toonz/pane.cpp
@@ -27,6 +27,7 @@
#include
#include
#include
+#include
#include
extern TEnv::StringVar EnvSafeAreaName;
@@ -341,40 +342,30 @@ void TPanelTitleBar::paintEvent(QPaintEvent *) {
QPainter painter(this);
QRect rect = this->rect();
- QColor titleColor;
- QColor brushColor;
+ bool isPanelActive;
TPanel *dw = qobject_cast(parentWidget());
Q_ASSERT(dw != 0);
+ // docked panel
if (!dw->isFloating()) {
- if (dw->widgetInThisPanelIsFocused()) {
- brushColor = QColor(64, 64, 64);
- titleColor = QColor(Qt::white);
- } else {
- brushColor = QColor(100, 100, 100);
- titleColor = QColor(192, 192, 192);
- }
- } else if (isActiveWindow()) {
- brushColor = QColor(96, 96, 96);
- titleColor = QColor(Qt::white);
- } else {
- brushColor = QColor(128, 128, 128);
- titleColor = QColor(192, 192, 192);
+ isPanelActive = dw->widgetInThisPanelIsFocused();
+ qDrawBorderPixmap(&painter, rect, QMargins(3, 3, 3, 3),
+ (isPanelActive) ? m_activeBorderPm : m_borderPm);
+ }
+ // floating panel
+ else {
+ isPanelActive = isActiveWindow();
+ qDrawBorderPixmap(
+ &painter, rect, QMargins(3, 3, 3, 3),
+ (isPanelActive) ? m_floatActiveBorderPm : m_floatBorderPm);
}
- painter.setBrush(brushColor);
- painter.setPen(Qt::black);
- painter.drawRect(rect.adjusted(0, 0, -1, -1));
-
- painter.setPen(titleColor);
- painter.drawLine(rect.topLeft(), rect.bottomLeft());
- painter.drawLine(rect.topLeft(), rect.topRight());
if (dw->getOrientation() == TDockWidget::vertical) {
QString titleText = painter.fontMetrics().elidedText(
dw->windowTitle(), Qt::ElideRight, rect.width() - 50);
painter.setBrush(Qt::NoBrush);
- painter.setPen(titleColor);
+ painter.setPen(isPanelActive ? m_activeTitleColor : m_titleColor);
painter.drawText(QPointF(10, 15), titleText);
}
diff --git a/toonz/sources/toonz/pane.h b/toonz/sources/toonz/pane.h
index 253f4c6..3af30c3 100644
--- a/toonz/sources/toonz/pane.h
+++ b/toonz/sources/toonz/pane.h
@@ -99,6 +99,9 @@ class TPanelTitleBar final : public QFrame {
bool m_closeButtonHighlighted;
std::vector> m_buttons;
+ QPixmap m_borderPm, m_activeBorderPm, m_floatBorderPm, m_floatActiveBorderPm;
+ QColor m_titleColor, m_activeTitleColor;
+
public:
TPanelTitleBar(QWidget *parent = 0,
TDockWidget::Orientation orientation = TDockWidget::vertical);
@@ -112,6 +115,23 @@ public:
// pos = widget position. n.b. if pos.x()<0 then origin is topright corner
void add(const QPoint &pos, QWidget *widget);
+ QPixmap getBorderPixmap() const { return m_borderPm; }
+ void setBorderPixmap(const QPixmap &pixmap) { m_borderPm = pixmap; }
+ QPixmap getActiveBorderPixmap() const { return m_activeBorderPm; }
+ void setActiveBorderPixmap(const QPixmap &pixmap) {
+ m_activeBorderPm = pixmap;
+ }
+ QPixmap getFloatBorderPixmap() const { return m_floatBorderPm; }
+ void setFloatBorderPixmap(const QPixmap &pixmap) { m_floatBorderPm = pixmap; }
+ QPixmap getFloatActiveBorderPixmap() const { return m_floatActiveBorderPm; }
+ void setFloatActiveBorderPixmap(const QPixmap &pixmap) {
+ m_floatActiveBorderPm = pixmap;
+ }
+ QColor getTitleColor() const { return m_titleColor; }
+ void setTitleColor(const QColor &color) { m_titleColor = color; }
+ QColor getActiveTitleColor() const { return m_activeTitleColor; }
+ void setActiveTitleColor(const QColor &color) { m_activeTitleColor = color; }
+
protected:
void resizeEvent(QResizeEvent *e) override;
@@ -123,6 +143,17 @@ protected:
void mousePressEvent(QMouseEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *) override;
+ Q_PROPERTY(QPixmap BorderPixmap READ getBorderPixmap WRITE setBorderPixmap);
+ Q_PROPERTY(QPixmap ActiveBorderPixmap READ getActiveBorderPixmap WRITE
+ setActiveBorderPixmap);
+ Q_PROPERTY(QPixmap FloatBorderPixmap READ getFloatBorderPixmap WRITE
+ setFloatBorderPixmap);
+ Q_PROPERTY(QPixmap FloatActiveBorderPixmap READ getFloatActiveBorderPixmap
+ WRITE setFloatActiveBorderPixmap);
+ Q_PROPERTY(QColor TitleColor READ getTitleColor WRITE setTitleColor);
+ Q_PROPERTY(QColor ActiveTitleColor READ getActiveTitleColor WRITE
+ setActiveTitleColor);
+
signals:
void closeButtonPressed();
diff --git a/toonz/sources/toonz/preferencespopup.cpp b/toonz/sources/toonz/preferencespopup.cpp
index 0f0cfeb..f61fbc3 100644
--- a/toonz/sources/toonz/preferencespopup.cpp
+++ b/toonz/sources/toonz/preferencespopup.cpp
@@ -27,6 +27,7 @@
#include "toonz/tcamera.h"
#include "toonz/levelproperties.h"
#include "toonz/tonionskinmaskhandle.h"
+#include "toonz/stage.h"
// TnzCore includes
#include "tsystem.h"
@@ -217,22 +218,22 @@ Preferences::LevelFormat PreferencesPopup::FormatProperties::levelFormat()
void PreferencesPopup::onPixelsOnlyChanged(int index) {
bool enabled = index == Qt::Checked;
if (enabled) {
- m_pref->setDefLevelDpi(53.33333);
+ m_pref->setDefLevelDpi(Stage::standardDpi);
m_pref->setPixelsOnly(true);
TCamera *camera;
camera =
TApp::instance()->getCurrentScene()->getScene()->getCurrentCamera();
TDimension camRes = camera->getRes();
TDimensionD camSize;
- camSize.lx = camRes.lx / 53.33333;
- camSize.ly = camRes.ly / 53.33333;
+ camSize.lx = camRes.lx / Stage::standardDpi;
+ camSize.ly = camRes.ly / Stage::standardDpi;
camera->setSize(camSize);
TDimension cleanupRes = CleanupSettingsModel::instance()
->getCurrentParameters()
->m_camera.getRes();
TDimensionD cleanupSize;
- cleanupSize.lx = cleanupRes.lx / 53.33333;
- cleanupSize.ly = cleanupRes.ly / 53.33333;
+ cleanupSize.lx = cleanupRes.lx / Stage::standardDpi;
+ cleanupSize.ly = cleanupRes.ly / Stage::standardDpi;
CleanupSettingsModel::instance()->getCurrentParameters()->m_camera.setSize(
cleanupSize);
m_pref->storeOldUnits();
@@ -241,7 +242,7 @@ void PreferencesPopup::onPixelsOnlyChanged(int index) {
m_unitOm->setDisabled(true);
m_cameraUnitOm->setDisabled(true);
m_defLevelDpi->setDisabled(true);
- m_defLevelDpi->setValue(53.33333);
+ m_defLevelDpi->setValue(Stage::standardDpi);
m_defLevelWidth->setMeasure("camera.lx");
m_defLevelHeight->setMeasure("camera.ly");
m_defLevelWidth->setValue(m_pref->getDefLevelWidth());
@@ -275,6 +276,15 @@ void PreferencesPopup::onPixelsOnlyChanged(int index) {
}
}
+//-----------------------------------------------------------------------------
+
+void PreferencesPopup::onPixelUnitExternallySelected(bool on) {
+ // call slot function onPixelsOnlyChanged() accordingly
+ m_pixelsOnlyCB->setCheckState((on) ? Qt::Checked : Qt::Unchecked);
+}
+
+//-----------------------------------------------------------------------------
+
void PreferencesPopup::onUnitChanged(int index) {
if (index == 4 && m_pixelsOnlyCB->isChecked() == false) {
m_pixelsOnlyCB->setCheckState(Qt::Checked);
@@ -615,6 +625,12 @@ void PreferencesPopup::onOnionSkinVisibilityChanged(int index) {
//-----------------------------------------------------------------------------
+void PreferencesPopup::onOnionSkinDuringPlaybackChanged(int index) {
+ m_pref->setOnionSkinDuringPlayback(index == Qt::Checked);
+}
+
+//-----------------------------------------------------------------------------
+
void PreferencesPopup::onActualPixelOnSceneModeChanged(int index) {
m_pref->enableActualPixelViewOnSceneEditingMode(index == Qt::Checked);
}
@@ -1048,9 +1064,11 @@ PreferencesPopup::PreferencesPopup()
bool onlyInks;
m_pref->getOnionData(frontColor, backColor, onlyInks);
m_onionSkinVisibility = new CheckBox(tr("Onion Skin ON"));
- m_frontOnionColor = new ColorField(this, false, frontColor);
- m_backOnionColor = new ColorField(this, false, backColor);
- m_inksOnly = new DVGui::CheckBox(tr("Display Lines Only "));
+ m_onionSkinDuringPlayback =
+ new CheckBox(tr("Show Onion Skin During Playback"));
+ m_frontOnionColor = new ColorField(this, false, frontColor);
+ m_backOnionColor = new ColorField(this, false, backColor);
+ m_inksOnly = new DVGui::CheckBox(tr("Display Lines Only "));
m_inksOnly->setChecked(onlyInks);
int thickness = m_pref->getOnionPaperThickness();
@@ -1278,6 +1296,7 @@ PreferencesPopup::PreferencesPopup()
//--- Onion Skin ------------------------------
m_onionSkinVisibility->setChecked(m_pref->isOnionSkinEnabled());
+ m_onionSkinDuringPlayback->setChecked(m_pref->getOnionSkinDuringPlayback());
m_frontOnionColor->setEnabled(m_pref->isOnionSkinEnabled());
m_backOnionColor->setEnabled(m_pref->isOnionSkinEnabled());
m_inksOnly->setEnabled(m_pref->isOnionSkinEnabled());
@@ -1746,6 +1765,8 @@ PreferencesPopup::PreferencesPopup()
onionLay->addLayout(onionColorLay, 0);
onionLay->addWidget(m_inksOnly, 0, Qt::AlignLeft | Qt::AlignVCenter);
+ onionLay->addWidget(m_onionSkinDuringPlayback, 0,
+ Qt::AlignLeft | Qt::AlignVCenter);
onionLay->addStretch(1);
}
@@ -1833,6 +1854,11 @@ PreferencesPopup::PreferencesPopup()
SLOT(onStyleSheetTypeChanged(int)));
ret = ret && connect(m_pixelsOnlyCB, SIGNAL(stateChanged(int)),
SLOT(onPixelsOnlyChanged(int)));
+ // pixels unit may deactivated externally on loading scene (see
+ // IoCmd::loadScene())
+ ret = ret && connect(TApp::instance()->getCurrentScene(),
+ SIGNAL(pixelUnitSelected(bool)), this,
+ SLOT(onPixelUnitExternallySelected(bool)));
ret = ret && connect(m_unitOm, SIGNAL(currentIndexChanged(int)),
SLOT(onUnitChanged(int)));
ret = ret && connect(m_cameraUnitOm, SIGNAL(currentIndexChanged(int)),
@@ -1989,6 +2015,8 @@ PreferencesPopup::PreferencesPopup()
SLOT(onOnionDataChanged(int)));
ret = ret && connect(m_onionSkinVisibility, SIGNAL(stateChanged(int)),
SLOT(onOnionSkinVisibilityChanged(int)));
+ ret = ret && connect(m_onionSkinDuringPlayback, SIGNAL(stateChanged(int)),
+ SLOT(onOnionSkinDuringPlaybackChanged(int)));
ret = ret && connect(m_onionPaperThickness, SIGNAL(editingFinished()),
SLOT(onOnionPaperThicknessChanged()));
diff --git a/toonz/sources/toonz/preferencespopup.h b/toonz/sources/toonz/preferencespopup.h
index 8e8b640..7677d22 100644
--- a/toonz/sources/toonz/preferencespopup.h
+++ b/toonz/sources/toonz/preferencespopup.h
@@ -68,7 +68,7 @@ private:
QPushButton *m_addLevelFormat, *m_removeLevelFormat, *m_editLevelFormat;
DVGui::CheckBox *m_inksOnly, *m_enableVersionControl, *m_levelsBackup,
- *m_onionSkinVisibility, *m_pixelsOnlyCB;
+ *m_onionSkinVisibility, *m_pixelsOnlyCB, *m_onionSkinDuringPlayback;
DVGui::FileField *m_ffmpegPathFileFld;
@@ -79,6 +79,7 @@ private:
private slots:
void onPixelsOnlyChanged(int index);
+ void onPixelUnitExternallySelected(bool on);
void onUnitChanged(int index);
void onCameraUnitChanged(int index);
void onRoomChoiceChanged(int index);
@@ -141,6 +142,7 @@ private slots:
void onColumnIconChange(const QString &);
void onReplaceAfterSaveLevelAsChanged(int index);
void onOnionSkinVisibilityChanged(int);
+ void onOnionSkinDuringPlaybackChanged(int);
void onActualPixelOnSceneModeChanged(int);
void onMultiLayerStylePickerChanged(int);
void onLevelNameOnEachMarkerChanged(int);
diff --git a/toonz/sources/toonz/projectpopup.cpp b/toonz/sources/toonz/projectpopup.cpp
index e947e1c..6c96c3b 100644
--- a/toonz/sources/toonz/projectpopup.cpp
+++ b/toonz/sources/toonz/projectpopup.cpp
@@ -345,7 +345,8 @@ void ProjectPopup::updateChooseProjectCombo() {
m_projectPaths.clear();
m_chooseProjectCombo->clear();
- TFilePath sandboxFp = TProjectManager::instance()->getSandboxProjectFolder();
+ TFilePath sandboxFp = TProjectManager::instance()->getSandboxProjectFolder() +
+ "sandbox_otprj.xml";
m_projectPaths.push_back(sandboxFp);
m_chooseProjectCombo->addItem("sandbox");
diff --git a/toonz/sources/toonz/sceneviewer.cpp b/toonz/sources/toonz/sceneviewer.cpp
index 826eb7f..d039b34 100644
--- a/toonz/sources/toonz/sceneviewer.cpp
+++ b/toonz/sources/toonz/sceneviewer.cpp
@@ -1864,8 +1864,12 @@ void SceneViewer::zoomQt(bool forward, bool reset) {
/*! a factor for getting pixel-based zoom ratio
*/
double SceneViewer::getDpiFactor() {
+ // When the current unit is "pixels", always use a standard dpi
+ if (Preferences::instance()->getPixelsOnly()) {
+ return Stage::inch / Stage::standardDpi;
+ }
// When preview mode, use a camera DPI
- if (isPreviewEnabled()) {
+ else if (isPreviewEnabled()) {
return Stage::inch /
TApp::instance()
->getCurrentScene()
diff --git a/toonz/sources/toonz/viewerpane.cpp b/toonz/sources/toonz/viewerpane.cpp
index aba4bed..4dd7bcb 100644
--- a/toonz/sources/toonz/viewerpane.cpp
+++ b/toonz/sources/toonz/viewerpane.cpp
@@ -27,6 +27,7 @@
#include "toonz/tpalettehandle.h"
#include "toonz/tonionskinmaskhandle.h"
#include "toutputproperties.h"
+#include "toonz/preferences.h"
// TnzQt includes
#include "toonzqt/menubarcommand.h"
@@ -143,6 +144,8 @@ SceneViewerPanel::SceneViewerPanel(QWidget *parent, Qt::WFlags flags)
ret = ret &&
connect(m_flipConsole, SIGNAL(playStateChanged(bool)),
TApp::instance()->getCurrentFrame(), SLOT(setPlaying(bool)));
+ ret = ret && connect(m_flipConsole, SIGNAL(playStateChanged(bool)), this,
+ SLOT(onPlayingStatusChanged(bool)));
ret = ret &&
connect(m_flipConsole, SIGNAL(buttonPressed(FlipConsole::EGadget)),
m_sceneViewer, SLOT(onButtonPressed(FlipConsole::EGadget)));
@@ -433,6 +436,28 @@ void SceneViewerPanel::onXshLevelSwitched(TXshLevel *) { changeWindowTitle(); }
//-----------------------------------------------------------------------------
+void SceneViewerPanel::onPlayingStatusChanged(bool playing) {
+ if (Preferences::instance()->getOnionSkinDuringPlayback()) return;
+ OnionSkinMask osm =
+ TApp::instance()->getCurrentOnionSkin()->getOnionSkinMask();
+ if (playing) {
+ m_onionSkinActive = osm.isEnabled();
+ if (m_onionSkinActive) {
+ osm.enable(false);
+ TApp::instance()->getCurrentOnionSkin()->setOnionSkinMask(osm);
+ TApp::instance()->getCurrentOnionSkin()->notifyOnionSkinMaskChanged();
+ }
+ } else {
+ if (m_onionSkinActive) {
+ osm.enable(true);
+ TApp::instance()->getCurrentOnionSkin()->setOnionSkinMask(osm);
+ TApp::instance()->getCurrentOnionSkin()->notifyOnionSkinMaskChanged();
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------
+
void SceneViewerPanel::changeWindowTitle() {
TApp *app = TApp::instance();
// zoom = sqrt(m_sceneViewer->getViewMatrix().det());
diff --git a/toonz/sources/toonz/viewerpane.h b/toonz/sources/toonz/viewerpane.h
index 5ed1a30..d308604 100644
--- a/toonz/sources/toonz/viewerpane.h
+++ b/toonz/sources/toonz/viewerpane.h
@@ -36,6 +36,7 @@ class SceneViewerPanel final : public TPanel, public FlipConsoleOwner {
TPanelTitleBarButtonSet *m_referenceModeBs;
TPanelTitleBarButton *m_previewButton;
TPanelTitleBarButton *m_subcameraPreviewButton;
+ bool m_onionSkinActive = false;
public:
#if QT_VERSION >= 0x050500
@@ -71,7 +72,7 @@ protected slots:
void onFrameSwitched();
void onSceneSwitched();
void onFrameTypeChanged();
-
+ void onPlayingStatusChanged(bool playing);
void enableFullPreview(bool enabled);
void enableSubCameraPreview(bool enabled);
};
diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp
index a02b533..7f281d1 100644
--- a/toonz/sources/toonz/xshcellviewer.cpp
+++ b/toonz/sources/toonz/xshcellviewer.cpp
@@ -599,15 +599,20 @@ void RenameCellField::renameCell() {
// rinomino in 2. Quindi devo prima verificare
// che la cella corrente non sia vuota
- TXshCell cell = xsheet->getCell(m_row, m_col);
- if (cell.isEmpty() && m_row > 0) {
- cell = xsheet->getCell(m_row - 1, m_col);
+ TXshCell cell;
+ int tmpRow = m_row;
+ while (1) {
+ cell = xsheet->getCell(tmpRow, m_col);
+ if (!cell.isEmpty() || tmpRow == 0) break;
+ tmpRow--;
}
xl = cell.m_level.getPointer();
if (!xl || (xl->getType() == OVL_XSHLEVEL &&
xl->getPath().getFrame() == TFrameId::NO_FRAME))
return;
- if (fid == TFrameId::NO_FRAME) fid = cell.m_frameId;
+ // if the next upper cell is empty, then make this cell empty too
+ if (fid == TFrameId::NO_FRAME)
+ fid = (m_row - tmpRow <= 1) ? cell.m_frameId : TFrameId(0);
} else {
ToonzScene *scene = m_viewer->getXsheet()->getScene();
TLevelSet *levelSet = scene->getLevelSet();
@@ -625,29 +630,37 @@ void RenameCellField::renameCell() {
}
}
if (!xl) return;
+
+ TCellSelection *cellSelection = dynamic_cast(
+ TApp::instance()->getCurrentSelection()->getSelection());
+ if (!cellSelection) return;
+
TXshCell cell(xl, fid);
- // register undo only if the cell is modified
- if (cell == xsheet->getCell(m_row, m_col)) return;
-
- RenameCellUndo *undo =
- new RenameCellUndo(m_row, m_col, xsheet->getCell(m_row, m_col), cell);
- xsheet->setCell(m_row, m_col, cell);
- TUndoManager::manager()->add(undo);
- TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
- TApp *app = TApp::instance();
- if (m_row == app->getCurrentFrame()->getFrame()) {
- app->getCurrentTool()->onImageChanged(
- (TImage::Type)app->getCurrentImageType());
- xsheet->getStageObjectTree()->invalidateAll();
- }
+ if (fid.getNumber() == 0) {
+ TCellSelection::Range range = cellSelection->getSelectedCells();
+ cellSelection->deleteCells();
+ // revert cell selection
+ cellSelection->selectCells(range.m_r0, range.m_c0, range.m_r1, range.m_c1);
+ } else
+ cellSelection->renameCells(cell);
}
//-----------------------------------------------------------------------------
void RenameCellField::onReturnPressed() {
renameCell();
- showInRowCol(m_row + 1, m_col);
+
+ // move the cell selection
+ TCellSelection *cellSelection = dynamic_cast(
+ TApp::instance()->getCurrentSelection()->getSelection());
+ if (!cellSelection) return;
+ TCellSelection::Range range = cellSelection->getSelectedCells();
+ int offset = range.m_r1 - range.m_r0 + 1;
+ cellSelection->selectCells(range.m_r0 + offset, range.m_c0,
+ range.m_r1 + offset, range.m_c1);
+ TApp::instance()->getCurrentSelection()->notifySelectionChanged();
+ showInRowCol(m_row + offset, m_col);
}
//-----------------------------------------------------------------------------
@@ -661,14 +674,30 @@ void RenameCellField::focusOutEvent(QFocusEvent *e) {
//-----------------------------------------------------------------------------
void RenameCellField::keyPressEvent(QKeyEvent *event) {
+ // move the cell selection
+ TCellSelection *cellSelection = dynamic_cast(
+ TApp::instance()->getCurrentSelection()->getSelection());
+ if (!cellSelection) {
+ QLineEdit::keyPressEvent(event);
+ return;
+ }
+ TCellSelection::Range range = cellSelection->getSelectedCells();
+ int offset = range.m_r1 - range.m_r0 + 1;
+
if (event->key() == Qt::Key_Up && m_row > 0) {
renameCell();
- showInRowCol(m_row - 1, m_col);
+ cellSelection->selectCells(range.m_r0 - offset, range.m_c0,
+ range.m_r1 - offset, range.m_c1);
+ showInRowCol(m_row - offset, m_col);
+ TApp::instance()->getCurrentSelection()->notifySelectionChanged();
} else if (event->key() == Qt::Key_Down) {
renameCell();
- showInRowCol(m_row + 1, m_col);
- }
- QLineEdit::keyPressEvent(event);
+ cellSelection->selectCells(range.m_r0 + offset, range.m_c0,
+ range.m_r1 + offset, range.m_c1);
+ showInRowCol(m_row + offset, m_col);
+ TApp::instance()->getCurrentSelection()->notifySelectionChanged();
+ } else
+ QLineEdit::keyPressEvent(event);
}
//=============================================================================
diff --git a/toonz/sources/toonzlib/preferences.cpp b/toonz/sources/toonzlib/preferences.cpp
index 294170f..886e841 100644
--- a/toonz/sources/toonzlib/preferences.cpp
+++ b/toonz/sources/toonzlib/preferences.cpp
@@ -283,6 +283,7 @@ Preferences::Preferences()
, m_columnIconLoadingPolicy((int)LoadAtOnce)
, m_moveCurrentFrameByClickCellArea(true)
, m_onionSkinEnabled(true)
+ , m_onionSkinDuringPlayback(false)
, m_multiLayerStylePickerEnabled(false)
, m_paletteTypeOnLoadRasterImageAsColorModel(0)
, m_showKeyframesOnXsheetCellArea(true)
@@ -535,6 +536,7 @@ Preferences::Preferences()
getValue(*m_settings, "moveCurrentFrameByClickCellArea",
m_moveCurrentFrameByClickCellArea);
getValue(*m_settings, "onionSkinEnabled", m_onionSkinEnabled);
+ getValue(*m_settings, "onionSkinDuringPlayback", m_onionSkinDuringPlayback);
getValue(*m_settings, "multiLayerStylePickerEnabled",
m_multiLayerStylePickerEnabled);
getValue(*m_settings, "paletteTypeOnLoadRasterImageAsColorModel",
@@ -898,6 +900,13 @@ void Preferences::enableOnionSkin(bool on) {
//-----------------------------------------------------------------
+void Preferences::setOnionSkinDuringPlayback(bool on) {
+ m_onionSkinDuringPlayback = on;
+ m_settings->setValue("onionSkinDuringPlayback", on ? "1" : "0");
+}
+
+//-----------------------------------------------------------------
+
void Preferences::setShow0ThickLines(bool on) {
m_show0ThickLines = on;
m_settings->setValue(s_show0ThickLines, s_bool[on]);
diff --git a/toonz/sources/toonzlib/stage.cpp b/toonz/sources/toonzlib/stage.cpp
index 3c9610a..ad340da 100644
--- a/toonz/sources/toonzlib/stage.cpp
+++ b/toonz/sources/toonzlib/stage.cpp
@@ -69,8 +69,8 @@ typedef std::vector PlayerSet;
thickness of
images .pli.
*/
-const double Stage::inch = 53.33333; // consider changing to 120 or 160
-const double Stage::vectorDpi = 53.3333;
+const double Stage::inch = 53.33333;
+const double Stage::standardDpi = 120;
namespace {
void updateOnionSkinSize(const PlayerSet &players) {
diff --git a/toonz/sources/toonzlib/tcamera.cpp b/toonz/sources/toonzlib/tcamera.cpp
index 9772662..99d68c9 100644
--- a/toonz/sources/toonzlib/tcamera.cpp
+++ b/toonz/sources/toonzlib/tcamera.cpp
@@ -10,7 +10,8 @@
TCamera::TCamera()
//: m_size(12, 9), m_res(768, 576), m_xPrevalence(true)
- : m_size(36, 20.25),
+ //: m_size(36, 20.25),
+ : m_size(16, 9),
m_res(1920, 1080),
m_xPrevalence(true) {}
diff --git a/toonz/sources/toonzlib/txsheet.cpp b/toonz/sources/toonzlib/txsheet.cpp
index 114ed3e..607b77a 100644
--- a/toonz/sources/toonzlib/txsheet.cpp
+++ b/toonz/sources/toonzlib/txsheet.cpp
@@ -1567,3 +1567,14 @@ TRectD TXsheet::getBBox(int r) const {
return bbox;
}
+
+//-----------------------------------------------------------------------
+
+bool TXsheet::isRectEmpty(int r0, int c0, int r1, int c1) const {
+ for (int r = r0; r <= r1; r++) {
+ for (int c = c0; c <= c1; c++) {
+ if (!getCell(r, c).isEmpty()) return false;
+ }
+ }
+ return true;
+}
\ No newline at end of file
diff --git a/toonz/sources/toonzqt/camerasettingswidget.cpp b/toonz/sources/toonzqt/camerasettingswidget.cpp
index 2da8e22..acfd5e8 100644
--- a/toonz/sources/toonzqt/camerasettingswidget.cpp
+++ b/toonz/sources/toonzqt/camerasettingswidget.cpp
@@ -759,8 +759,8 @@ void CameraSettingsWidget::onYResChanged() {
void CameraSettingsWidget::onXDpiChanged() {
if (Preferences::instance()->getPixelsOnly()) {
- m_xDpiFld->setValue(Stage::inch);
- m_yDpiFld->setValue(Stage::inch);
+ m_xDpiFld->setValue(Stage::standardDpi);
+ m_yDpiFld->setValue(Stage::standardDpi);
} else if (m_fspChk->isChecked())
m_yDpiFld->setValue(m_xDpiFld->getValue());
@@ -781,8 +781,8 @@ void CameraSettingsWidget::onXDpiChanged() {
void CameraSettingsWidget::onYDpiChanged() {
if (Preferences::instance()->getPixelsOnly()) {
- m_xDpiFld->setValue(Stage::inch);
- m_yDpiFld->setValue(Stage::inch);
+ m_xDpiFld->setValue(Stage::standardDpi);
+ m_yDpiFld->setValue(Stage::standardDpi);
} else if (m_fspChk->isChecked())
m_xDpiFld->setValue(m_yDpiFld->getValue());
@@ -850,8 +850,8 @@ void CameraSettingsWidget::onPresetSelected(const QString &str) {
}
if (Preferences::instance()->getPixelsOnly()) {
- m_lxFld->setValue(xres / Stage::inch);
- m_lyFld->setValue(yres / Stage::inch);
+ m_lxFld->setValue(xres / Stage::standardDpi);
+ m_lyFld->setValue(yres / Stage::standardDpi);
}
if (m_forCleanup && m_offsX && m_offsY && !xoffset.isEmpty() &&
diff --git a/toonz/sources/toonzqt/cleanupcamerasettingswidget.cpp b/toonz/sources/toonzqt/cleanupcamerasettingswidget.cpp
index b02a541..b158188 100644
--- a/toonz/sources/toonzqt/cleanupcamerasettingswidget.cpp
+++ b/toonz/sources/toonzqt/cleanupcamerasettingswidget.cpp
@@ -95,7 +95,7 @@ void CleanupCameraSettingsWidget::setFields(
if (Preferences::instance()->getPixelsOnly()) {
TDimension res = cleanupParameters->m_camera.getRes();
cleanupParameters->m_camera.setSize(
- TDimensionD(res.lx / Stage::inch, res.ly / Stage::inch));
+ TDimensionD(res.lx / Stage::standardDpi, res.ly / Stage::standardDpi));
}
m_cameraWidget->setFields(&cleanupParameters->m_camera);
m_offsX->setValue(cleanupParameters->m_offx);
diff --git a/toonz/sources/toonzqt/dvdialog.cpp b/toonz/sources/toonzqt/dvdialog.cpp
index 3692f7e..281586e 100644
--- a/toonz/sources/toonzqt/dvdialog.cpp
+++ b/toonz/sources/toonzqt/dvdialog.cpp
@@ -31,7 +31,7 @@
using namespace DVGui;
-QString DialogTitle = QObject::tr("OpenToonz 1.0");
+QString DialogTitle = QObject::tr("OpenToonz 1.1");
//=============================================================================
namespace {
diff --git a/toonz/sources/toonzqt/lineedit.cpp b/toonz/sources/toonzqt/lineedit.cpp
index fb82a36..743fddb 100644
--- a/toonz/sources/toonzqt/lineedit.cpp
+++ b/toonz/sources/toonzqt/lineedit.cpp
@@ -34,6 +34,7 @@ void LineEdit::focusInEvent(QFocusEvent *event) {
void LineEdit::keyPressEvent(QKeyEvent *event) {
if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
m_isReturnPressed = true;
+ emit returnPressedNow();
clearFocus();
return;
} else {