2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
|
|
|
|
#include "toonzqt/keyframenavigator.h"
|
|
|
|
#include "toonzqt/styleselection.h"
|
|
|
|
|
|
|
|
#include "toonzqt/gutil.h"
|
|
|
|
#include "toonz/txsheet.h"
|
|
|
|
#include "toonz/txshcolumn.h"
|
|
|
|
#include "toonz/tstageobjectkeyframe.h"
|
|
|
|
#include "toonz/stageobjectutil.h"
|
2019-08-27 15:55:22 +12:00
|
|
|
#include "toonz/tapplication.h"
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
#include "tpixelutils.h"
|
|
|
|
#include "tfx.h"
|
|
|
|
#include "tparamcontainer.h"
|
|
|
|
#include "tspectrumparam.h"
|
|
|
|
#include "ttonecurveparam.h"
|
|
|
|
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QPixmap>
|
|
|
|
#include <QIcon>
|
|
|
|
|
2017-05-09 00:13:29 +12:00
|
|
|
#ifdef _MSC_VER
|
2016-03-19 06:57:51 +13:00
|
|
|
#pragma warning(disable : 4251)
|
|
|
|
#endif
|
|
|
|
|
2016-04-17 17:56:16 +12:00
|
|
|
#include <memory>
|
|
|
|
|
2016-03-19 06:57:51 +13:00
|
|
|
#include <QAction>
|
|
|
|
#include <QMouseEvent>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// KeyframeNavigator
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
KeyframeNavigator::KeyframeNavigator(QWidget *parent, TFrameHandle *frameHandle)
|
2019-08-27 15:55:22 +12:00
|
|
|
: QToolBar(parent), m_frameHandle(frameHandle), m_panel(0) {
|
2016-06-15 18:43:10 +12:00
|
|
|
setLayoutDirection(Qt::LeftToRight);
|
2020-06-05 16:40:15 +12:00
|
|
|
setIconSize(QSize(20, 20));
|
2016-06-15 18:43:10 +12:00
|
|
|
setObjectName("keyFrameNavigator");
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2020-06-05 16:40:15 +12:00
|
|
|
// previous key button
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
QIcon prevKeyIcon = createQIcon("prevkey");
|
|
|
|
m_actPreviewKey = new QAction(prevKeyIcon, tr("Previous Key"), this);
|
2016-06-15 18:43:10 +12:00
|
|
|
connect(m_actPreviewKey, SIGNAL(triggered()), SLOT(togglePrevKeyAct()));
|
|
|
|
addAction(m_actPreviewKey);
|
2017-06-07 00:19:00 +12:00
|
|
|
QWidget *prevWidget = widgetForAction(
|
|
|
|
m_actPreviewKey); // obtain a widget generated from QAction
|
2017-06-05 16:28:00 +12:00
|
|
|
prevWidget->setObjectName("PreviousKey");
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2020-06-05 16:40:15 +12:00
|
|
|
// key off button
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
QIcon keyIcon = createQIcon("key_off");
|
|
|
|
m_actKeyNo = new QAction(keyIcon, tr("Set Key"), this);
|
2016-06-15 18:43:10 +12:00
|
|
|
connect(m_actKeyNo, SIGNAL(triggered()), SLOT(toggleKeyAct()));
|
|
|
|
addAction(m_actKeyNo);
|
2020-06-05 16:40:15 +12:00
|
|
|
QWidget *keyNoWidget =
|
|
|
|
widgetForAction(m_actKeyNo); // obtain a widget generated from QAction
|
|
|
|
keyNoWidget->setObjectName("KeyNo");
|
|
|
|
|
|
|
|
// key partial button
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
QIcon keyPartialIcon = createQIcon("key_partial", true);
|
|
|
|
m_actKeyPartial = new QAction(keyPartialIcon, tr("Set Key"), this);
|
2016-06-15 18:43:10 +12:00
|
|
|
connect(m_actKeyPartial, SIGNAL(triggered()), SLOT(toggleKeyAct()));
|
|
|
|
addAction(m_actKeyPartial);
|
2020-06-05 16:40:15 +12:00
|
|
|
QWidget *keyPartialWidget = widgetForAction(
|
|
|
|
m_actKeyPartial); // obtain a widget generated from QAction
|
|
|
|
keyPartialWidget->setObjectName("KeyPartial");
|
|
|
|
|
|
|
|
// key total button
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
QIcon keyTotalIcon = createQIcon("key_on", true);
|
|
|
|
m_actKeyTotal = new QAction(keyTotalIcon, tr("Set Key"), this);
|
2016-06-15 18:43:10 +12:00
|
|
|
connect(m_actKeyTotal, SIGNAL(triggered()), SLOT(toggleKeyAct()));
|
|
|
|
addAction(m_actKeyTotal);
|
2020-06-05 16:40:15 +12:00
|
|
|
QWidget *keyTotalWidget =
|
|
|
|
widgetForAction(m_actKeyTotal); // obtain a widget generated from QAction
|
|
|
|
keyTotalWidget->setObjectName("KeyTotal");
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2020-06-05 16:40:15 +12:00
|
|
|
// next key button
|
UI update and Icons from Konero (#126)
* add multi arc mockup
* implement mutli arc
* add join and smooth option
* reset multiarc and arc when deactivated
* create self loop if the last point is the same as the first
* make join option in multiarc consistent with tape tool
* fix a bug where thickness don't affect mutliarc in vector level
* remove join option in geometric tool
* stop mutliarc after closing shape
* double click can also end multi arc
* fix a bug where multiArc will produce buggy stroke
* fix a bug where geometric tools is not deactivated
* add multiArc shortcut
* rewrite multiArc
* revert changes to tvectorimage
* add undo data for multiArc
* Paste as Copy Command for XSheet
* Remove unneeded code
* Bug fix
* prevent guide lines from jumping around in MultiArc
* make stroke color consistent in MultiArc
* remove color in MultiArc's undo data
* make color consistent in MultiArc with previous version
* Fix single image raster levels
* fix compilation error
* fix a bug where multiArc might generate bugged stroke
* Remove ICONV dep (#3304)
* fix crash on saving studio palette
* Move to Paste Special Menu
* Don't Set Fixed Width if Docking a Floating Panel
* Update how_to_build_win.md
New draft of pr for requested changes to windows build instructions.
* fix geometric tool multiarc smooth option
* fix level saving failure
* fix wrong warning after saving palette
* fix a bug where moving a control point while holding alt has unintended result
* fix travis-install (#3389)
* Fix assert debug crash in flipconsole.cpp
Fix crash when using the viewer controls in the console (debug)
* Redraw Audio Waveform
Fills the waveform rather than outlines it.
* Update .gitignore
* fix undo data when drawing arc and mutliarc
* fix overwriting raster drawing palette (#3387)
* mode sensitive fx settings
* Create New Style Command Button (#3394)
* Create New Style Command Button
This PR creates a new button in the pallette editor that creates a new style. Button is large and easy access for a faster and easier workflow. Original code developed by Turtletooth for Tahoma. Given permission to develop within Openoonz.
Co-Authored-By: Jeremy Bullock <turtletooth@users.noreply.github.com>
* Update paletteviewergui.cpp
Made changes to the PR per request by Shun.
* Fixed a space within the code that wasn't suppose to be there.
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
* tahoma license (#3396)
* new style button optional
* fix loading pegbars (removing updateKeyframes)
* periodic random expression
* add fx in linear color space
this commit is based on source for the ComposeAdd plugin fx by DWANGO Co., Ltd.
in dwango_opentoonz_plugins and opentoonz_plugin_utility repositories.
* fractal noise iwa fx
* skip unnecessary icon invalidation
* fix frame range fill with tablet
* stop function editor to open by dbl clicking key
* Expanding the radius of the rotation handle.
This just changes when the cursor transforms into the rotation tool.
(cherry picked from commit 7722ae989bbdc6aa5cb48df7a4c08bae1fe6ea39)
* fix vector img patern stroke style
* Update Stylesheets
- Support the new icon sizes
- XSheet and Timeline significantly redesigned
- Lots of margin fixes and refactoring
- Remove deprecated icons, as some icons are moved into binary
- New Light theme
* New Icons
- Redesigns almost every icon as symbolic
- Adds icons for most commands
* Add Option for Icon Themes
- Adds option for icon themes
- Removes useless label from Preferences category list
* Update Icon Functions
- Adds themePath() boolean
- Adds function for recoloring black pixels in pixmaps to any color
- Rebuilds createQIcon to use fromTheme() and recolorPixmap()
- Removes createQIconOnOff as it seemed to be a rarely used duplicate of createQIcon
- Removes a grey horizontal line drawn above the console play bar in the viewer
* Set Default Icon Theme and Paths
- Sets search paths for icons for use with QIcon::fromTheme()
- Sets default start icon theme on first install
- Sets flag for displaying icons in menus, so we can selectively hide them
* Set Icons for Commands
- Sets icons for the commands
- Hides icons being displayed in menus as most icons are 20x20, they will look blurry when shrunk to 16x16
- Selectively allows icons to display for Tools in menus
* Change Icon Sizes, General Fixes and Stylesheet Additions
- Change icon sizes to new size
- Remove margin around FX Editor window
- Remove white line under color sliders in Style Editor
- Make keyframe icons uniform and color stylable in the stylesheets
- Removes deprecated stylesheet strings
- Redesign GUI for palette list view
- Make tree list header sort row stylable
- Remove black lines from scrollbars in New Project window
- Remove margin around combobox in Level Strip
- Alter how some lines are drawn in the Timeline to fix some alpha issues
- Make conditional fixed onion skin and normal onion skin dots contrast more against a light background area to make sure they have good visibility
- Make text always viewable in the FPS field in console bar
- Increase size of radio buttons in Cleanup Settings
- Increase size of switches in motion path nodes
- Remove unessesary "Layer" label in Timeline and other rects
- Various colors made stylable in the stylesheets; palette numpad and selection frame, cleanup settings border, scene cast folder path, schematic lines, ruler, xsheet lines, keyframes, cell input box and more
- Moves some external stylesheet icons into binary
* Make TPanelTitleBar Icon States Stylable
- Makes icon states for TPanelTitleBar buttons stylable in stylesheets
* Travis Fixes
* Swap Startup Popup Logos
They were in the wrong folders
* Revert "Swap Startup Popup Logos"
This reverts commit 815908a9f3e725f48507dab8a2270bdfa045649d.
* Fix Startup Popup Logo
It wasn't switching
* Feedback Changes
- Change render visualization to clapboard
- Fix text contrast on levels in XSheet
* Make Cell Selection More Clear
* Darken Light Theme and Tint Empty Cell Selection
* Fix missing icons
* Fix memo button
* Bring back colors
* Hide Motion Tab
* Fix Play Range Area (Light)
Make play range area more visible
* Vector Column Color
Co-authored-by: pojienie <pojienie@gmail.com>
Co-authored-by: rim <11380091+rozhuk-im@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun.iwasawa@ghibli.jp>
Co-authored-by: Rodney <rodney.baker@gmail.com>
Co-authored-by: DoctorRyan <65507211+DoctorRyan@users.noreply.github.com>
Co-authored-by: shun-iwasawa <shun-iwasawa@users.noreply.github.com>
Co-authored-by: Kite <konero@users.noreply.github.com>
Co-authored-by: Jeremy Bullock <turtletooth@users.noreply.github.com>
Co-authored-by: DoctorRyan <doctorryan1969.gmail.com>
2020-09-01 06:51:22 +12:00
|
|
|
QIcon nextKeyIcon = createQIcon("nextkey");
|
|
|
|
m_actNextKey = new QAction(nextKeyIcon, tr("Next Key"), this);
|
2016-06-15 18:43:10 +12:00
|
|
|
connect(m_actNextKey, SIGNAL(triggered()), SLOT(toggleNextKeyAct()));
|
|
|
|
addAction(m_actNextKey);
|
2017-06-07 00:19:00 +12:00
|
|
|
QWidget *nextWidget =
|
|
|
|
widgetForAction(m_actNextKey); // obtain a widget generated from QAction
|
2017-06-05 16:28:00 +12:00
|
|
|
nextWidget->setObjectName("NextKey");
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void KeyframeNavigator::update() {
|
|
|
|
// Prev button
|
|
|
|
if (hasPrev())
|
|
|
|
m_actPreviewKey->setDisabled(false);
|
|
|
|
else
|
|
|
|
m_actPreviewKey->setDisabled(true);
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool isFullKey = isFullKeyframe();
|
|
|
|
bool isKey = isKeyframe();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
if (isKey && !isFullKey) {
|
|
|
|
m_actKeyNo->setVisible(false);
|
|
|
|
m_actKeyTotal->setVisible(false);
|
|
|
|
m_actKeyPartial->setVisible(true);
|
|
|
|
m_actKeyPartial->setDisabled(false);
|
|
|
|
}
|
|
|
|
if (isFullKey) {
|
|
|
|
m_actKeyNo->setVisible(false);
|
|
|
|
m_actKeyPartial->setVisible(false);
|
|
|
|
m_actKeyTotal->setVisible(true);
|
|
|
|
m_actKeyTotal->setDisabled(false);
|
|
|
|
}
|
|
|
|
if (!isKey && !isFullKey) {
|
|
|
|
m_actKeyPartial->setVisible(false);
|
|
|
|
m_actKeyTotal->setVisible(false);
|
|
|
|
m_actKeyNo->setVisible(true);
|
|
|
|
m_actKeyNo->setDisabled(false);
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
// Next button
|
|
|
|
if (hasNext())
|
|
|
|
m_actNextKey->setDisabled(false);
|
|
|
|
else
|
|
|
|
m_actNextKey->setDisabled(true);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void KeyframeNavigator::showEvent(QShowEvent *e) {
|
|
|
|
update();
|
|
|
|
if (!m_frameHandle) return;
|
|
|
|
connect(m_frameHandle, SIGNAL(frameSwitched()), this, SLOT(update()));
|
2019-08-27 15:55:22 +12:00
|
|
|
|
|
|
|
connect(m_frameHandle, SIGNAL(triggerNextKeyframe(QWidget *)), this,
|
|
|
|
SLOT(onNextKeyframe(QWidget *)));
|
|
|
|
connect(m_frameHandle, SIGNAL(triggerPrevKeyframe(QWidget *)), this,
|
|
|
|
SLOT(onPrevKeyframe(QWidget *)));
|
|
|
|
if (!m_panel || m_panel == nullptr) {
|
|
|
|
QWidget *panel = this->parentWidget();
|
|
|
|
while (panel) {
|
|
|
|
if (panel->windowType() == Qt::WindowType::SubWindow ||
|
|
|
|
panel->windowType() == Qt::WindowType::Tool) {
|
|
|
|
m_panel = panel;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
panel = panel->parentWidget();
|
|
|
|
}
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void KeyframeNavigator::hideEvent(QHideEvent *e) {
|
|
|
|
if (!m_frameHandle) return;
|
|
|
|
disconnect(m_frameHandle);
|
2019-11-11 17:49:00 +13:00
|
|
|
|
|
|
|
disconnect(m_frameHandle, SIGNAL(triggerNextKeyframe(QWidget *)), this,
|
|
|
|
SLOT(onNextKeyframe(QWidget *)));
|
|
|
|
disconnect(m_frameHandle, SIGNAL(triggerPrevKeyframe(QWidget *)), this,
|
|
|
|
SLOT(onPrevKeyframe(QWidget *)));
|
|
|
|
m_panel = nullptr;
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
2019-08-27 15:55:22 +12:00
|
|
|
void KeyframeNavigator::onNextKeyframe(QWidget *panel) {
|
|
|
|
if (!m_panel || m_panel != panel) return;
|
|
|
|
toggleNextKeyAct();
|
|
|
|
}
|
|
|
|
|
|
|
|
void KeyframeNavigator::onPrevKeyframe(QWidget *panel) {
|
|
|
|
if (!m_panel || m_panel != panel) return;
|
|
|
|
togglePrevKeyAct();
|
|
|
|
}
|
|
|
|
|
2016-03-19 06:57:51 +13:00
|
|
|
//=============================================================================
|
|
|
|
// ViewerKeyframeNavigator
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
TStageObject *ViewerKeyframeNavigator::getStageObject() const {
|
|
|
|
if (!m_xsheetHandle || !m_objectHandle) return 0;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
TStageObjectId objectId = m_objectHandle->getObjectId();
|
|
|
|
TXsheet *xsh = m_xsheetHandle->getXsheet();
|
|
|
|
// Se e' una colonna sound non posso settare chiavi
|
|
|
|
if (objectId.isColumn()) {
|
|
|
|
TXshColumn *column = xsh->getColumn(objectId.getIndex());
|
|
|
|
if (column && column->getSoundColumn()) return 0;
|
|
|
|
}
|
|
|
|
return xsh->getStageObject(objectId);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool ViewerKeyframeNavigator::hasNext() const {
|
|
|
|
TStageObject *pegbar = getStageObject();
|
|
|
|
if (!pegbar) return false;
|
|
|
|
int r0, r1;
|
|
|
|
pegbar->getKeyframeRange(r0, r1);
|
|
|
|
return r0 <= r1 && getCurrentFrame() < r1;
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool ViewerKeyframeNavigator::hasPrev() const {
|
|
|
|
TStageObject *pegbar = getStageObject();
|
|
|
|
if (!pegbar) return false;
|
|
|
|
int r0, r1;
|
|
|
|
pegbar->getKeyframeRange(r0, r1);
|
|
|
|
return r0 <= r1 && getCurrentFrame() > r0;
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool ViewerKeyframeNavigator::hasKeyframes() const {
|
|
|
|
TStageObject *pegbar = getStageObject();
|
|
|
|
if (!pegbar) return false;
|
|
|
|
int r0, r1;
|
|
|
|
pegbar->getKeyframeRange(r0, r1);
|
|
|
|
return r0 <= r1;
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool ViewerKeyframeNavigator::isKeyframe() const {
|
|
|
|
TStageObject *pegbar = getStageObject();
|
|
|
|
if (!pegbar) return false;
|
|
|
|
return pegbar->isKeyframe(getCurrentFrame());
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool ViewerKeyframeNavigator::isFullKeyframe() const {
|
|
|
|
TStageObject *pegbar = getStageObject();
|
|
|
|
if (!pegbar) return false;
|
|
|
|
return pegbar->isFullKeyframe(getCurrentFrame());
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void ViewerKeyframeNavigator::toggle() {
|
|
|
|
TStageObject *pegbar = getStageObject();
|
|
|
|
if (!pegbar) return;
|
|
|
|
int frame = getCurrentFrame();
|
|
|
|
|
|
|
|
if (pegbar->isFullKeyframe(frame)) {
|
|
|
|
TStageObject::Keyframe key = pegbar->getKeyframe(frame);
|
|
|
|
pegbar->removeKeyframeWithoutUndo(frame);
|
|
|
|
UndoRemoveKeyFrame *undo =
|
|
|
|
new UndoRemoveKeyFrame(pegbar->getId(), frame, key, m_xsheetHandle);
|
|
|
|
undo->setObjectHandle(m_objectHandle);
|
|
|
|
TUndoManager::manager()->add(undo);
|
|
|
|
} else {
|
|
|
|
UndoSetKeyFrame *undo =
|
|
|
|
new UndoSetKeyFrame(pegbar->getId(), frame, m_xsheetHandle);
|
|
|
|
pegbar->setKeyframeWithoutUndo(frame);
|
|
|
|
undo->setObjectHandle(m_objectHandle);
|
|
|
|
TUndoManager::manager()->add(undo);
|
|
|
|
}
|
|
|
|
m_objectHandle->notifyObjectIdChanged(false);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void ViewerKeyframeNavigator::goNext() {
|
|
|
|
TStageObject *pegbar = getStageObject();
|
|
|
|
if (!pegbar) return;
|
|
|
|
int frame = getCurrentFrame();
|
|
|
|
TStageObject::KeyframeMap keyframes;
|
|
|
|
pegbar->getKeyframes(keyframes);
|
|
|
|
TStageObject::KeyframeMap::iterator it;
|
|
|
|
for (it = keyframes.begin(); it != keyframes.end(); ++it)
|
|
|
|
if (it->first > frame) {
|
|
|
|
setCurrentFrame(it->first);
|
|
|
|
return;
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void ViewerKeyframeNavigator::goPrev() {
|
|
|
|
TStageObject *pegbar = getStageObject();
|
|
|
|
if (!pegbar) return;
|
|
|
|
int frame = getCurrentFrame();
|
|
|
|
TStageObject::KeyframeMap keyframes;
|
|
|
|
pegbar->getKeyframes(keyframes);
|
|
|
|
TStageObject::KeyframeMap::reverse_iterator it;
|
|
|
|
for (it = keyframes.rbegin(); it != keyframes.rend(); ++it)
|
|
|
|
if (it->first < frame) {
|
|
|
|
setCurrentFrame(it->first);
|
|
|
|
return;
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void ViewerKeyframeNavigator::showEvent(QShowEvent *e) {
|
|
|
|
if (!m_objectHandle) return;
|
|
|
|
connect(m_objectHandle, SIGNAL(objectSwitched()), this, SLOT(update()));
|
|
|
|
connect(m_objectHandle, SIGNAL(objectChanged(bool)), this, SLOT(update()));
|
|
|
|
KeyframeNavigator::showEvent(e);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void ViewerKeyframeNavigator::hideEvent(QHideEvent *e) {
|
|
|
|
if (!m_objectHandle) return;
|
|
|
|
disconnect(m_objectHandle);
|
|
|
|
KeyframeNavigator::hideEvent(e);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
2016-06-15 18:43:10 +12:00
|
|
|
namespace {
|
2016-03-19 06:57:51 +13:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-29 18:17:12 +12:00
|
|
|
class UndoPaletteSetKeyFrame final : public TUndo {
|
2016-06-15 18:43:10 +12:00
|
|
|
int m_frame;
|
|
|
|
int m_styleId;
|
|
|
|
TPaletteHandle *m_paletteHandle;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
public:
|
2016-06-15 18:43:10 +12:00
|
|
|
UndoPaletteSetKeyFrame(int styleId, int frame, TPaletteHandle *paletteHandle)
|
|
|
|
: m_frame(frame), m_styleId(styleId), m_paletteHandle(paletteHandle) {}
|
|
|
|
|
2016-06-19 20:06:29 +12:00
|
|
|
void undo() const override { setKeyFrame(); }
|
|
|
|
void redo() const override { setKeyFrame(); }
|
|
|
|
int getSize() const override { return sizeof(*this); }
|
2016-03-19 06:57:51 +13:00
|
|
|
|
|
|
|
protected:
|
2016-06-15 18:43:10 +12:00
|
|
|
void setKeyFrame() const {
|
|
|
|
TPalette *palette = m_paletteHandle->getPalette();
|
|
|
|
if (palette->isKeyframe(m_styleId, m_frame))
|
|
|
|
palette->clearKeyframe(m_styleId, m_frame);
|
|
|
|
else
|
|
|
|
palette->setKeyframe(m_styleId, m_frame);
|
|
|
|
m_paletteHandle->notifyPaletteChanged();
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
};
|
|
|
|
//-----------------------------------------------------------------------------
|
2016-06-15 18:43:10 +12:00
|
|
|
} // namespace
|
2016-03-19 06:57:51 +13:00
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// PaletteKeyframeNavigator
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool PaletteKeyframeNavigator::hasNext() const {
|
|
|
|
TPalette *palette = getPalette();
|
2020-10-22 04:01:28 +13:00
|
|
|
if (!palette || palette->getStyleCount() < 1) return false;
|
2016-06-15 18:43:10 +12:00
|
|
|
int styleId = getStyleIndex();
|
|
|
|
int frame = getCurrentFrame();
|
|
|
|
int n = palette->getKeyframeCount(styleId);
|
|
|
|
for (int i = n - 1; i >= 0; i--) {
|
|
|
|
int f = palette->getKeyframe(styleId, i);
|
|
|
|
if (f > frame)
|
|
|
|
return true;
|
|
|
|
else if (f <= frame)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return false;
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool PaletteKeyframeNavigator::hasPrev() const {
|
|
|
|
TPalette *palette = getPalette();
|
2020-10-22 04:01:28 +13:00
|
|
|
if (!palette || palette->getStyleCount() < 1) return false;
|
2016-06-15 18:43:10 +12:00
|
|
|
int styleId = getStyleIndex();
|
|
|
|
int frame = getCurrentFrame();
|
|
|
|
int n = palette->getKeyframeCount(styleId);
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
|
|
int f = palette->getKeyframe(styleId, i);
|
|
|
|
if (f < frame)
|
|
|
|
return true;
|
|
|
|
else if (f >= frame)
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return false;
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool PaletteKeyframeNavigator::hasKeyframes() const {
|
|
|
|
TPalette *palette = getPalette();
|
|
|
|
if (!palette) return false;
|
|
|
|
return palette->getKeyframeCount(getStyleIndex()) > 0;
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool PaletteKeyframeNavigator::isKeyframe() const {
|
|
|
|
TPalette *palette = getPalette();
|
2020-10-22 04:01:28 +13:00
|
|
|
if (!palette || palette->getStyleCount() < 1) return false;
|
2016-06-15 18:43:10 +12:00
|
|
|
int frame = getCurrentFrame();
|
|
|
|
return palette->isKeyframe(getStyleIndex(), frame);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void PaletteKeyframeNavigator::toggle() {
|
|
|
|
TPalette *palette = getPalette();
|
|
|
|
if (!palette) return;
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
int styleId = getStyleIndex(), frame = getCurrentFrame();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-07-21 00:49:32 +12:00
|
|
|
std::unique_ptr<UndoPaletteSetKeyFrame> undo(
|
2016-06-15 18:43:10 +12:00
|
|
|
new UndoPaletteSetKeyFrame(styleId, frame, m_paletteHandle));
|
|
|
|
undo->redo();
|
2016-03-19 06:57:51 +13:00
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
TUndoManager::manager()->add(undo.release());
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void PaletteKeyframeNavigator::goNext() {
|
|
|
|
TPalette *palette = getPalette();
|
|
|
|
if (!palette) return;
|
|
|
|
int styleId = getStyleIndex();
|
|
|
|
int frame = getCurrentFrame();
|
|
|
|
int n = palette->getKeyframeCount(styleId);
|
|
|
|
for (int i = 0; i < n; i++) {
|
|
|
|
int f = palette->getKeyframe(styleId, i);
|
|
|
|
if (f > frame) {
|
|
|
|
setCurrentFrame(f);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void PaletteKeyframeNavigator::goPrev() {
|
|
|
|
TPalette *palette = getPalette();
|
|
|
|
if (!palette) return;
|
|
|
|
int styleId = getStyleIndex();
|
|
|
|
int frame = getCurrentFrame();
|
|
|
|
int n = palette->getKeyframeCount(styleId);
|
|
|
|
for (int i = n - 1; i >= 0; i--) {
|
|
|
|
int f = palette->getKeyframe(styleId, i);
|
|
|
|
if (f < frame) {
|
|
|
|
setCurrentFrame(f);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void PaletteKeyframeNavigator::showEvent(QShowEvent *e) {
|
|
|
|
if (!m_paletteHandle) return;
|
|
|
|
connect(m_paletteHandle, SIGNAL(paletteSwitched()), this, SLOT(update()));
|
|
|
|
connect(m_paletteHandle, SIGNAL(paletteChanged()), this, SLOT(update()));
|
|
|
|
connect(m_paletteHandle, SIGNAL(colorStyleSwitched()), this, SLOT(update()));
|
|
|
|
KeyframeNavigator::showEvent(e);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
void PaletteKeyframeNavigator::hideEvent(QHideEvent *e) {
|
|
|
|
if (!m_paletteHandle) return;
|
|
|
|
disconnect(m_paletteHandle);
|
|
|
|
KeyframeNavigator::hideEvent(e);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|
|
|
|
|
|
|
|
//=============================================================================
|
2016-06-15 18:43:10 +12:00
|
|
|
namespace {
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
//! Se non c'e' un keyframe successivo ritorna frame
|
|
|
|
int getNextKeyframe(TFxP fx, int frame) {
|
|
|
|
if (!fx) return frame;
|
|
|
|
int targetFrame = frame;
|
|
|
|
for (int i = 0; i < fx->getParams()->getParamCount(); i++) {
|
|
|
|
TParamP param = fx->getParams()->getParam(i);
|
|
|
|
int j = param->getNextKeyframe(frame);
|
|
|
|
if (j < 0) continue;
|
|
|
|
int f = (int)param->keyframeIndexToFrame(j);
|
|
|
|
if (targetFrame == frame || f < targetFrame) targetFrame = f;
|
|
|
|
}
|
|
|
|
return targetFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
//! Se non c'e' un keyframe precedente ritorna frame
|
|
|
|
int getPrevKeyframe(TFxP fx, int frame) {
|
|
|
|
if (!fx) return frame;
|
|
|
|
int targetFrame = frame;
|
|
|
|
for (int i = 0; i < fx->getParams()->getParamCount(); i++) {
|
|
|
|
TParamP param = fx->getParams()->getParam(i);
|
|
|
|
int j = param->getPrevKeyframe(frame);
|
|
|
|
if (j < 0) continue;
|
|
|
|
int f = (int)param->keyframeIndexToFrame(j);
|
|
|
|
if (targetFrame == frame || f > targetFrame) targetFrame = f;
|
|
|
|
}
|
|
|
|
return targetFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void setKeyframe(TFxP fx, int frame, bool on) {
|
|
|
|
if (fx)
|
|
|
|
for (int i = 0; i < fx->getParams()->getParamCount(); i++) {
|
|
|
|
TParamP param = fx->getParams()->getParam(i);
|
|
|
|
if (TDoubleParamP dp = param) {
|
|
|
|
if (on)
|
|
|
|
dp->setValue(frame, dp->getValue(frame));
|
|
|
|
else
|
|
|
|
dp->deleteKeyframe(frame);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
} // anonymous namespace
|
2016-03-19 06:57:51 +13:00
|
|
|
//=============================================================================
|
|
|
|
|
|
|
|
//=============================================================================
|
|
|
|
// FxKeyframeNavigator
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2016-06-15 18:43:10 +12:00
|
|
|
bool FxKeyframeNavigator::hasNext() const {
|
|
|
|
TFx *fx = getFx();
|
|
|
|
if (!fx)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return getNextKeyframe(fx, getCurrentFrame()) > getCurrentFrame();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool FxKeyframeNavigator::hasPrev() const {
|
|
|
|
TFx *fx = getFx();
|
|
|
|
if (!fx)
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return getPrevKeyframe(fx, getCurrentFrame()) < getCurrentFrame();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool FxKeyframeNavigator::hasKeyframes() const {
|
|
|
|
TFx *fx = getFx();
|
|
|
|
if (!fx) return false;
|
|
|
|
for (int i = 0; i < fx->getParams()->getParamCount(); i++) {
|
|
|
|
TParamP param = fx->getParams()->getParam(i);
|
|
|
|
if (param->hasKeyframes()) return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool FxKeyframeNavigator::isKeyframe() const {
|
|
|
|
TFx *fx = getFx();
|
|
|
|
if (!fx) return false;
|
|
|
|
for (int i = 0; i < fx->getParams()->getParamCount(); i++) {
|
|
|
|
TParamP param = fx->getParams()->getParam(i);
|
|
|
|
if (param->isKeyframe(getCurrentFrame())) return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
bool FxKeyframeNavigator::isFullKeyframe() const {
|
|
|
|
TFx *fx = getFx();
|
|
|
|
if (!fx) return false;
|
|
|
|
int keyFrameCount = 0;
|
|
|
|
int animatableParamCount = 0;
|
|
|
|
for (int i = 0; i < fx->getParams()->getParamCount(); i++) {
|
|
|
|
TParamP param = fx->getParams()->getParam(i);
|
|
|
|
if (param->isAnimatable()) {
|
|
|
|
animatableParamCount++;
|
|
|
|
if (param->isKeyframe(getCurrentFrame())) keyFrameCount++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return animatableParamCount > 0 && keyFrameCount == animatableParamCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void FxKeyframeNavigator::toggle() {
|
|
|
|
TFx *fx = getFx();
|
|
|
|
if (!fx) return;
|
|
|
|
int i, paramCount = fx->getParams()->getParamCount();
|
|
|
|
|
|
|
|
// determino in quale caso ci troviamo:
|
|
|
|
// il frame corrente non e' keyframe di nessun parametro (isKeyframe=false),
|
|
|
|
// di qualche parametro o di tutti i parametri (isFullKeyframe=true)
|
|
|
|
bool isFullKeyframe = true;
|
|
|
|
bool isKeyframe = false;
|
|
|
|
int frame = getCurrentFrame();
|
|
|
|
for (i = 0; i < paramCount; i++) {
|
|
|
|
TParamP param = fx->getParams()->getParam(i);
|
|
|
|
if (!param->isAnimatable()) continue;
|
|
|
|
if (param->isKeyframe(frame))
|
|
|
|
isKeyframe = true;
|
|
|
|
else
|
|
|
|
isFullKeyframe = false;
|
|
|
|
}
|
|
|
|
if (!isKeyframe) isFullKeyframe = false;
|
|
|
|
|
|
|
|
// modifico lo stato: nokeyframe->full, full->no, partial->full
|
2020-04-12 17:19:20 +12:00
|
|
|
bool on = (!isKeyframe || (isKeyframe && !isFullKeyframe));
|
2016-06-15 18:43:10 +12:00
|
|
|
for (i = 0; i < fx->getParams()->getParamCount();
|
|
|
|
i++) { // TODO. spostare questo codice in TParam
|
|
|
|
TParamP param = fx->getParams()->getParam(i);
|
|
|
|
if (TDoubleParamP dp = param) {
|
|
|
|
if (on)
|
|
|
|
dp->setValue(frame, dp->getValue(frame));
|
|
|
|
else
|
|
|
|
dp->deleteKeyframe(frame);
|
|
|
|
} else if (TRangeParamP rp = param) {
|
|
|
|
if (on)
|
|
|
|
rp->setValue(frame, rp->getValue(frame));
|
|
|
|
else
|
|
|
|
rp->deleteKeyframe(frame);
|
|
|
|
} else if (TPointParamP pp = param) {
|
|
|
|
if (on)
|
|
|
|
pp->setValue(frame, pp->getValue(frame));
|
|
|
|
else
|
|
|
|
pp->deleteKeyframe(frame);
|
|
|
|
} else if (TPixelParamP pip = param) {
|
|
|
|
if (on)
|
|
|
|
pip->setValue(frame, pip->getValue(frame));
|
|
|
|
else
|
|
|
|
pip->deleteKeyframe(frame);
|
|
|
|
} else if (TSpectrumParamP sp = param) {
|
|
|
|
if (on)
|
|
|
|
sp->setValue(frame, sp->getValue(frame), false);
|
|
|
|
else
|
|
|
|
sp->deleteKeyframe(frame);
|
|
|
|
} else if (TToneCurveParamP tcp = param) {
|
|
|
|
if (on)
|
|
|
|
tcp->setValue(frame, tcp->getValue(frame), false);
|
|
|
|
else
|
|
|
|
tcp->deleteKeyframe(frame);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
m_fxHandle->notifyFxChanged();
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void FxKeyframeNavigator::goNext() {
|
|
|
|
TFx *fx = getFx();
|
|
|
|
if (!fx) return;
|
|
|
|
int frame = getNextKeyframe(fx, getCurrentFrame());
|
|
|
|
if (frame > getCurrentFrame()) {
|
|
|
|
setCurrentFrame(frame);
|
|
|
|
// m_fxHandle->notifyFxChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void FxKeyframeNavigator::goPrev() {
|
|
|
|
TFx *fx = getFx();
|
|
|
|
if (!fx) return;
|
|
|
|
int frame = getPrevKeyframe(fx, getCurrentFrame());
|
|
|
|
if (frame < getCurrentFrame()) {
|
|
|
|
setCurrentFrame(frame);
|
|
|
|
// m_fxHandle->notifyFxChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void FxKeyframeNavigator::showEvent(QShowEvent *e) {
|
|
|
|
if (!m_fxHandle) return;
|
|
|
|
connect(m_fxHandle, SIGNAL(fxSwitched()), this, SLOT(update()));
|
|
|
|
connect(m_fxHandle, SIGNAL(fxChanged()), this, SLOT(update()));
|
|
|
|
KeyframeNavigator::showEvent(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void FxKeyframeNavigator::hideEvent(QHideEvent *e) {
|
|
|
|
if (!m_fxHandle) return;
|
|
|
|
disconnect(m_fxHandle);
|
|
|
|
KeyframeNavigator::hideEvent(e);
|
2016-03-19 06:57:51 +13:00
|
|
|
}
|