Merge pull request #1099 from manongjohn/ot_patches_20221202
OpenToonz Fix Patches thru 12/2/2022
This commit is contained in:
commit
e90463919f
19 changed files with 1533 additions and 64 deletions
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
//#define UNICODE // per le funzioni di conversione da/a UNC
|
// #define UNICODE // per le funzioni di conversione da/a UNC
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <lm.h>
|
#include <lm.h>
|
||||||
|
|
||||||
|
@ -279,8 +279,7 @@ void TFilePath::setPath(std::wstring path) {
|
||||||
}
|
}
|
||||||
} else if (isSlash(path[pos])) {
|
} else if (isSlash(path[pos])) {
|
||||||
int firstSlashPos = pos;
|
int firstSlashPos = pos;
|
||||||
do
|
do pos++;
|
||||||
pos++;
|
|
||||||
while (pos < length && isSlash(path[pos]));
|
while (pos < length && isSlash(path[pos]));
|
||||||
if (firstSlashPos == 0 && pos == 4) // Caso "\\\\MachineName"
|
if (firstSlashPos == 0 && pos == 4) // Caso "\\\\MachineName"
|
||||||
m_path.append(2, wslash);
|
m_path.append(2, wslash);
|
||||||
|
@ -1066,9 +1065,9 @@ QString TFilePath::fidRegExpStr() {
|
||||||
QString suffixLetter = (m_acceptNonAlphabetSuffix)
|
QString suffixLetter = (m_acceptNonAlphabetSuffix)
|
||||||
? "[^\\._ \\\\/:,;*?\"<>|0123456789]"
|
? "[^\\._ \\\\/:,;*?\"<>|0123456789]"
|
||||||
: "[a-zA-Z]";
|
: "[a-zA-Z]";
|
||||||
QString countLetter = (m_letterCountForSuffix == 0)
|
QString countLetter = (m_letterCountForSuffix == 0)
|
||||||
? "{0,}"
|
? "{0,}"
|
||||||
: (QString("{0,%1}").arg(m_letterCountForSuffix));
|
: (QString("{0,%1}").arg(m_letterCountForSuffix));
|
||||||
return QString("(\\d+)(%1%2)").arg(suffixLetter).arg(countLetter);
|
return QString("(\\d+)(%1%2)").arg(suffixLetter).arg(countLetter);
|
||||||
// const QString fIdRegExp("(\\d+)([a-zA-Z]?)");
|
// const QString fIdRegExp("(\\d+)([a-zA-Z]?)");
|
||||||
}
|
}
|
||||||
|
@ -1113,8 +1112,9 @@ TFilePath::TFilePathInfo TFilePath::analyzePath() const {
|
||||||
|
|
||||||
// hogehoge.0001a.jpg
|
// hogehoge.0001a.jpg
|
||||||
// empty frame case : hogehoge..jpg
|
// empty frame case : hogehoge..jpg
|
||||||
QRegExp rx("^" + levelNameRegExp + sepCharRegExp + "(?:" + fIdRegExp + ")?" +
|
// empty level name case : ..jpg .0001a.jpg
|
||||||
"\\." + extensionRegExp + "$");
|
QRegExp rx("^(?:" + levelNameRegExp + ")?" + sepCharRegExp +
|
||||||
|
"(?:" + fIdRegExp + ")?" + "\\." + extensionRegExp + "$");
|
||||||
if (rx.indexIn(fileName) != -1) {
|
if (rx.indexIn(fileName) != -1) {
|
||||||
assert(rx.captureCount() == 5);
|
assert(rx.captureCount() == 5);
|
||||||
info.levelName = rx.cap(1);
|
info.levelName = rx.cap(1);
|
||||||
|
|
|
@ -63,6 +63,7 @@ if(NOT BUILD_TARGET_BSD)
|
||||||
tif/tiio_tif.cpp
|
tif/tiio_tif.cpp
|
||||||
tzp/tiio_plt.cpp
|
tzp/tiio_plt.cpp
|
||||||
tzp/tiio_tzp.cpp
|
tzp/tiio_tzp.cpp
|
||||||
|
tzp/toonzrle.cpp
|
||||||
tzp/avl.c
|
tzp/avl.c
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
1426
toonz/sources/image/tzp/toonzrle.cpp
Normal file
1426
toonz/sources/image/tzp/toonzrle.cpp
Normal file
File diff suppressed because it is too large
Load diff
|
@ -65,7 +65,7 @@ class TParamVarT final : public TParamVar {
|
||||||
public:
|
public:
|
||||||
TParamVarT(std::string name, T *var = nullptr, TParamP pluginVar = 0,
|
TParamVarT(std::string name, T *var = nullptr, TParamP pluginVar = 0,
|
||||||
bool hidden = false, bool obsolete = false)
|
bool hidden = false, bool obsolete = false)
|
||||||
: TParamVar(name, hidden), m_var(var), m_pluginVar(pluginVar) {}
|
: TParamVar(name, hidden, obsolete), m_var(var), m_pluginVar(pluginVar) {}
|
||||||
TParamVarT() = delete;
|
TParamVarT() = delete;
|
||||||
void setParam(TParam *param) {
|
void setParam(TParam *param) {
|
||||||
if (m_var)
|
if (m_var)
|
||||||
|
@ -80,7 +80,8 @@ public:
|
||||||
return m_pluginVar.getPointer();
|
return m_pluginVar.getPointer();
|
||||||
}
|
}
|
||||||
TParamVar *clone() const {
|
TParamVar *clone() const {
|
||||||
return new TParamVarT<T>(getName(), m_var, m_pluginVar, isHidden());
|
return new TParamVarT<T>(getName(), m_var, m_pluginVar, isHidden(),
|
||||||
|
isObsolete());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -362,8 +362,8 @@ int igs::rotate_blur::reference_margin(
|
||||||
const double blur_radius, /* ぼかしの始まる半径 */
|
const double blur_radius, /* ぼかしの始まる半径 */
|
||||||
const double spin_radius, /* ゼロ以上でspin指定となり、
|
const double spin_radius, /* ゼロ以上でspin指定となり、
|
||||||
かつぼかし強弱の一定になる半径となる */
|
かつぼかし強弱の一定になる半径となる */
|
||||||
const int type // 0: Accelerator, 1: Uniform Angle, 2: Uniform Length
|
const int type, // 0: Accelerator, 1: Uniform Angle, 2: Uniform Length
|
||||||
) {
|
const double ellipse_aspect_ratio) {
|
||||||
/* 強度のないとき、なにもしない */
|
/* 強度のないとき、なにもしない */
|
||||||
if (degree <= 0.0) {
|
if (degree <= 0.0) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -402,5 +402,13 @@ int igs::rotate_blur::reference_margin(
|
||||||
margin1 = margin2;
|
margin1 = margin2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Consider ellipse deformation.
|
||||||
|
// Instead of precise computing, return the maximum possible value.
|
||||||
|
if (ellipse_aspect_ratio != 1.0) {
|
||||||
|
double axis_x = 2.0 * ellipse_aspect_ratio / (ellipse_aspect_ratio + 1.0);
|
||||||
|
double axis_y = axis_x / ellipse_aspect_ratio;
|
||||||
|
margin1 *= std::max(axis_x, axis_y);
|
||||||
|
}
|
||||||
|
|
||||||
return static_cast<int>(ceil(margin1));
|
return static_cast<int>(ceil(margin1));
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,8 +44,8 @@ IGS_ROTATE_BLUR_EXPORT int reference_margin(
|
||||||
const double blur_radius, /* ぼかしの始まる半径 */
|
const double blur_radius, /* ぼかしの始まる半径 */
|
||||||
const double spin_radius, /* ゼロ以上でspin指定となり、
|
const double spin_radius, /* ゼロ以上でspin指定となり、
|
||||||
かつぼかし強弱の一定になる半径となる */
|
かつぼかし強弱の一定になる半径となる */
|
||||||
const int type // 0: Accelerator, 1: Uniform Angle, 2: Uniform Length
|
const int type, // 0: Accelerator, 1: Uniform Angle, 2: Uniform Length
|
||||||
);
|
const double ellipse_aspect_ratio = 1.0);
|
||||||
} // namespace rotate_blur
|
} // namespace rotate_blur
|
||||||
} // namespace igs
|
} // namespace igs
|
||||||
|
|
||||||
|
|
|
@ -86,8 +86,8 @@ public:
|
||||||
static_cast<int>(ceil(bBox.getLy())),
|
static_cast<int>(ceil(bBox.getLy())),
|
||||||
static_cast<int>(ceil(bBox.getLx())), center,
|
static_cast<int>(ceil(bBox.getLx())), center,
|
||||||
this->m_blur->getValue(frame), this->m_radius->getValue(frame) * scale,
|
this->m_blur->getValue(frame), this->m_radius->getValue(frame) * scale,
|
||||||
((0 < this->m_type->getValue()) ? 0.0 : (bBox.getLy() / 2.0)),
|
bBox.getLy() / 2.0, this->m_type->getValue(),
|
||||||
this->m_type->getValue());
|
this->m_ellipse_aspect_ratio->getValue(frame));
|
||||||
}
|
}
|
||||||
void get_render_enlarge(const double frame, const TAffine affine,
|
void get_render_enlarge(const double frame, const TAffine affine,
|
||||||
TRectD &bBox) {
|
TRectD &bBox) {
|
||||||
|
|
|
@ -163,9 +163,9 @@ void BokehUtils::MyThread::setLayerRaster(const RASTER srcRas,
|
||||||
PIXEL* pix = srcRas->pixels(j);
|
PIXEL* pix = srcRas->pixels(j);
|
||||||
for (int i = 0; i < dim.lx; i++, pix++) {
|
for (int i = 0; i < dim.lx; i++, pix++) {
|
||||||
if (pix->m != 0) {
|
if (pix->m != 0) {
|
||||||
double val = (m_channel == Red) ? (double)pix->r
|
double val = (m_channel == Red) ? (double)pix->r
|
||||||
: (m_channel == Green) ? (double)pix->g
|
: (m_channel == Green) ? (double)pix->g
|
||||||
: (double)pix->b;
|
: (double)pix->b;
|
||||||
// multiply the exposure by alpha channel value
|
// multiply the exposure by alpha channel value
|
||||||
dstMem[j * dim.lx + i].r =
|
dstMem[j * dim.lx + i].r =
|
||||||
valueToExposure(val / (double)PIXEL::maxChannelValue,
|
valueToExposure(val / (double)PIXEL::maxChannelValue,
|
||||||
|
@ -264,9 +264,9 @@ void BokehUtils::MyThread::run() {
|
||||||
std::pow(exposure / (*alp_p), m_layerHardness / m_masterHardness) *
|
std::pow(exposure / (*alp_p), m_layerHardness / m_masterHardness) *
|
||||||
(*alp_p);
|
(*alp_p);
|
||||||
|
|
||||||
double* res = (m_channel == Red) ? (&((*res_p).x))
|
double* res = (m_channel == Red) ? (&((*res_p).x))
|
||||||
: (m_channel == Green) ? (&((*res_p).y))
|
: (m_channel == Green) ? (&((*res_p).y))
|
||||||
: (&((*res_p).z));
|
: (&((*res_p).z));
|
||||||
|
|
||||||
// composite exposure
|
// composite exposure
|
||||||
if ((*alp_p) >= 1.0 || (*res) == 0.0)
|
if ((*alp_p) >= 1.0 || (*res) == 0.0)
|
||||||
|
@ -1280,22 +1280,26 @@ void BokehUtils::setOutputRaster(double4* src, const RASTER dstRas,
|
||||||
outPix->r =
|
outPix->r =
|
||||||
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
|
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
|
||||||
? (double)PIXEL::maxChannelValue
|
? (double)PIXEL::maxChannelValue
|
||||||
: val);
|
: (val < 0.) ? 0.
|
||||||
|
: val);
|
||||||
val = (*src_p).y * (double)PIXEL::maxChannelValue + 0.5;
|
val = (*src_p).y * (double)PIXEL::maxChannelValue + 0.5;
|
||||||
outPix->g =
|
outPix->g =
|
||||||
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
|
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
|
||||||
? (double)PIXEL::maxChannelValue
|
? (double)PIXEL::maxChannelValue
|
||||||
: val);
|
: (val < 0.) ? 0.
|
||||||
|
: val);
|
||||||
val = (*src_p).z * (double)PIXEL::maxChannelValue + 0.5;
|
val = (*src_p).z * (double)PIXEL::maxChannelValue + 0.5;
|
||||||
outPix->b =
|
outPix->b =
|
||||||
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
|
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
|
||||||
? (double)PIXEL::maxChannelValue
|
? (double)PIXEL::maxChannelValue
|
||||||
: val);
|
: (val < 0.) ? 0.
|
||||||
|
: val);
|
||||||
val = (*src_p).w * (double)PIXEL::maxChannelValue + 0.5;
|
val = (*src_p).w * (double)PIXEL::maxChannelValue + 0.5;
|
||||||
outPix->m =
|
outPix->m =
|
||||||
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
|
(typename PIXEL::Channel)((val > (double)PIXEL::maxChannelValue)
|
||||||
? (double)PIXEL::maxChannelValue
|
? (double)PIXEL::maxChannelValue
|
||||||
: val);
|
: (val < 0.) ? 0.
|
||||||
|
: val);
|
||||||
}
|
}
|
||||||
src_p += margin.x;
|
src_p += margin.x;
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,9 +163,8 @@ void Iwa_BokehFx::doCompute(TTile& tile, double frame,
|
||||||
QList<LayerValue> layerValues;
|
QList<LayerValue> layerValues;
|
||||||
for (auto index : sourceIndices) {
|
for (auto index : sourceIndices) {
|
||||||
LayerValue layerValue;
|
LayerValue layerValue;
|
||||||
layerValue.sourceTile = sourceTiles[index];
|
layerValue.sourceTile = sourceTiles[index];
|
||||||
layerValue.premultiply =
|
layerValue.premultiply = m_layerParams[index].m_premultiply->getValue();
|
||||||
m_layerParams[index].m_premultiply->getValue() ? 1 : 0;
|
|
||||||
layerValue.layerHardness = masterHardness;
|
layerValue.layerHardness = masterHardness;
|
||||||
layerValue.depth_ref = 0;
|
layerValue.depth_ref = 0;
|
||||||
layerValue.irisSize = irisSizes.value(index);
|
layerValue.irisSize = irisSizes.value(index);
|
||||||
|
|
|
@ -212,7 +212,7 @@ void Iwa_BokehRefFx::doCompute(TTile& tile, double frame,
|
||||||
}
|
}
|
||||||
ctrls[1] = depth_buff;
|
ctrls[1] = depth_buff;
|
||||||
|
|
||||||
layerValue.premultiply = 2; // auto
|
layerValue.premultiply = false;
|
||||||
layerValue.layerHardness = m_hardness->getValue(frame);
|
layerValue.layerHardness = m_hardness->getValue(frame);
|
||||||
layerValue.depth_ref = 1;
|
layerValue.depth_ref = 1;
|
||||||
layerValue.distance = 0.5;
|
layerValue.distance = 0.5;
|
||||||
|
|
|
@ -60,7 +60,7 @@ static float* dt(float* f, int n, float a = 1.0f) {
|
||||||
delete[] z;
|
delete[] z;
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
|
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
|
|
||||||
|
@ -204,9 +204,10 @@ void Iwa_SoapBubbleFx::doCompute(TTile& tile, double frame,
|
||||||
/* obtain shape image */
|
/* obtain shape image */
|
||||||
TTile shape_tile;
|
TTile shape_tile;
|
||||||
{
|
{
|
||||||
TRaster32P tmp(1, 1);
|
TRenderSettings settings_aux(settings);
|
||||||
m_shape->allocateAndCompute(shape_tile, bBox.getP00(), dim, tmp, frame,
|
settings_aux.m_bpp = 32;
|
||||||
settings);
|
m_shape->allocateAndCompute(shape_tile, bBox.getP00(), dim, nullptr,
|
||||||
|
frame, settings_aux);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkCancelAndReleaseRaster(allocatedRasList, tile, settings)) return;
|
if (checkCancelAndReleaseRaster(allocatedRasList, tile, settings)) return;
|
||||||
|
@ -530,7 +531,7 @@ int Iwa_SoapBubbleFx::do_binarize(TRaster32P srcRas, USHORT* dst_p, float thres,
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> lut;
|
QList<int> lut;
|
||||||
for (int i = 0; i < 65536; i++) lut.append(i);
|
for (int i = 0; i < 65536; i++) lut.append(i);
|
||||||
tmp_p = dst_p;
|
tmp_p = dst_p;
|
||||||
int regionCount = 0;
|
int regionCount = 0;
|
||||||
for (int j = 0; j < dim.ly; j++) {
|
for (int j = 0; j < dim.ly; j++) {
|
||||||
|
@ -569,7 +570,7 @@ int Iwa_SoapBubbleFx::do_binarize(TRaster32P srcRas, USHORT* dst_p, float thres,
|
||||||
} else
|
} else
|
||||||
convIndex.append(i);
|
convIndex.append(i);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < convIndex.count(); i++)
|
for (int i = 0; i < convIndex.count(); i++)
|
||||||
lut[convIndex.at(i)] = lut.at(lut.at(convIndex.at(i)));
|
lut[convIndex.at(i)] = lut.at(lut.at(convIndex.at(i)));
|
||||||
|
|
||||||
// apply lut
|
// apply lut
|
||||||
|
@ -577,7 +578,7 @@ int Iwa_SoapBubbleFx::do_binarize(TRaster32P srcRas, USHORT* dst_p, float thres,
|
||||||
tmp_p = dst_p;
|
tmp_p = dst_p;
|
||||||
for (int j = 0; j < dim.ly; j++) {
|
for (int j = 0; j < dim.ly; j++) {
|
||||||
for (int i = 0; i < dim.lx; i++, tmp_p++) {
|
for (int i = 0; i < dim.lx; i++, tmp_p++) {
|
||||||
(*tmp_p) = lut[*tmp_p];
|
(*tmp_p) = lut[*tmp_p];
|
||||||
if (maxRegionIndex < (*tmp_p)) maxRegionIndex = (*tmp_p);
|
if (maxRegionIndex < (*tmp_p)) maxRegionIndex = (*tmp_p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -789,14 +790,14 @@ void Iwa_SoapBubbleFx::calc_norm_angle(float* norm_angle_p, float* depth_map_p,
|
||||||
float* dst_p = norm_angle_p;
|
float* dst_p = norm_angle_p;
|
||||||
|
|
||||||
for (int j = 0; j < dim.ly; j++) {
|
for (int j = 0; j < dim.ly; j++) {
|
||||||
int sample_y[2] = {j - sampleDistance, j + sampleDistance};
|
int sample_y[2] = {j - sampleDistance, j + sampleDistance};
|
||||||
if (sample_y[0] < 0) sample_y[0] = 0;
|
if (sample_y[0] < 0) sample_y[0] = 0;
|
||||||
if (sample_y[1] >= dim.ly) sample_y[1] = dim.ly - 1;
|
if (sample_y[1] >= dim.ly) sample_y[1] = dim.ly - 1;
|
||||||
|
|
||||||
for (int i = 0; i < dim.lx; i++, norm_angle_p++) {
|
for (int i = 0; i < dim.lx; i++, norm_angle_p++) {
|
||||||
int sample_x[2] = {i - sampleDistance, i + sampleDistance};
|
int sample_x[2] = {i - sampleDistance, i + sampleDistance};
|
||||||
if (sample_x[1] >= dim.lx) sample_x[1] = dim.lx - 1;
|
if (sample_x[1] >= dim.lx) sample_x[1] = dim.lx - 1;
|
||||||
if (sample_x[0] < 0) sample_x[0] = 0;
|
if (sample_x[0] < 0) sample_x[0] = 0;
|
||||||
|
|
||||||
float gradient[2];
|
float gradient[2];
|
||||||
gradient[0] =
|
gradient[0] =
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "toonz/txshcolumn.h"
|
#include "toonz/txshcolumn.h"
|
||||||
#include "toonz/tlog.h"
|
#include "toonz/tlog.h"
|
||||||
#include "toonz/imagestyles.h"
|
#include "toonz/imagestyles.h"
|
||||||
|
#include "toonz/filepathproperties.h"
|
||||||
|
|
||||||
// TnzBase includes
|
// TnzBase includes
|
||||||
#include "tcli.h"
|
#include "tcli.h"
|
||||||
|
@ -596,6 +597,12 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
cout << "project:" << project->getName() << endl;
|
cout << "project:" << project->getName() << endl;
|
||||||
|
|
||||||
|
// update TFilePath condition on loading the current project
|
||||||
|
FilePathProperties *fpProp = project->getFilePathProperties();
|
||||||
|
TFilePath::setFilePathProperties(fpProp->useStandard(),
|
||||||
|
fpProp->acceptNonAlphabetSuffix(),
|
||||||
|
fpProp->letterCountForSuffix());
|
||||||
|
|
||||||
TFilePath fp = srcName;
|
TFilePath fp = srcName;
|
||||||
|
|
||||||
/*- CLNファイルを直接指定した場合 -*/
|
/*- CLNファイルを直接指定した場合 -*/
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
#include "toonz/levelset.h"
|
#include "toonz/levelset.h"
|
||||||
#include "toonz/txshsimplelevel.h"
|
#include "toonz/txshsimplelevel.h"
|
||||||
#include "toonz/levelproperties.h"
|
#include "toonz/levelproperties.h"
|
||||||
|
#include "toonz/filepathproperties.h"
|
||||||
|
|
||||||
// TnzSound includes
|
// TnzSound includes
|
||||||
#include "tnzsound.h"
|
#include "tnzsound.h"
|
||||||
|
@ -50,7 +51,7 @@
|
||||||
#include "tunit.h"
|
#include "tunit.h"
|
||||||
#include "tenv.h"
|
#include "tenv.h"
|
||||||
#include "tpassivecachemanager.h"
|
#include "tpassivecachemanager.h"
|
||||||
//#include "tcacheresourcepool.h"
|
// #include "tcacheresourcepool.h"
|
||||||
|
|
||||||
// TnzCore includes
|
// TnzCore includes
|
||||||
#include "tsystem.h"
|
#include "tsystem.h"
|
||||||
|
@ -798,7 +799,7 @@ int main(int argc, char *argv[]) {
|
||||||
loadShaderInterfaces(ToonzFolder::getLibraryFolder() +
|
loadShaderInterfaces(ToonzFolder::getLibraryFolder() +
|
||||||
TFilePath("shaders"));
|
TFilePath("shaders"));
|
||||||
|
|
||||||
//#endif
|
// #endif
|
||||||
|
|
||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
|
|
||||||
|
@ -828,6 +829,12 @@ int main(int argc, char *argv[]) {
|
||||||
m_userLog->info(msg);
|
m_userLog->info(msg);
|
||||||
// pm->setCurrentProject(project, false); // false => temporaneamente
|
// pm->setCurrentProject(project, false); // false => temporaneamente
|
||||||
|
|
||||||
|
// update TFilePath condition on loading the current project
|
||||||
|
FilePathProperties *fpProp = project->getFilePathProperties();
|
||||||
|
TFilePath::setFilePathProperties(fpProp->useStandard(),
|
||||||
|
fpProp->acceptNonAlphabetSuffix(),
|
||||||
|
fpProp->letterCountForSuffix());
|
||||||
|
|
||||||
Sw1.start();
|
Sw1.start();
|
||||||
|
|
||||||
if (!TSystem::doesExistFileOrLevel(srcFilePath)) return -2;
|
if (!TSystem::doesExistFileOrLevel(srcFilePath)) return -2;
|
||||||
|
@ -927,13 +934,10 @@ int main(int argc, char *argv[]) {
|
||||||
const int threadCounts[3] = {1, procCount / 2, procCount};
|
const int threadCounts[3] = {1, procCount / 2, procCount};
|
||||||
if (nthreads.isSelected()) {
|
if (nthreads.isSelected()) {
|
||||||
QString threadCountStr = QString::fromStdString(nthreads.getValue());
|
QString threadCountStr = QString::fromStdString(nthreads.getValue());
|
||||||
threadCount = (threadCountStr == "single")
|
threadCount = (threadCountStr == "single") ? threadCounts[0]
|
||||||
? threadCounts[0]
|
: (threadCountStr == "half") ? threadCounts[1]
|
||||||
: (threadCountStr == "half")
|
: (threadCountStr == "all") ? threadCounts[2]
|
||||||
? threadCounts[1]
|
: threadCountStr.toInt();
|
||||||
: (threadCountStr == "all")
|
|
||||||
? threadCounts[2]
|
|
||||||
: threadCountStr.toInt();
|
|
||||||
|
|
||||||
if (threadCount <= 0) {
|
if (threadCount <= 0) {
|
||||||
cout << "Qualifier 'nthreads': bad input" << endl;
|
cout << "Qualifier 'nthreads': bad input" << endl;
|
||||||
|
@ -953,15 +957,11 @@ int main(int argc, char *argv[]) {
|
||||||
TOutputProperties::MediumVal, TOutputProperties::SmallVal};
|
TOutputProperties::MediumVal, TOutputProperties::SmallVal};
|
||||||
if (tileSize.isSelected()) {
|
if (tileSize.isSelected()) {
|
||||||
QString tileSizeStr = QString::fromStdString(tileSize.getValue());
|
QString tileSizeStr = QString::fromStdString(tileSize.getValue());
|
||||||
maxTileSize = (tileSizeStr == "none")
|
maxTileSize = (tileSizeStr == "none") ? maxTileSizes[0]
|
||||||
? maxTileSizes[0]
|
: (tileSizeStr == "large") ? maxTileSizes[1]
|
||||||
: (tileSizeStr == "large")
|
: (tileSizeStr == "medium") ? maxTileSizes[2]
|
||||||
? maxTileSizes[1]
|
: (tileSizeStr == "small") ? maxTileSizes[3]
|
||||||
: (tileSizeStr == "medium")
|
: tileSizeStr.toInt();
|
||||||
? maxTileSizes[2]
|
|
||||||
: (tileSizeStr == "small")
|
|
||||||
? maxTileSizes[3]
|
|
||||||
: tileSizeStr.toInt();
|
|
||||||
|
|
||||||
if (maxTileSize <= 0) {
|
if (maxTileSize <= 0) {
|
||||||
cout << "Qualifier 'maxtilesize': bad input" << endl;
|
cout << "Qualifier 'maxtilesize': bad input" << endl;
|
||||||
|
|
|
@ -761,7 +761,7 @@ LevelSettingsValues LevelSettingsPopup::getValues(TXshLevelP level) {
|
||||||
values.doAntialias = (sl->getProperties()->antialiasSoftness() > 0)
|
values.doAntialias = (sl->getProperties()->antialiasSoftness() > 0)
|
||||||
? Qt::Checked
|
? Qt::Checked
|
||||||
: Qt::Unchecked;
|
: Qt::Unchecked;
|
||||||
values.softness = sl->getProperties()->antialiasSoftness();
|
values.softness = sl->getProperties()->antialiasSoftness();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1475,6 +1475,7 @@ void LevelSettingsPopup::onSubsamplingChanged() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool somethingChanged = false;
|
||||||
TUndoManager::manager()->beginBlock();
|
TUndoManager::manager()->beginBlock();
|
||||||
QSetIterator<TXshLevelP> levelItr(m_selectedLevels);
|
QSetIterator<TXshLevelP> levelItr(m_selectedLevels);
|
||||||
while (levelItr.hasNext()) {
|
while (levelItr.hasNext()) {
|
||||||
|
@ -1491,8 +1492,10 @@ void LevelSettingsPopup::onSubsamplingChanged() {
|
||||||
TUndoManager::manager()->add(new LevelSettingsUndo(
|
TUndoManager::manager()->add(new LevelSettingsUndo(
|
||||||
levelP.getPointer(), LevelSettingsUndo::Subsampling, oldSubsampling,
|
levelP.getPointer(), LevelSettingsUndo::Subsampling, oldSubsampling,
|
||||||
subsampling));
|
subsampling));
|
||||||
|
somethingChanged = true;
|
||||||
}
|
}
|
||||||
TUndoManager::manager()->endBlock();
|
TUndoManager::manager()->endBlock();
|
||||||
|
if (!somethingChanged) return;
|
||||||
|
|
||||||
TApp::instance()->getCurrentScene()->setDirtyFlag(true);
|
TApp::instance()->getCurrentScene()->setDirtyFlag(true);
|
||||||
TApp::instance()
|
TApp::instance()
|
||||||
|
|
|
@ -1456,6 +1456,7 @@ void PreviewFxManager::onLevelChanged() {
|
||||||
// Build the level name as an alias keyword. All cache images associated
|
// Build the level name as an alias keyword. All cache images associated
|
||||||
// with an alias containing the level name will be updated.
|
// with an alias containing the level name will be updated.
|
||||||
TXshLevel *xl = TApp::instance()->getCurrentLevel()->getLevel();
|
TXshLevel *xl = TApp::instance()->getCurrentLevel()->getLevel();
|
||||||
|
if (!xl) return;
|
||||||
std::string aliasKeyword;
|
std::string aliasKeyword;
|
||||||
TFilePath fp = xl->getPath();
|
TFilePath fp = xl->getPath();
|
||||||
aliasKeyword = ::to_string(fp.withType(""));
|
aliasKeyword = ::to_string(fp.withType(""));
|
||||||
|
|
|
@ -721,8 +721,8 @@ void RowArea::drawShiftTraceMarker(QPainter &p) {
|
||||||
|
|
||||||
QPoint frameAdj = m_viewer->getFrameZoomAdjustment();
|
QPoint frameAdj = m_viewer->getFrameZoomAdjustment();
|
||||||
int frameAdj_i = (m_viewer->orientation()->isVerticalTimeline())
|
int frameAdj_i = (m_viewer->orientation()->isVerticalTimeline())
|
||||||
? frameAdj.y()
|
? frameAdj.y()
|
||||||
: frameAdj.x();
|
: frameAdj.x();
|
||||||
|
|
||||||
// get onion colors
|
// get onion colors
|
||||||
TPixel frontPixel, backPixel;
|
TPixel frontPixel, backPixel;
|
||||||
|
@ -1113,7 +1113,8 @@ void RowArea::mouseMoveEvent(QMouseEvent *event) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_row = m_viewer->xyToPosition(pos).frame();
|
m_row = std::max(0, m_viewer->xyToPosition(pos).frame());
|
||||||
|
|
||||||
int x = pos.x();
|
int x = pos.x();
|
||||||
|
|
||||||
if ((event->buttons() & Qt::LeftButton) != 0 &&
|
if ((event->buttons() & Qt::LeftButton) != 0 &&
|
||||||
|
|
|
@ -164,6 +164,8 @@ TPropertyGroup *TOutputProperties::getFileFormatProperties(std::string ext) {
|
||||||
TPropertyGroup *ret = Tiio::makeWriterProperties(ext);
|
TPropertyGroup *ret = Tiio::makeWriterProperties(ext);
|
||||||
m_formatProperties[ext] = ret;
|
m_formatProperties[ext] = ret;
|
||||||
return ret;
|
return ret;
|
||||||
|
} else if (ext == "mov" || ext == "3gp") {
|
||||||
|
return it->second;
|
||||||
} else {
|
} else {
|
||||||
// Try to merge settings instead of overriding them
|
// Try to merge settings instead of overriding them
|
||||||
TPropertyGroup *ret = Tiio::makeWriterProperties(ext);
|
TPropertyGroup *ret = Tiio::makeWriterProperties(ext);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#include "toonz/tscenehandle.h"
|
#include "toonz/tscenehandle.h"
|
||||||
|
|
||||||
|
@ -24,7 +24,22 @@ ToonzScene *TSceneHandle::getScene() const { return m_scene; }
|
||||||
void TSceneHandle::setScene(ToonzScene *scene) {
|
void TSceneHandle::setScene(ToonzScene *scene) {
|
||||||
if (m_scene == scene) return;
|
if (m_scene == scene) return;
|
||||||
emit sceneSwitching();
|
emit sceneSwitching();
|
||||||
delete m_scene;
|
ToonzScene *oldscene = m_scene;
|
||||||
m_scene = scene;
|
m_scene = scene;
|
||||||
if (m_scene) emit sceneSwitched();
|
if (m_scene) emit sceneSwitched();
|
||||||
|
|
||||||
|
// Prevent memory corruption caused by delayed signals writing into the
|
||||||
|
// discarded old scene while that memory was freed.
|
||||||
|
// That made OT had a chance of crashing when project or scene changed rapidly.
|
||||||
|
// Note: This is not the best solution but "it just works"
|
||||||
|
if (oldscene) {
|
||||||
|
QTimer *delayedTimer = new QTimer(this);
|
||||||
|
delayedTimer->setSingleShot(true);
|
||||||
|
|
||||||
|
connect(delayedTimer, &QTimer::timeout, [=]() {
|
||||||
|
delete oldscene;
|
||||||
|
delayedTimer->deleteLater();
|
||||||
|
});
|
||||||
|
delayedTimer->start(3000); // 1 sec was enough, but... dunno about toasters
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -570,7 +570,7 @@ void TStyleSelection::selectNone() {
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
|
||||||
bool TStyleSelection::isEmpty() const {
|
bool TStyleSelection::isEmpty() const {
|
||||||
return m_pageIndex < 0 && m_styleIndicesInPage.empty();
|
return m_pageIndex < 0 || m_styleIndicesInPage.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue