Scene viewer defaults

This commit is contained in:
Jeremy Bullock 2020-05-24 16:00:44 -06:00
parent 6b19431bd1
commit 8bdf569e52
5 changed files with 125 additions and 55 deletions

View file

@ -57,9 +57,9 @@ after_build:
copy /Y "C:\Tools\opencv\build\x64\vc14\bin\opencv_world412.dll" %CONFIGURATION%\Tahoma
mkdir "%CONFIGURATION%\Tahoma stuff"
mkdir "%CONFIGURATION%\Tahoma\portablestuff"
xcopy /Y /E ..\..\stuff "%CONFIGURATION%\Tahoma stuff"
xcopy /Y /E ..\..\stuff "%CONFIGURATION%\Tahoma\portablestuff"
artifacts:
- path: toonz\$(PLATFORM)\$(CONFIGURATION)

View file

@ -1,27 +1,28 @@
[room]
pane_0\name=StyleEditor
pane_0\geometry=@Rect(39 30 358 494)
pane_0\geometry=@Rect(39 30 358 388)
pane_0\isVertical=true
pane_0\visibleParts=5
pane_0\splitterState=@ByteArray(\0\0\0\xff\0\0\0\x1\0\0\0\x2\0\0\x1i\0\0\0 \x1\xff\xff\xff\xff\x1\0\0\0\x2\0)
pane_1\name=FilmStrip
pane_1\geometry=@Rect(1809 30 111 694)
pane_1\geometry=@Rect(1809 30 111 772)
pane_1\vertical=1
pane_1\showCombo=1
pane_1\navigator=1
pane_2\name=Timeline
pane_2\geometry=@Rect(39 728 1881 267)
pane_2\geometry=@Rect(39 806 1881 189)
pane_2\orientation=LeftToRight
pane_2\frameZoomFactor=100
pane_3\name=SceneViewer
pane_3\geometry=@Rect(401 30 1404 694)
pane_3\geometry=@Rect(401 30 1404 772)
pane_3\visibleParts=5
pane_3\consoleParts=3435969580
pane_4\name=ToolBar
pane_4\geometry=@Rect(0 30 35 965)
pane_5\name=ToolOptions
pane_5\geometry=@Rect(0 0 1920 26)
pane_6\name=LevelPalette
pane_6\geometry=@Rect(39 528 358 196)
pane_6\geometry=@Rect(39 422 358 380)
pane_6\viewtype=0
hierarchy="-1 1 [ 5 [ 4 [ [ [ 0 6 ] 3 1 ] 2 ] ] ] "
name=2D

View file

@ -30,6 +30,25 @@
#define DVVAR DV_IMPORT_VAR
#endif
enum {
eShowCompare = 0x001,
eShowBg = 0x002,
eShowFramerate = 0x004,
eShowVcr = 0x008,
eShowcolorFilter = 0x010,
eShowCustom = 0x020,
eShowHisto = 0x040,
eShowSave = 0x080,
eShowDefineSubCamera = 0x100,
eShowFilledRaster = 0x200,
eShowDefineLoadBox = 0x400,
eShowUseLoadBox = 0x800,
eShowViewerControls = 0x1000,
eShowSound = 0x2000,
eShowLocator = 0x4000,
eShowHowMany = 0x8000
};
class QToolBar;
class QLabel;
class QSlider;
@ -264,6 +283,8 @@ public:
doButtonPressed(button);
setChecked(button, !isChecked(button));
}
UINT getCustomizeMask() { return m_customizeMask; }
void setCustomizemask(UINT mask);
// the main (currently the only) use for current flipconsole and setActive is
// to
@ -350,6 +371,8 @@ private:
int m_blanksToDraw;
bool m_isLinkable;
QMenu *m_menu;
QMap<EGadget, QAbstractButton *> m_buttons;
QMap<EGadget, QAction *> m_actions;

View file

