fx global control
This commit is contained in:
parent
76b04d3285
commit
9dbac90477
33 changed files with 238 additions and 61 deletions
4
stuff/profiles/layouts/fxs/STD_externalPaletteFx.xml
Normal file
4
stuff/profiles/layouts/fxs/STD_externalPaletteFx.xml
Normal file
|
@ -0,0 +1,4 @@
|
|||
<fxlayout>
|
||||
<page name="External Palette">
|
||||
</page>
|
||||
</fxlayout>
|
|
@ -36,6 +36,9 @@ class DVAPI TFxAttributes {
|
|||
// to maintain backward compatibility in the fx
|
||||
int m_fxVersion;
|
||||
|
||||
bool m_hasGlobalControl;
|
||||
double m_globalIntensity;
|
||||
|
||||
public:
|
||||
TFxAttributes();
|
||||
~TFxAttributes();
|
||||
|
@ -67,6 +70,10 @@ public:
|
|||
void setFxVersion(int version) { m_fxVersion = version; }
|
||||
int getFxVersion() const { return m_fxVersion; };
|
||||
|
||||
void setHasGlobalControl(bool yes) { m_hasGlobalControl = yes; }
|
||||
bool hasGlobalControl() const { return m_hasGlobalControl; }
|
||||
void setGlobalIntensity(double val) { m_globalIntensity = val; }
|
||||
double getGlobalIntensity() { return m_globalIntensity; }
|
||||
// Group management
|
||||
|
||||
int setGroupId(int value);
|
||||
|
|
|
@ -76,8 +76,9 @@ public:
|
|||
ParamsPage(QWidget *parent = 0, ParamViewer *paramViewer = 0);
|
||||
~ParamsPage();
|
||||
|
||||
void setPage(TIStream &is, const TFxP &fx) {
|
||||
void setPage(TIStream &is, const TFxP &fx, bool isFirstPage) {
|
||||
setPageField(is, fx);
|
||||
if (isFirstPage) addGlobalControl(fx);
|
||||
setPageSpace();
|
||||
}
|
||||
|
||||
|
@ -98,6 +99,7 @@ public:
|
|||
|
||||
protected:
|
||||
void setPageField(TIStream &is, const TFxP &fx, bool isVertical = true);
|
||||
void addGlobalControl(const TFxP &fx);
|
||||
|
||||
public:
|
||||
void setPageSpace();
|
||||
|
|
|
@ -85,6 +85,7 @@ set(HEADERS
|
|||
iwa_rainbowfx.h
|
||||
iwa_bokeh_advancedfx.h
|
||||
iwa_bokeh_util.h
|
||||
globalcontrollablefx.h
|
||||
)
|
||||
|
||||
if(OpenCV_FOUND)
|
||||
|
|
|
@ -6,10 +6,11 @@
|
|||
#include "tpixelutils.h"
|
||||
#include "tparamset.h"
|
||||
#include "trop.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
//===================================================================
|
||||
|
||||
class AdjustLevelsFx final : public TStandardRasterFx {
|
||||
class AdjustLevelsFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(AdjustLevelsFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "stdfx.h"
|
||||
#include "tfxparam.h"
|
||||
#include "tpixelutils.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
class Bright_ContFx final : public TStandardRasterFx {
|
||||
class Bright_ContFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(Bright_ContFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
|
|
@ -5,10 +5,11 @@
|
|||
//#include "trop.h"
|
||||
#include <math.h>
|
||||
#include "tpixelutils.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
//==================================================================
|
||||
|
||||
class ChannelMixerFx final : public TStandardRasterFx {
|
||||
class ChannelMixerFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ChannelMixerFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
@ -109,7 +110,7 @@ void depremult(PIXEL *pix) {
|
|||
pix->g = (CHANNEL_TYPE)(pix->g * depremult);
|
||||
pix->b = (CHANNEL_TYPE)(pix->b * depremult);
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
template <typename PIXEL, typename CHANNEL_TYPE>
|
||||
void doChannelMixer(TRasterPT<PIXEL> ras, double r_r, double r_g, double r_b,
|
||||
|
|
|
@ -9,9 +9,11 @@
|
|||
// TnzStdfx includes
|
||||
#include "stdfx.h"
|
||||
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
class DespeckleFx final : public TStandardRasterFx {
|
||||
class DespeckleFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(DespeckleFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
|
|
@ -8,10 +8,11 @@
|
|||
#include "toonz/txshcell.h"
|
||||
#include "toonz/txshsimplelevel.h"
|
||||
#include "toonz/txshpalettelevel.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
//===================================================================
|
||||
|
||||
class ExternalPaletteFx final : public TStandardRasterFx {
|
||||
class ExternalPaletteFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ExternalPaletteFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
@ -85,7 +86,7 @@ TPalette *getPalette(TFx *fx, double frame) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
|
28
toonz/sources/stdfx/globalcontrollablefx.h
Normal file
28
toonz/sources/stdfx/globalcontrollablefx.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
#pragma once
|
||||
|
||||
#ifndef GLOBALCONTROLLABLEFX_H
|
||||
#define GLOBALCONTROLLABLEFX_H
|
||||
|
||||
#include "tfxparam.h"
|
||||
#include "stdfx.h"
|
||||
#include "tfxattributes.h"
|
||||
|
||||
class GlobalControllableFx : public TStandardRasterFx {
|
||||
protected:
|
||||
TDoubleParamP m_globalIntensity;
|
||||
|
||||
public:
|
||||
GlobalControllableFx() : m_globalIntensity(1.0) {
|
||||
m_globalIntensity->setValueRange(0.0, 1.0);
|
||||
|
||||
bindParam(this, "globalIntensity", m_globalIntensity);
|
||||
getAttributes()->setHasGlobalControl(true);
|
||||
m_globalIntensity->setUILabel("Fx Intensity");
|
||||
}
|
||||
|
||||
double getGrobalControlValue(double frame) {
|
||||
return m_globalIntensity->getValue(frame);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
|
@ -5,8 +5,9 @@
|
|||
#include <math.h>
|
||||
#include "stdfx.h"
|
||||
#include "hsvutil.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
class HSVKeyFx final : public TStandardRasterFx {
|
||||
class HSVKeyFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(HSVKeyFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
#include <math.h>
|
||||
#include "stdfx.h"
|
||||
#include "hsvutil.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
class HSVScaleFx final : public TStandardRasterFx {
|
||||
class HSVScaleFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(HSVScaleFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "stdfx.h"
|
||||
|
||||
#include "ino_common.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_hls_add final : public TStandardRasterFx {
|
||||
class ino_hls_add final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_hls_add)
|
||||
TRasterFxPort m_input;
|
||||
TRasterFxPort m_noise;
|
||||
|
@ -117,7 +118,8 @@ void fx_(TRasterP in_ras, const TRasterP noise_ras, const TRasterP refer_ras,
|
|||
,
|
||||
in_ras->getLy(), in_ras->getLx() // Not use in_ras->getWrap()
|
||||
,
|
||||
ino::channels(), ino::bits(in_ras)
|
||||
ino::channels(),
|
||||
ino::bits(in_ras)
|
||||
|
||||
//,noise_ras->getRawData() // BGRA
|
||||
//,&refer_vec.at(0) // RGBA
|
||||
|
@ -151,7 +153,7 @@ void fx_(TRasterP in_ras, const TRasterP noise_ras, const TRasterP refer_ras,
|
|||
noise_gr8->unlock();
|
||||
in_gr8->unlock();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
//------------------------------------------------------------
|
||||
void ino_hls_add::doCompute(TTile &tile, double frame,
|
||||
const TRenderSettings &rend_sets) {
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "stdfx.h"
|
||||
|
||||
#include "ino_common.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_hls_adjust final : public TStandardRasterFx {
|
||||
class ino_hls_adjust final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_hls_adjust)
|
||||
TRasterFxPort m_input;
|
||||
TRasterFxPort m_refer;
|
||||
|
@ -124,7 +125,8 @@ void fx_(TRasterP in_ras, const TRasterP refer_ras, const int refer_mode,
|
|||
|
||||
,
|
||||
hue_pivot, hue_scale, hue_shift, lig_pivot, lig_scale, lig_shift,
|
||||
sat_pivot, sat_scale, sat_shift
|
||||
sat_pivot, sat_scale,
|
||||
sat_shift
|
||||
|
||||
//,true /* add_blend_sw */
|
||||
,
|
||||
|
@ -135,7 +137,7 @@ void fx_(TRasterP in_ras, const TRasterP refer_ras, const int refer_mode,
|
|||
ino::arr_to_ras(in_gr8->getRawData(), ino::channels(), in_ras, 0);
|
||||
in_gr8->unlock();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
//------------------------------------------------------------
|
||||
void ino_hls_adjust::doCompute(TTile &tile, double frame,
|
||||
const TRenderSettings &rend_sets) {
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "stdfx.h"
|
||||
|
||||
#include "ino_common.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_hls_noise final : public TStandardRasterFx {
|
||||
class ino_hls_noise final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_hls_noise)
|
||||
TRasterFxPort m_input;
|
||||
TRasterFxPort m_refer;
|
||||
|
@ -150,7 +151,7 @@ void fx_(TRasterP in_ras, const TRasterP refer_ras, const int refer_mode,
|
|||
ino::arr_to_ras(in_gr8->getRawData(), ino::channels(), in_ras, 0);
|
||||
in_gr8->unlock();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
//------------------------------------------------------------
|
||||
void ino_hls_noise::doCompute(TTile &tile, double frame,
|
||||
const TRenderSettings &rend_sets) {
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "stdfx.h"
|
||||
|
||||
#include "ino_common.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_hsv_add final : public TStandardRasterFx {
|
||||
class ino_hsv_add final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_hsv_add)
|
||||
TRasterFxPort m_input;
|
||||
TRasterFxPort m_noise;
|
||||
|
@ -120,7 +121,8 @@ void fx_(TRasterP in_ras, const TRasterP noise_ras, const TRasterP refer_ras,
|
|||
,
|
||||
in_ras->getLy(), in_ras->getLx() // Not use in_ras->getWrap()
|
||||
,
|
||||
ino::channels(), ino::bits(in_ras)
|
||||
ino::channels(),
|
||||
ino::bits(in_ras)
|
||||
|
||||
//,noise_ras->getRawData() // BGRA
|
||||
//,&refer_vec.at(0) // RGBA
|
||||
|
@ -154,7 +156,7 @@ void fx_(TRasterP in_ras, const TRasterP noise_ras, const TRasterP refer_ras,
|
|||
noise_gr8->unlock();
|
||||
in_gr8->unlock();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
//------------------------------------------------------------
|
||||
void ino_hsv_add::doCompute(TTile &tile, double frame,
|
||||
const TRenderSettings &rend_sets) {
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "stdfx.h"
|
||||
|
||||
#include "ino_common.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_hsv_adjust final : public TStandardRasterFx {
|
||||
class ino_hsv_adjust final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_hsv_adjust)
|
||||
TRasterFxPort m_input;
|
||||
TRasterFxPort m_refer;
|
||||
|
@ -124,7 +125,8 @@ void fx_(TRasterP in_ras, const TRasterP refer_ras, const int refer_mode,
|
|||
|
||||
,
|
||||
hue_pivot, hue_scale, hue_shift, sat_pivot, sat_scale, sat_shift,
|
||||
val_pivot, val_scale, val_shift
|
||||
val_pivot, val_scale,
|
||||
val_shift
|
||||
|
||||
//,true /* add_blend_sw */
|
||||
,
|
||||
|
@ -135,7 +137,7 @@ void fx_(TRasterP in_ras, const TRasterP refer_ras, const int refer_mode,
|
|||
ino::arr_to_ras(in_gr8->getRawData(), ino::channels(), in_ras, 0);
|
||||
in_gr8->unlock();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
//------------------------------------------------------------
|
||||
void ino_hsv_adjust::doCompute(TTile &tile, double frame,
|
||||
const TRenderSettings &rend_sets) {
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "stdfx.h"
|
||||
|
||||
#include "ino_common.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_hsv_noise final : public TStandardRasterFx {
|
||||
class ino_hsv_noise final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_hsv_noise)
|
||||
TRasterFxPort m_input;
|
||||
TRasterFxPort m_refer;
|
||||
|
@ -152,7 +153,7 @@ void fx_(TRasterP in_ras, const TRasterP refer_ras, const int refer_mode
|
|||
ino::arr_to_ras(in_gr8->getRawData(), ino::channels(), in_ras, 0);
|
||||
in_gr8->unlock();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
//------------------------------------------------------------
|
||||
void ino_hsv_noise::doCompute(TTile &tile, double frame,
|
||||
const TRenderSettings &rend_sets) {
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "stdfx.h"
|
||||
|
||||
#include "ino_common.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_level_auto final : public TStandardRasterFx {
|
||||
class ino_level_auto final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_level_auto)
|
||||
TRasterFxPort m_input;
|
||||
TDoubleParamP m_in_min_shift;
|
||||
|
@ -86,7 +87,7 @@ void fx_(TRasterP in_ras, bool *act_sw, double *in_min_shift,
|
|||
ino::arr_to_ras(in_gr8->getRawData(), ino::channels(), in_ras, 0);
|
||||
in_gr8->unlock();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
//------------------------------------------------------------
|
||||
void ino_level_auto::doCompute(TTile &tile, double frame,
|
||||
const TRenderSettings &rend_sets) {
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
#include "tparamset.h"
|
||||
|
||||
#include "ino_common.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_level_master final : public TStandardRasterFx {
|
||||
class ino_level_master final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_level_master)
|
||||
TRasterFxPort m_input;
|
||||
TRasterFxPort m_refer;
|
||||
|
|
|
@ -4,8 +4,9 @@
|
|||
#include "tparamset.h"
|
||||
|
||||
#include "ino_common.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_level_rgba final : public TStandardRasterFx {
|
||||
class ino_level_rgba final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_level_rgba)
|
||||
TRasterFxPort m_input;
|
||||
TRasterFxPort m_refer;
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
#include "tfxparam.h"
|
||||
#include "stdfx.h"
|
||||
|
||||
#include "globalcontrollablefx.h"
|
||||
#include "ino_common.h"
|
||||
//------------------------------------------------------------
|
||||
class ino_negate final : public TStandardRasterFx {
|
||||
class ino_negate final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ino_negate)
|
||||
TRasterFxPort m_input;
|
||||
TBoolParamP m_red;
|
||||
|
@ -68,7 +69,7 @@ void fx_(TRasterP in_ras, const bool sw_array[4]) {
|
|||
ino::arr_to_ras(in_gr8->getRawData(), ino::channels(), in_ras, 0);
|
||||
in_gr8->unlock();
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
//------------------------------------------------------------
|
||||
void ino_negate::doCompute(TTile &tile, double frame,
|
||||
const TRenderSettings &rend_sets) {
|
||||
|
|
|
@ -3,8 +3,9 @@
|
|||
#include "stdfx.h"
|
||||
#include "tfxparam.h"
|
||||
#include "tspectrumparam.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
class MultiToneFx final : public TStandardRasterFx {
|
||||
class MultiToneFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(MultiToneFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
|
|
@ -3,10 +3,11 @@
|
|||
#include "stdfx.h"
|
||||
#include "tfxparam.h"
|
||||
#include "ttzpimagefx.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
//===================================================================
|
||||
|
||||
class PaletteFilterFx final : public TStandardRasterFx {
|
||||
class PaletteFilterFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(PaletteFilterFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
|
|
@ -6,8 +6,9 @@
|
|||
#include "stdfx.h"
|
||||
|
||||
#include "tparamset.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
class RGBKeyFx final : public TStandardRasterFx {
|
||||
class RGBKeyFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(RGBKeyFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
@ -61,7 +62,7 @@ void update_param(int ¶m, TRaster64P ras) {
|
|||
param = param * 257;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} // namespace
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
#include "tpixelutils.h"
|
||||
|
||||
#include "tparamset.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
class RGBMCutFx final : public TStandardRasterFx {
|
||||
class RGBMCutFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(RGBMCutFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
|
|
@ -4,10 +4,11 @@
|
|||
#include "tfxparam.h"
|
||||
#include "texception.h"
|
||||
#include "stdfx.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
//===================================================================
|
||||
|
||||
class RGBMScaleFx final : public TStandardRasterFx {
|
||||
class RGBMScaleFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(RGBMScaleFx)
|
||||
TRasterFxPort m_input;
|
||||
TDoubleParamP m_red;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "tparamset.h"
|
||||
#include "ttonecurveparam.h"
|
||||
#include "tcurves.h"
|
||||
#include "globalcontrollablefx.h"
|
||||
|
||||
//===================================================================
|
||||
|
||||
|
@ -108,7 +109,7 @@ void fill_lut(QList<TPointD> points, std::vector<T> &lut, bool isLinear) {
|
|||
|
||||
//===================================================================
|
||||
|
||||
class ToneCurveFx final : public TStandardRasterFx {
|
||||
class ToneCurveFx final : public GlobalControllableFx {
|
||||
FX_PLUGIN_DECLARATION(ToneCurveFx)
|
||||
|
||||
TRasterFxPort m_input;
|
||||
|
|
|
@ -14,7 +14,8 @@ TFxAttributes::TFxAttributes()
|
|||
, m_speed()
|
||||
, m_groupSelector(-1)
|
||||
, m_passiveCacheDataIdx(-1)
|
||||
, m_fxVersion(1) {}
|
||||
, m_fxVersion(1)
|
||||
, m_hasGlobalControl(false) {}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
|
|
@ -33,9 +33,12 @@
|
|||
|
||||
#include "../stdfx/motionawarebasefx.h"
|
||||
#include "../stdfx/textawarebasefx.h"
|
||||
#include "../stdfx/globalcontrollablefx.h"
|
||||
|
||||
#include "toonz/scenefx.h"
|
||||
|
||||
#include <QList>
|
||||
|
||||
/*
|
||||
TODO: Some parts of the following render-tree building procedure should be
|
||||
revised. In particular,
|
||||
|
@ -548,6 +551,8 @@ public:
|
|||
// (at least) of a particle Fx
|
||||
int m_particleDescendentCount;
|
||||
|
||||
QList<std::wstring> m_globalControlledFx;
|
||||
|
||||
public:
|
||||
FxBuilder(ToonzScene *scene, TXsheet *xsh, double frame, int whichLevels,
|
||||
bool isPreview = false, bool expandXSheet = true);
|
||||
|
@ -1002,6 +1007,24 @@ PlacedFx FxBuilder::makePFfromUnaryFx(TFx *fx) {
|
|||
TFx *inputFx = fx->getInputPort(0)->getFx();
|
||||
if (!inputFx) return PlacedFx();
|
||||
|
||||
// global controllable fx
|
||||
if (fx->getAttributes()->hasGlobalControl() &&
|
||||
!m_globalControlledFx.contains(fx->getFxId())) {
|
||||
GlobalControllableFx *gcFx = dynamic_cast<GlobalControllableFx *>(fx);
|
||||
double val = gcFx->getGrobalControlValue(m_frame);
|
||||
if (val < 1.0) {
|
||||
m_globalControlledFx.append(fx->getFxId());
|
||||
// insert cross disolve fx and mix with the input fx
|
||||
TFxP blendFx = TFx::create("blendFx");
|
||||
blendFx->connect("Source1", fx);
|
||||
blendFx->connect("Source2", inputFx);
|
||||
// set the global intensity value to the cross disolve fx
|
||||
dynamic_cast<TDoubleParam *>(blendFx->getParams()->getParam("value"))
|
||||
->setDefaultValue(val * 100.0);
|
||||
return makePF(blendFx.getPointer());
|
||||
}
|
||||
}
|
||||
|
||||
PlacedFx pf = makePF(inputFx); // Build sub-render-tree
|
||||
if (!pf.m_fx) return PlacedFx();
|
||||
|
||||
|
@ -1068,6 +1091,26 @@ PlacedFx FxBuilder::makePFfromGenericFx(TFx *fx) {
|
|||
return pf;
|
||||
}
|
||||
|
||||
// global controllable fx
|
||||
if (fx->getAttributes()->hasGlobalControl() &&
|
||||
!m_globalControlledFx.contains(fx->getFxId())) {
|
||||
GlobalControllableFx *gcFx = dynamic_cast<GlobalControllableFx *>(fx);
|
||||
double val = gcFx->getGrobalControlValue(m_frame);
|
||||
if (val < 1.0) {
|
||||
TFxP inputFx = fx->getInputPort(fx->getPreferredInputPort())->getFx();
|
||||
if (!inputFx) return pf;
|
||||
m_globalControlledFx.append(fx->getFxId());
|
||||
// insert cross disolve fx and mix with the input fx
|
||||
TFxP blendFx = TFx::create("blendFx");
|
||||
blendFx->connect("Source1", fx);
|
||||
blendFx->connect("Source2", inputFx.getPointer());
|
||||
// set the global intensity value to the cross disolve fx
|
||||
dynamic_cast<TDoubleParam *>(blendFx->getParams()->getParam("value"))
|
||||
->setDefaultValue(val * 100.0);
|
||||
return makePF(blendFx.getPointer());
|
||||
}
|
||||
}
|
||||
|
||||
// Multi-input fxs are always cloned - since at least one of its input ports
|
||||
// will have an NaAffineFx
|
||||
// injected just before its actual input fx.
|
||||
|
|
|
@ -423,6 +423,20 @@ public:
|
|||
if (paramName == paramNameToCheck ||
|
||||
toLower(paramName) == toLower(paramNameToCheck))
|
||||
return param;
|
||||
|
||||
// in case the parameter has ui label
|
||||
// ( paramters of plugin fxs and intensity of GlobalControllableFx)
|
||||
if (param->hasUILabel()) {
|
||||
paramName = param->getUILabel();
|
||||
int i = paramName.find_first_of(" -");
|
||||
while (i != std::string::npos) {
|
||||
paramName.erase(i, 1);
|
||||
i = paramName.find_first_of(" -");
|
||||
}
|
||||
if (paramName == paramNameToCheck ||
|
||||
toLower(paramName) == toLower(paramNameToCheck))
|
||||
return param;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -712,8 +712,12 @@ void FunctionTreeModel::Channel::setParam(const TParamP ¶m) {
|
|||
/*! in order to show the expression name in the tooltip
|
||||
*/
|
||||
QString FunctionTreeModel::Channel::getExprRefName() const {
|
||||
QString tmpName = QString(QString::fromStdWString(
|
||||
TStringTable::translate(m_paramNamePref + m_param->getName())));
|
||||
QString tmpName;
|
||||
if (m_param->hasUILabel())
|
||||
tmpName = QString::fromStdString(m_param->getUILabel());
|
||||
else
|
||||
tmpName = QString::fromStdWString(
|
||||
TStringTable::translate(m_paramNamePref + m_param->getName()));
|
||||
/*--- stage
|
||||
* objectパラメータの場合、TableにあわせてtmpNameを代表的なExpression名にする---*/
|
||||
StageObjectChannelGroup *stageGroup =
|
||||
|
|
|
@ -445,6 +445,44 @@ void ParamsPage::setPageField(TIStream &is, const TFxP &fx, bool isVertical) {
|
|||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// add a slider for global control
|
||||
void ParamsPage::addGlobalControl(const TFxP &fx) {
|
||||
if (!fx->getAttributes()->hasGlobalControl()) return;
|
||||
|
||||
std::string name = "globalIntensity";
|
||||
|
||||
TParamP param = fx->getParams()->getParam(name);
|
||||
if (!param) return;
|
||||
|
||||
assert(param->hasUILabel());
|
||||
QString str = QString::fromStdString(param->getUILabel());
|
||||
ParamField *field = ParamField::create(this, str, param);
|
||||
if (!field) return;
|
||||
|
||||
int currentRow = m_mainLayout->rowCount();
|
||||
if (!m_fields.isEmpty()) {
|
||||
Separator *sep = new Separator("", this);
|
||||
m_mainLayout->addWidget(sep, currentRow, 0, 1, 2);
|
||||
m_mainLayout->setRowStretch(currentRow, 0);
|
||||
currentRow = m_mainLayout->rowCount();
|
||||
}
|
||||
|
||||
m_fields.push_back(field);
|
||||
QLabel *label = new QLabel(str, this);
|
||||
label->setObjectName("FxSettingsLabel");
|
||||
m_mainLayout->addWidget(label, currentRow, 0,
|
||||
Qt::AlignRight | Qt::AlignVCenter);
|
||||
m_mainLayout->addWidget(field, currentRow, 1);
|
||||
|
||||
connect(field, SIGNAL(currentParamChanged()), m_paramViewer,
|
||||
SIGNAL(currentFxParamChanged()));
|
||||
connect(field, SIGNAL(actualParamChanged()), m_paramViewer,
|
||||
SIGNAL(actualFxParamChanged()));
|
||||
connect(field, SIGNAL(paramKeyToggle()), m_paramViewer,
|
||||
SIGNAL(paramKeyChanged()));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void ParamsPage::setPageSpace() {
|
||||
|
@ -917,7 +955,14 @@ void ParamsPageSet::createPage(TIStream &is, const TFxP &fx, int index) {
|
|||
if (pageName == "") pageName = "page";
|
||||
|
||||
ParamsPage *paramsPage = new ParamsPage(this, m_parent);
|
||||
paramsPage->setPage(is, fx);
|
||||
|
||||
bool isFirstPageOfFx;
|
||||
if (index < 0)
|
||||
isFirstPageOfFx = (m_pagesList->count() == 0);
|
||||
else // macro fx case
|
||||
isFirstPageOfFx = !(m_pageFxIndexTable.values().contains(index));
|
||||
|
||||
paramsPage->setPage(is, fx, isFirstPageOfFx);
|
||||
|
||||
connect(paramsPage, SIGNAL(preferredPageSizeChanged()), this,
|
||||
SLOT(recomputePreferredSize()));
|
||||
|
|
Loading…
Reference in a new issue