Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

new Fill Tool - Pick+Freehand

justburner8221ad2931ed
diff --git a/toonz/sources/include/tools/cursors.h b/toonz/sources/include/tools/cursors.h
index b1569977d..a741def20 100644
--- a/toonz/sources/include/tools/cursors.h
+++ b/toonz/sources/include/tools/cursors.h
@@ -99,6 +99,7 @@ enum {
Ex_Precise = 0x200000,
Ex_Prev = 0x400000,
Ex_Next = 0x800000,
+ Ex_FreePick = 0x1000000,
// This section is for cursors that have fixed text that needs to
// be handled separately when flipping for left-handed cursors.
diff --git a/toonz/sources/tnztools/Resources/ex_freepick.png b/toonz/sources/tnztools/Resources/ex_freepick.png
new file mode 100644
index 000000000..b47c3ca83
Binary files /dev/null and b/toonz/sources/tnztools/Resources/ex_freepick.png differ
diff --git a/toonz/sources/tnztools/Resources/ex_freepick_left.png b/toonz/sources/tnztools/Resources/ex_freepick_left.png
new file mode 100644
index 000000000..3aabc3561
Binary files /dev/null and b/toonz/sources/tnztools/Resources/ex_freepick_left.png differ
diff --git a/toonz/sources/tnztools/cursormanager.cpp b/toonz/sources/tnztools/cursormanager.cpp
index 24531fabc..4d08188c1 100644
--- a/toonz/sources/tnztools/cursormanager.cpp
+++ b/toonz/sources/tnztools/cursormanager.cpp
@@ -119,6 +119,7 @@ const struct {
{ToolCursor::Ex_Precise, "ex_precise"},
{ToolCursor::Ex_Prev, "ex_prev"},
{ToolCursor::Ex_Next, "ex_next"},
+ {ToolCursor::Ex_FreePick, "ex_freepick"},
{0, 0}};
}; // namespace
diff --git a/toonz/sources/tnztools/filltool.cpp b/toonz/sources/tnztools/filltool.cpp
index ee942bedc..2b6d78f53 100644
--- a/toonz/sources/tnztools/filltool.cpp
+++ b/toonz/sources/tnztools/filltool.cpp
@@ -58,6 +58,7 @@ using namespace ToolUtils;
#define RECTFILL L"Rectangular"
#define FREEHANDFILL L"Freehand"
#define POLYLINEFILL L"Polyline"
+#define FREEPICKFILL L"Freepick"
TEnv::IntVar MinFillDepth("InknpaintMinFillDepth", 0);
TEnv::IntVar MaxFillDepth("InknpaintMaxFillDepth", 10);
@@ -1229,7 +1230,8 @@ void AreaFillTool::draw() {
drawRect(m_firstRect, color, 0x3F33, true);
if (m_selecting || (m_frameRange && !m_firstFrameSelected))
drawRect(m_selectingRect, color, 0xFFFF, true);
- } else if ((m_type == FREEHAND || m_type == POLYLINE) && m_frameRange) {
+ } else if ((m_type == FREEHAND || m_type == POLYLINE || m_type == FREEPICK) &&
+ m_frameRange) {
tglColor(color);
if (m_firstStroke) drawStrokeCenterline(*m_firstStroke, 1);
}
@@ -1243,7 +1245,7 @@ void AreaFillTool::draw() {
tglVertex(m_mousePosition);
glEnd();
glPopMatrix();
- } else if (m_type == FREEHAND && !m_track.isEmpty()) {
+ } else if ((m_type == FREEHAND || m_type == FREEPICK) && !m_track.isEmpty()) {
tglColor(TPixel::Red);
glPushMatrix();
m_track.drawAllFragments();
@@ -1251,6 +1253,36 @@ void AreaFillTool::draw() {
}
}
+int AreaFillTool::pick(const TImageP &image, const TPointD &pos,
+ const int frame, int mode) {
+ TToonzImageP ti = image;
+ TVectorImageP vi = image;
+ if (!ti && !vi) return 0;
+
+ TTool::Viewer *viewer = m_parent->getViewer();
+
+ StylePicker picker(viewer->viewerWidget(), image);
+ double scale2 = 1.0;
+ if (vi) {
+ TAffine aff =
+ viewer->getViewMatrix() * m_parent->getCurrentColumnMatrix(frame);
+ scale2 = aff.det();
+ }
+ TPointD pickPos = pos;
+ // in case that the column is animated in scene-editing mode
+ if (frame > 0) {
+ TPointD dpiScale = viewer->getDpiScale();
+ pickPos.x *= dpiScale.x;
+ pickPos.y *= dpiScale.y;
+ TPointD worldPos = m_parent->getCurrentColumnMatrix() * pickPos;
+ pickPos = m_parent->getCurrentColumnMatrix(frame).inv() * worldPos;
+ pickPos.x /= dpiScale.x;
+ pickPos.y /= dpiScale.y;
+ }
+ // thin stroke can be picked with 10 pixel range
+ return picker.pickStyleId(pickPos, 10.0, scale2, mode);
+}
+
void AreaFillTool::resetMulti() {
m_firstFrameSelected = false;
m_firstRect.empty();
@@ -1265,7 +1297,7 @@ void AreaFillTool::resetMulti() {
}
}
-void AreaFillTool::leftButtonDown(const TPointD &pos, const TMouseEvent &,
+void AreaFillTool::leftButtonDown(const TPointD &pos, const TMouseEvent &e,
TImage *img) {
TVectorImageP vi = TImageP(img);
TToonzImageP ti = TToonzImageP(img);
@@ -1275,13 +1307,23 @@ void AreaFillTool::leftButtonDown(const TPointD &pos, const TMouseEvent &,
return;
}
+ if (m_type == FREEPICK) {
+ TTool::Application *app = TTool::getApplication();
+ if (!app) return;
+
+ int fllmode = e.isCtrlPressed() ? 2 : 0; // Line+Area : Area
+ int styleId = pick(img, pos, -1, fllmode);
+ if (!m_isLeftButtonPressed) m_bckStyleId = app->getCurrentLevelStyleIndex();
+ app->setCurrentLevelStyleIndex(styleId);
+ }
+
m_selecting = true;
if (m_type == RECT) {
m_selectingRect.x0 = pos.x;
m_selectingRect.y0 = pos.y;
m_selectingRect.x1 = pos.x + 1;
m_selectingRect.y1 = pos.y + 1;
- } else if (m_type == FREEHAND || m_type == POLYLINE) {
+ } else if (m_type == FREEHAND || m_type == POLYLINE || m_type == FREEPICK) {
int col = TTool::getApplication()->getCurrentColumn()->getColumnIndex();
m_isPath = TTool::getApplication()
->getCurrentObject()
@@ -1389,7 +1431,7 @@ void AreaFillTool::leftButtonDrag(const TPointD &pos, const TMouseEvent &e) {
m_selectingRect.x1 = pos.x;
m_selectingRect.y1 = pos.y;
m_parent->invalidate();
- } else if (m_type == FREEHAND) {
+ } else if (m_type == FREEHAND || m_type == FREEPICK) {
if (!m_enabled || !m_active) return;
double pixelSize2 = m_parent->getPixelSize() * m_parent->getPixelSize();
@@ -1463,7 +1505,7 @@ void AreaFillTool::leftButtonUp(const TPointD &pos, const TMouseEvent &e) {
TTool *t = app->getCurrentTool()->getTool();
if (t) t->notifyImageChanged();
}
- } else if (m_type == FREEHAND) {
+ } else if (m_type == FREEHAND || m_type == FREEPICK) {
#if defined(MACOSX)
// m_parent->m_viewer->enableRedraw(true);
#endif
@@ -1527,6 +1569,8 @@ void AreaFillTool::leftButtonUp(const TPointD &pos, const TMouseEvent &e) {
m_parent->invalidate();
}
}
+
+ if (m_type == FREEPICK) app->setCurrentLevelStyleIndex(m_bckStyleId);
}
void AreaFillTool::onImageChanged() {
@@ -1544,7 +1588,7 @@ void AreaFillTool::onImageChanged() {
// stato iniziale
else { // cambio stato.
m_firstFrameSelected = true;
- if (m_type != FREEHAND && m_type != POLYLINE) {
+ if (m_type != FREEHAND && m_type != POLYLINE && m_type != FREEPICK) {
assert(!m_selectingRect.isEmpty());
m_firstRect = m_selectingRect;
}
@@ -1740,6 +1784,7 @@ FillTool::FillTool(int targetType)
m_fillType.addValue(RECTFILL);
m_fillType.addValue(FREEHANDFILL);
m_fillType.addValue(POLYLINEFILL);
+ m_fillType.addValue(FREEPICKFILL);
m_prop.bind(m_colorType);
m_colorType.addValue(LINES);
@@ -1784,6 +1829,8 @@ int FillTool::getCursorId() const {
ret = ret | ToolCursor::Ex_PolyLine;
else if (m_fillType.getValue() == RECTFILL)
ret = ret | ToolCursor::Ex_Rectangle;
+ if (m_fillType.getValue() == FREEPICKFILL)
+ ret = ret | ToolCursor::Ex_FreePick;
if (ToonzCheck::instance()->getChecks() & ToonzCheck::eBlackBg)
ret = ret | ToolCursor::Ex_Negate;
@@ -1800,6 +1847,7 @@ void FillTool::updateTranslation() {
m_fillType.setItemUIName(RECTFILL, tr("Rectangular"));
m_fillType.setItemUIName(FREEHANDFILL, tr("Freehand"));
m_fillType.setItemUIName(POLYLINEFILL, tr("Polyline"));
+ m_fillType.setItemUIName(FREEPICKFILL, tr("Pick+Freehand"));
m_selective.setQStringName(tr("Selective"));
@@ -2090,6 +2138,8 @@ bool FillTool::onPropertyChanged(std::string propertyName) {
type = AreaFillTool::FREEHAND;
else if (m_fillType.getValue() == POLYLINEFILL)
type = AreaFillTool::POLYLINE;
+ else if (m_fillType.getValue() == FREEPICKFILL)
+ type = AreaFillTool::FREEPICK;
else
assert(false);
@@ -2294,6 +2344,8 @@ void FillTool::onActivate() {
type = AreaFillTool::FREEHAND;
else if (m_fillType.getValue() == POLYLINEFILL)
type = AreaFillTool::POLYLINE;
+ else if (m_fillType.getValue() == FREEPICKFILL)
+ type = AreaFillTool::FREEPICK;
else
assert(false);
diff --git a/toonz/sources/tnztools/filltool.h b/toonz/sources/tnztools/filltool.h
index 32342b74c..80bdd67e7 100644
--- a/toonz/sources/tnztools/filltool.h
+++ b/toonz/sources/tnztools/filltool.h
@@ -24,7 +24,7 @@ class NormalLineFillTool;
namespace {
class AreaFillTool {
public:
- enum Type { RECT, FREEHAND, POLYLINE };
+ enum Type { RECT, FREEHAND, POLYLINE, FREEPICK };
private:
bool m_frameRange;
@@ -54,9 +54,12 @@ private:
bool m_isLeftButtonPressed;
bool m_autopaintLines;
+ int m_bckStyleId;
+
public:
AreaFillTool(TTool *Parent);
void draw();
+ int pick(const TImageP &image, const TPointD &pos, const int frame, int mode);
void resetMulti();
void leftButtonDown(const TPointD &pos, const TMouseEvent &, TImage *img);
void leftButtonDoubleClick(const TPointD &pos, const TMouseEvent &e);
diff --git a/toonz/sources/tnztools/tnztools.qrc b/toonz/sources/tnztools/tnztools.qrc
index 7370ccc49..e333b8332 100644
--- a/toonz/sources/tnztools/tnztools.qrc
+++ b/toonz/sources/tnztools/tnztools.qrc
@@ -1,5 +1,5 @@
<RCC>
- <qresource prefix="/" >
+ <qresource prefix="/" >
<file>Resources/brush.png</file>
<file>Resources/bender.png</file>
<file>Resources/cutter.png</file>
@@ -33,59 +33,61 @@
<file>Resources/selection_add.png</file>
<file>Resources/selection_convert.png</file>
<file>Resources/selection_distort.png</file>
- <file>Resources/move_ew.png</file>
- <file>Resources/move_ns.png</file>
- <file>Resources/disable.png</file>
- <file>Resources/move_z.png</file>
- <file>Resources/picker_style_line.png</file>
- <file>Resources/picker_style_area.png</file>
- <file>Resources/picker_style.png</file>
- <file>Resources/scale_global.png</file>
- <file>Resources/scale_hv.png</file>
- <file>Resources/normaleraser.png</file>
- <file>Resources/recteraser.png</file>
- <file>Resources/picker_style_organize.png</file>
- <file>Resources/picker_rgb.png</file>
- <file>Resources/picker_rgb_white.png</file>
- <file>Resources/pointing_hand.png</file>
- <file>Resources/karasu.png</file>
- <file>Resources/ruler_modify.png</file>
- <file>Resources/ruler_new.png</file>
- <file>Resources/ex_freehand.png</file>
- <file>Resources/ex_freehand_left.png</file>
- <file>Resources/ex_polyline.png</file>
- <file>Resources/ex_polyline_left.png</file>
- <file>Resources/ex_rectangle.png</file>
- <file>Resources/ex_rectangle_left.png</file>
- <file>Resources/ex_line.png</file>
- <file>Resources/ex_line_left.png</file>
- <file>Resources/ex_area.png</file>
- <file>Resources/ex_area_left.png</file>
- <file>Resources/ex_fill_no_autopaint.png</file>
- <file>Resources/ex_fill_no_autopaint_left.png</file>
- <file>Resources/edit_FX_notext.png</file>
- <file>Resources/move_z_notext.png</file>
- <file>Resources/scale_hv_notext.png</file>
- <file>Resources/ex_FX.png</file>
- <file>Resources/ex_FX_left.png</file>
- <file>Resources/ex_hv.png</file>
- <file>Resources/ex_hv_left.png</file>
- <file>Resources/ex_rgb.png</file>
- <file>Resources/ex_rgb_left.png</file>
- <file>Resources/ex_style_area.png</file>
- <file>Resources/ex_style_area_left.png</file>
- <file>Resources/ex_style_line.png</file>
- <file>Resources/ex_style_line_left.png</file>
- <file>Resources/ex_z.png</file>
- <file>Resources/ex_z_left.png</file>
- <file>Resources/ex_precise.png</file>
- <file>Resources/ex_precise_left.png</file>
- <file>Resources/brush_large.png</file>
- <file>Resources/brush_crosshair.png</file>
- <file>Resources/tracker.png</file>
- <file>Resources/ex_prev.png</file>
- <file>Resources/ex_prev_left.png</file>
- <file>Resources/ex_next.png</file>
- <file>Resources/ex_next_left.png</file>
- </qresource>
+ <file>Resources/move_ew.png</file>
+ <file>Resources/move_ns.png</file>
+ <file>Resources/disable.png</file>
+ <file>Resources/move_z.png</file>
+ <file>Resources/picker_style_line.png</file>
+ <file>Resources/picker_style_area.png</file>
+ <file>Resources/picker_style.png</file>
+ <file>Resources/scale_global.png</file>
+ <file>Resources/scale_hv.png</file>
+ <file>Resources/normaleraser.png</file>
+ <file>Resources/recteraser.png</file>
+ <file>Resources/picker_style_organize.png</file>
+ <file>Resources/picker_rgb.png</file>
+ <file>Resources/picker_rgb_white.png</file>
+ <file>Resources/pointing_hand.png</file>
+ <file>Resources/karasu.png</file>
+ <file>Resources/ruler_modify.png</file>
+ <file>Resources/ruler_new.png</file>
+ <file>Resources/ex_freehand.png</file>
+ <file>Resources/ex_freehand_left.png</file>
+ <file>Resources/ex_freepick.png</file>
+ <file>Resources/ex_freepick_left.png</file>
+ <file>Resources/ex_polyline.png</file>
+ <file>Resources/ex_polyline_left.png</file>
+ <file>Resources/ex_rectangle.png</file>
+ <file>Resources/ex_rectangle_left.png</file>
+ <file>Resources/ex_line.png</file>
+ <file>Resources/ex_line_left.png</file>
+ <file>Resources/ex_area.png</file>
+ <file>Resources/ex_area_left.png</file>
+ <file>Resources/ex_fill_no_autopaint.png</file>
+ <file>Resources/ex_fill_no_autopaint_left.png</file>
+ <file>Resources/edit_FX_notext.png</file>
+ <file>Resources/move_z_notext.png</file>
+ <file>Resources/scale_hv_notext.png</file>
+ <file>Resources/ex_FX.png</file>
+ <file>Resources/ex_FX_left.png</file>
+ <file>Resources/ex_hv.png</file>
+ <file>Resources/ex_hv_left.png</file>
+ <file>Resources/ex_rgb.png</file>
+ <file>Resources/ex_rgb_left.png</file>
+ <file>Resources/ex_style_area.png</file>
+ <file>Resources/ex_style_area_left.png</file>
+ <file>Resources/ex_style_line.png</file>
+ <file>Resources/ex_style_line_left.png</file>
+ <file>Resources/ex_z.png</file>
+ <file>Resources/ex_z_left.png</file>
+ <file>Resources/ex_precise.png</file>
+ <file>Resources/ex_precise_left.png</file>
+ <file>Resources/brush_large.png</file>
+ <file>Resources/brush_crosshair.png</file>
+ <file>Resources/tracker.png</file>
+ <file>Resources/ex_prev.png</file>
+ <file>Resources/ex_prev_left.png</file>
+ <file>Resources/ex_next.png</file>
+ <file>Resources/ex_next_left.png</file>
+ </qresource>
</RCC>
\ No newline at end of file
diff --git a/toonz/sources/toonz/icons/dark/actions/20/type_pickerlasso.svg b/toonz/sources/toonz/icons/dark/actions/20/type_pickerlasso.svg
new file mode 100644
index 000000000..412ea70a6
--- /dev/null
+++ b/toonz/sources/toonz/icons/dark/actions/20/type_pickerlasso.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="20px" height="20px" clip-rule="evenodd" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="1.5" version="1.1" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
+ <g transform="translate(-10 -40)">
+ <g id="type_freehand">
+ <g transform="translate(0 30)">
+ <rect x="10" y="10" width="20" height="20" fill-opacity="0"/>
+ </g>
+ <g transform="matrix(.88271 0 0 .8265 10.313 40.592)">
+ <path d="m4.177 21.062s1.8468-0.57385 2.2658-2.4198c0.479-2.111-0.5638-3.0479-2.9428-5.1419-0.321-0.283-0.556-0.624-0.722-1.002-0.86-1.969 0.171-4.941 0.749-5.899 0.531-0.88 1.904-3.161 5.157-4.015 2.919-0.766 7.9547-0.88103 10.22 3.9587" fill="none" stroke="#000" stroke-width="1px"/>
+ </g>
+ <g transform="matrix(.88271 0 0 1.1237 11.083 35.081)">
+ <ellipse cx="5.534" cy="16.339" rx="3.034" ry="1.839" fill="none" stroke="#000" stroke-width=".84px"/>
+ </g>
+ <g transform="translate(2.2793e-10 30)">
+ <path d="m25 29.5c0 0.133 0.053 0.26 0.146 0.354 0.094 0.093 0.221 0.146 0.354 0.146h2.5c1.105 0 2-0.895 2-2v-2.5c0-0.133-0.053-0.26-0.146-0.354-0.094-0.093-0.221-0.146-0.354-0.146s-0.26 0.053-0.354 0.146c-0.093 0.094-0.146 0.221-0.146 0.354v2.5c0 0.265-0.105 0.52-0.293 0.707-0.187 0.188-0.442 0.293-0.707 0.293h-2.5c-0.133 0-0.26 0.053-0.354 0.146-0.093 0.094-0.146 0.221-0.146 0.354zm-14.5-4.5c-0.133 0-0.26 0.053-0.354 0.146-0.093 0.094-0.146 0.221-0.146 0.354v2.5c0 1.105 0.895 2 2 2h2.5c0.133 0 0.26-0.053 0.354-0.146 0.093-0.094 0.146-0.221 0.146-0.354s-0.053-0.26-0.146-0.354c-0.094-0.093-0.221-0.146-0.354-0.146h-2.5c-0.265 0-0.52-0.105-0.707-0.293-0.188-0.187-0.293-0.442-0.293-0.707v-2.5c0-0.133-0.053-0.26-0.146-0.354-0.094-0.093-0.221-0.146-0.354-0.146zm19-10c0.133 0 0.26-0.053 0.354-0.146 0.093-0.094 0.146-0.221 0.146-0.354v-2.5c0-1.105-0.895-2-2-2h-2.5c-0.133 0-0.26 0.053-0.354 0.146-0.093 0.094-0.146 0.221-0.146 0.354s0.053 0.26 0.146 0.354c0.094 0.093 0.221 0.146 0.354 0.146h2.5c0.265 0 0.52 0.105 0.707 0.293 0.188 0.187 0.293 0.442 0.293 0.707v2.5c0 0.133 0.053 0.26 0.146 0.354 0.094 0.093 0.221 0.146 0.354 0.146zm-14.5-4.5c0-0.133-0.053-0.26-0.146-0.354-0.094-0.093-0.221-0.146-0.354-0.146h-2.5c-1.105 0-2 0.895-2 2v2.5c0 0.133 0.053 0.26 0.146 0.354 0.094 0.093 0.221 0.146 0.354 0.146s0.26-0.053 0.354-0.146c0.093-0.094 0.146-0.221 0.146-0.354v-2.5c0-0.265 0.105-0.52 0.293-0.707 0.187-0.188 0.442-0.293 0.707-0.293h2.5c0.133 0 0.26-0.053 0.354-0.146 0.093-0.094 0.146-0.221 0.146-0.354z"/>
+ </g><g transform="matrix(.66599 0 0 .66599 15.668 45.668)" clip-rule="evenodd" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="2">
+ <path d="m11.306 7.176-1.049-1.049 2.116-2.115 1.402 1.402 2.829-2.828c0.78-0.781 2.047-0.781 2.828 0 0.781 0.78 0.781 2.047 0 2.828l-2.828 2.828 1.414 1.415-2.116 2.115-1.06-1.06-8.528 8.528c-0.993 0.992-2.601 0.992-3.593 0-1e-3 0-1e-3 -1e-3 -2e-3 -1e-3 -0.959-0.96-0.96-2.516 1e-3 -3.477zm0.707 0.707-8.586 8.587c-0.569 0.569-0.569 1.491 0 2.061 1e-3 0 1e-3 1e-3 2e-3 1e-3 0.601 0.602 1.576 0.602 2.177 1e-3l8.528-8.528z"/>
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp
index ba2bda236..6f96bfb0a 100644
--- a/toonz/sources/toonz/mainwindow.cpp
+++ b/toonz/sources/toonz/mainwindow.cpp
@@ -2446,6 +2446,8 @@ void MainWindow::defineActions() {
ToolCommandType, "fill_freehand");
createAction(MI_FillPolyline, QT_TR_NOOP("Fill Tool - Polyline"), "",
ToolCommandType, "fill_polyline");
+ createAction(MI_FillFreepick, QT_TR_NOOP("Fill Tool - Pick+Freehand"), "",
+ ToolCommandType, "fill_freepick");
createAction(MI_FillNextMode, QT_TR_NOOP("Fill Tool - Next Mode"), "",
ToolCommandType);
createAction(MI_FillAreas, QT_TR_NOOP("Fill Tool - Areas"), "",
@@ -2672,6 +2674,11 @@ void MainWindow::defineActions() {
menuAct = createToolOptionsAction("A_ToolOption_Type:Polyline",
QT_TR_NOOP("Type - Polyline"), "");
menuAct->setIcon(createQIcon("type_polyline"));
+
+ menuAct = createToolOptionsAction("A_ToolOption_Type:Freepick",
+ QT_TR_NOOP("Type - Pick+Freehand"), "");
+ menuAct->setIcon(createQIcon("type_pickerlasso"));
+
menuAct = createToolOptionsAction("A_ToolOption_Type:Segment",
QT_TR_NOOP("Type - Segment"), "");
menuAct->setIcon(createQIcon("type_erase_segment"));
diff --git a/toonz/sources/toonz/menubarcommandids.h b/toonz/sources/toonz/menubarcommandids.h
index 61972280d..583d87c68 100644
--- a/toonz/sources/toonz/menubarcommandids.h
+++ b/toonz/sources/toonz/menubarcommandids.h
@@ -362,6 +362,7 @@
#define MI_FillRectangular "MI_FillRectangular"
#define MI_FillFreehand "MI_FillFreehand"
#define MI_FillPolyline "MI_FillPolyline"
+#define MI_FillFreepick "MI_FillFreepick"
#define MI_FillNextMode "MI_FillNextMode"
#define MI_FillAreas "MI_FillAreas"
#define MI_FillLines "MI_FillLines"
diff --git a/toonz/sources/toonz/tooloptionsshortcutinvoker.cpp b/toonz/sources/toonz/tooloptionsshortcutinvoker.cpp
index f181fe92a..e3fd0b936 100644
--- a/toonz/sources/toonz/tooloptionsshortcutinvoker.cpp
+++ b/toonz/sources/toonz/tooloptionsshortcutinvoker.cpp
@@ -492,6 +492,8 @@ void ToolOptionsShortcutInvoker::initialize() {
&ToolOptionsShortcutInvoker::toggleFillFreehand);
setCommandHandler(MI_FillPolyline, this,
&ToolOptionsShortcutInvoker::toggleFillPolyline);
+ setCommandHandler(MI_FillFreepick, this,
+ &ToolOptionsShortcutInvoker::toggleFillFreepick);
setCommandHandler(MI_FillNextMode, this,
&ToolOptionsShortcutInvoker::toggleFillNextMode);
setCommandHandler(MI_FillAreas, this,
@@ -850,6 +852,14 @@ void ToolOptionsShortcutInvoker::toggleFillPolyline() {
->trigger();
}
+void ToolOptionsShortcutInvoker::toggleFillFreepick() {
+ CommandManager::instance()->getAction(T_Fill)->trigger();
+ CommandManager::instance()->getAction("A_ToolOption_Type:Normal")->trigger();
+ CommandManager::instance()
+ ->getAction("A_ToolOption_Type:Freepick")
+ ->trigger();
+}
+
void ToolOptionsShortcutInvoker::toggleFillNextMode() {
if (TApp::instance()->getCurrentTool()->getTool()->getName() == T_Fill)
CommandManager::instance()->getAction("A_ToolOption_Mode")->trigger();
diff --git a/toonz/sources/toonz/tooloptionsshortcutinvoker.h b/toonz/sources/toonz/tooloptionsshortcutinvoker.h
index f372e1d38..2c83a0249 100644
--- a/toonz/sources/toonz/tooloptionsshortcutinvoker.h
+++ b/toonz/sources/toonz/tooloptionsshortcutinvoker.h
@@ -196,6 +196,7 @@ protected slots:
void toggleFillRectangular();
void toggleFillFreehand();
void toggleFillPolyline();
+ void toggleFillFreepick();
void toggleFillNextMode();
void toggleFillAreas();
void toggleFillLines();
diff --git a/toonz/sources/toonz/toonz.qrc b/toonz/sources/toonz/toonz.qrc
index 57e7d665b..33a0ff6ce 100644
--- a/toonz/sources/toonz/toonz.qrc
+++ b/toonz/sources/toonz/toonz.qrc
@@ -417,6 +417,7 @@
<file>icons/dark/actions/20/selection_freehand.svg</file>
<file>icons/dark/actions/20/type_lasso.svg</file>
+ <file>icons/dark/actions/20/type_pickerlasso.svg</file>
<file>icons/dark/actions/20/type_rectangular.svg</file>
<file>icons/dark/actions/20/type_polyline.svg</file>
<file>icons/dark/actions/20/type_normal.svg</file>
diff --git a/toonz/sources/toonzlib/fillutil.cpp b/toonz/sources/toonzlib/fillutil.cpp
index 523098f24..f4e66ce56 100644
--- a/toonz/sources/toonzlib/fillutil.cpp
+++ b/toonz/sources/toonzlib/fillutil.cpp
@@ -149,7 +149,7 @@ void fillautoInks(TRasterCM32P &rin, TRect &rect, const TRasterCM32P &rbefore,
int paint = pix->getPaint();
int tone = pix->getTone();
int ink = pix->getInk();
- if (paint != pixb->getPaint() && tone > 0 && tone < 255 && ink != paint &&
+ if (paint != pixb->getPaint() && ink != paint &&
plt->getStyle(ink)->getFlags() != 0)
inkFill(rin, TPoint(j, i) + rect.getP00(), paint, 0, NULL, &rect);
}