@ -1,6 +1,5 @@
#include "viewerpane.h"
// TnzCore includes
#include "tconvert.h"
#include "tgeometry.h"
@ -64,7 +63,6 @@
#include <QMainWindow>
#include <QSettings>
using namespace DVGui;
//=============================================================================
@ -171,6 +169,18 @@ SceneViewerPanel::SceneViewerPanel(QWidget *parent, Qt::WFlags flags)
->getProperties()
->getOutputProperties()
->getFrameRate());
UINT mask;
mask = mask | eShowVcr;
mask = mask | eShowFramerate;
mask = mask | eShowViewerControls;
mask = mask | eShowSound;
mask = mask | eShowCustom;
mask = mask & ~eShowSave;
mask = mask & ~eShowLocator;
mask = mask & ~eShowHisto;
m_flipConsole->setCustomizemask(mask);
updateFrameRange(), updateFrameMarkers();
setLayout(mainLayout);
@ -803,11 +813,11 @@ bool SceneViewerPanel::hasSoundtrack() {
try {
m_sound = xsheetHandle->getXsheet()->makeSound(prop);
} catch (TSoundDeviceException &e) {
if (e.getType() == TSoundDeviceException::NoDevice) {
std::cout << ::to_string(e.getMessage()) << std::endl;
} else {
throw TSoundDeviceException(e.getType(), e.getMessage());
}
if (e.getType() == TSoundDeviceException::NoDevice) {
std::cout << ::to_string(e.getMessage()) << std::endl;
} else {
throw TSoundDeviceException(e.getType(), e.getMessage());
}
}
if (m_sound == NULL) {
m_hasSoundtrack = false;
@ -842,9 +852,21 @@ void SceneViewerPanel::setVisiblePartsFlag(UINT flag) {
// SaveLoadQSettings
void SceneViewerPanel::save(QSettings &settings) const {
settings.setValue("visibleParts", m_visiblePartsFlag);
settings.setValue("consoleParts", m_flipConsole->getCustomizeMask());
}
void SceneViewerPanel::load(QSettings &settings) {
m_visiblePartsFlag = settings.value("visibleParts", CVPARTS_ALL).toUInt();
updateShowHide();
UINT mask;
mask = mask | eShowVcr;
mask = mask | eShowFramerate;
mask = mask | eShowViewerControls;
mask = mask | eShowSound;
mask = mask | eShowCustom;
mask = mask & ~eShowSave;
mask = mask & ~eShowLocator;
mask = mask & ~eShowHisto;
m_flipConsole->setCustomizemask(
settings.value("consoleParts", mask).toUInt());
}

View file

@ -172,11 +172,11 @@ void PlaybackExecutor::run() {
TUINT32 loadedInstant, nextSampleInstant = timeResolution;
TUINT32 sampleTotalLoadingTime = 0;
TUINT32 lastFrameCounts[4] = {0, 0, 0,
TUINT32 lastFrameCounts[4] = {0, 0, 0,
0}; // Keep the last 4 'played frames' counts.
TUINT32 lastSampleInstants[4] = {0, 0, 0,
0}; // Same for the last sampling instants
TUINT32 lastLoadingTimes[4] = {0, 0, 0,
TUINT32 lastLoadingTimes[4] = {0, 0, 0,
0}; // Same for total sample loading times
double targetFrameTime =
@ -191,9 +191,8 @@ void PlaybackExecutor::run() {
emissionInstant = timer.getTotalTime();
// Draw the next frame
if (playedFramesCount)
emit nextFrame(fps); // Show the next frame, telling
// currently measured fps
if (playedFramesCount) emit nextFrame(fps); // Show the next frame, telling
// currently measured fps
if (FlipConsole::m_areLinked) {
// In case there are linked consoles, update them too.
@ -321,17 +320,15 @@ void FlipSlider::paintEvent(QPaintEvent *ev) {
p.drawImage(QRect(0, 0, PBColorMarginLeft, height()), PBOverlay,
QRect(0, 0, PBColorMarginLeft, PBOverlay.height()));
p.drawImage(
QRect(PBColorMarginLeft, 0,
sliderRect.width() - PBColorMarginLeft - PBColorMarginRight,
height()),
PBOverlay,
QRect(PBColorMarginLeft, 0, overlayInnerWidth, PBOverlay.height()));
p.drawImage(QRect(PBColorMarginLeft, 0,
sliderRect.width() - PBColorMarginLeft - PBColorMarginRight,
height()),
PBOverlay, QRect(PBColorMarginLeft, 0, overlayInnerWidth,
PBOverlay.height()));
p.drawImage(
QRect(width() - PBColorMarginRight, 0, PBColorMarginRight, height()),
PBOverlay,
QRect(PBOverlay.width() - PBColorMarginRight, 0, PBColorMarginRight,
PBOverlay.height()));
PBOverlay, QRect(PBOverlay.width() - PBColorMarginRight, 0,
PBColorMarginRight, PBOverlay.height()));
// Draw the position marker
currPos = sliderPositionFromValue(minimum(), maxValuePlusStep, value(),
@ -418,25 +415,6 @@ void FlipSlider::mouseReleaseEvent(QMouseEvent *me) {
//=============================================================================
enum {
eShowCompare = 0x001,
eShowBg = 0x002,
eShowFramerate = 0x004,
eShowVcr = 0x008,
eShowcolorFilter = 0x010,
eShowCustom = 0x020,
eShowHisto = 0x040,
eShowSave = 0x080,
eShowDefineSubCamera = 0x100,
eShowFilledRaster = 0x200,
eShowDefineLoadBox = 0x400,
eShowUseLoadBox = 0x800,
eShowViewerControls = 0x1000,
eShowSound = 0x2000,
eShowLocator = 0x4000,
eShowHowMany = 0x8000
};
FlipConsole::FlipConsole(QVBoxLayout *mainLayout, std::vector<int> gadgetsMask,
bool isLinkable, QWidget *customWidget,
const QString &customizeId,
@ -488,8 +466,10 @@ FlipConsole::FlipConsole(QVBoxLayout *mainLayout, std::vector<int> gadgetsMask,
, m_fpsLabel(0)
, m_consoleOwner(consoleOwner)
, m_enableBlankFrameButton(0) {
QString s = QSettings().value(m_customizeId).toString();
if (s != "") m_customizeMask = s.toUInt();
if (m_customizeId != "SceneViewerConsole") {
QString s = QSettings().value(m_customizeId).toString();
if (s != "") m_customizeMask = s.toUInt();
}
if (m_gadgetsMask.size() == 0) return;
@ -774,8 +754,9 @@ bool FlipConsole::drawBlanks(int from, int to) {
if (m_blanksToDraw > 1 ||
(m_blanksToDraw == 0 &&
((m_reverse && m_currentFrame - m_step < from) ||
(!m_reverse && m_currentFrame + m_step >
to)))) // we are on the last frame of the loop
(!m_reverse &&
m_currentFrame + m_step >
to)))) // we are on the last frame of the loop
{
m_blanksToDraw = (m_blanksToDraw == 0 ? m_blanksCount : m_blanksToDraw - 1);
m_settings.m_blankColor = m_blankColor;
@ -878,7 +859,7 @@ void FlipConsole::setCurrentFPS(int val) {
if (m_fps == val) return;
if (val == 0) val = 1;
m_fps = val;
m_fps = val;
m_fpsField->setValue(m_fps);
if (m_playbackExecutor.isRunning() || m_isLinkedPlaying)
@ -1018,7 +999,7 @@ void FlipConsole::applyCustomizeMask() {
bool hasDefineLoadBox =
std::find(m_gadgetsMask.begin(), m_gadgetsMask.end(), eDefineLoadBox) ==
m_gadgetsMask.end();
bool hasUseLoadBox = std::find(m_gadgetsMask.begin(), m_gadgetsMask.end(),
bool hasUseLoadBox = std::find(m_gadgetsMask.begin(), m_gadgetsMask.end(),
eUseLoadBox) == m_gadgetsMask.end();
bool hasDefineSubCam = std::find(m_gadgetsMask.begin(), m_gadgetsMask.end(),
eDefineSubCamera) == m_gadgetsMask.end();
@ -1096,6 +1077,48 @@ void FlipConsole::applyCustomizeMask() {
//----------------------------------------------------------------------------------------------
void FlipConsole::setCustomizemask(UINT mask) {
m_customizeMask = mask;
applyCustomizeMask();
for (QAction *action : m_menu->actions()) {
UINT id = action->data().toUInt();
switch (id) {
case eShowCompare:
action->setChecked(m_customizeMask & id);
case eShowBg:
action->setChecked(m_customizeMask & id);
case eShowFramerate:
action->setChecked(m_customizeMask & id);
case eShowVcr:
action->setChecked(m_customizeMask & id);
case eShowcolorFilter:
action->setChecked(m_customizeMask & id);
case eShowCustom:
action->setChecked(m_customizeMask & id);
case eShowHisto:
action->setChecked(m_customizeMask & id);
case eShowSave:
action->setChecked(m_customizeMask & id);
case eShowDefineSubCamera:
action->setChecked(m_customizeMask & id);
case eShowFilledRaster:
action->setChecked(m_customizeMask & id);
case eShowDefineLoadBox:
action->setChecked(m_customizeMask & id);
case eShowUseLoadBox:
action->setChecked(m_customizeMask & id);
case eShowViewerControls:
action->setChecked(m_customizeMask & id);
case eShowSound:
action->setChecked(m_customizeMask & id);
case eShowLocator:
action->setChecked(m_customizeMask & id);
}
}
}
//----------------------------------------------------------------------------------------------
void FlipConsole::createCustomizeMenu(bool withCustomWidget) {
if (hasButton(m_gadgetsMask, eCustomize)) {
QIcon icon = createQIcon("options");
@ -1162,6 +1185,7 @@ void FlipConsole::createCustomizeMenu(bool withCustomWidget) {
bool ret = connect(menu, SIGNAL(triggered(QAction *)), this,
SLOT(onCustomizeButtonPressed(QAction *)));
assert(ret);
m_menu = menu;
}
}
@ -1579,7 +1603,7 @@ void FlipConsole::doButtonPressed(UINT button) {
if (m_currentFrame <= from ||
m_currentFrame >=
to) // the first frame of the playback is drawn right now
m_currentFrame = m_reverse ? to : from;
m_currentFrame = m_reverse ? to : from;
m_settings.m_recomputeIfNeeded = true;
m_consoleOwner->onDrawFrame(m_currentFrame, m_settings);
}
@ -1669,7 +1693,7 @@ void FlipConsole::doButtonPressed(UINT button) {
if (isChecked(eGreen) || isChecked(eGGreen))
colorMask = colorMask | TRop::GChan;
if (isChecked(eBlue) || isChecked(eGBlue))
colorMask = colorMask | TRop::BChan;
colorMask = colorMask | TRop::BChan;
if (isChecked(eMatte)) colorMask = colorMask | TRop::MChan;
if (colorMask == (TRop::RChan | TRop::GChan | TRop::BChan) ||