Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------
Toshihiro Shimizu 890ddd
// Iwa_TiledParticlesFx for Marnie
Toshihiro Shimizu 890ddd
// based on ParticlesFx by Digital Video
Toshihiro Shimizu 890ddd
//------------------------------------------------------------------
Toshihiro Shimizu 890ddd
#ifndef IWA_TILEDPARTICLESFX_H
Toshihiro Shimizu 890ddd
#define IWA_TILEDPARTICLESFX_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "stdfx.h"
Toshihiro Shimizu 890ddd
#include "tfxparam.h"
Toshihiro Shimizu 890ddd
#include "tspectrumparam.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//******************************************************************
Toshihiro Shimizu 890ddd
//	Iwa_Particles Fx  class
Toshihiro Shimizu 890ddd
//******************************************************************
Toshihiro Shimizu 890ddd
Shinya Kitaoka d1f6c4
class Iwa_TiledParticlesFx final : public TStandardZeraryFx {
Shinya Kitaoka 120a6e
  FX_PLUGIN_DECLARATION(Iwa_TiledParticlesFx)
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  TFxPortDG m_source, m_control;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  TIntParamP source_ctrl_val;
Shinya Kitaoka 120a6e
  TIntParamP bright_thres_val;
Shinya Kitaoka 120a6e
  TPointParamP center_val;
Shinya Kitaoka 120a6e
  TDoubleParamP length_val;
Shinya Kitaoka 120a6e
  TDoubleParamP height_val;
Shinya Kitaoka 120a6e
  TDoubleParamP maxnum_val;
Shinya Kitaoka 120a6e
  TRangeParamP lifetime_val;
Shinya Kitaoka 120a6e
  TIntParamP lifetime_ctrl_val;
Shinya Kitaoka 120a6e
  TBoolParamP column_lifetime_val;
Shinya Kitaoka 120a6e
  TIntParamP startpos_val;
Shinya Kitaoka 120a6e
  TIntParamP randseed_val;
Shinya Kitaoka 120a6e
  TDoubleParamP gravity_val;
Shinya Kitaoka 120a6e
  TDoubleParamP g_angle_val;
Shinya Kitaoka 120a6e
  TIntParamP gravity_ctrl_val;
Shinya Kitaoka 120a6e
  TDoubleParamP friction_val;
Shinya Kitaoka 120a6e
  TIntParamP friction_ctrl_val;
Shinya Kitaoka 120a6e
  TDoubleParamP windint_val;
Shinya Kitaoka 120a6e
  TDoubleParamP windangle_val;
Shinya Kitaoka 120a6e
  TIntEnumParamP swingmode_val;
Shinya Kitaoka 120a6e
  TRangeParamP randomx_val;
Shinya Kitaoka 120a6e
  TRangeParamP randomy_val;
Shinya Kitaoka 120a6e
  TIntParamP randomx_ctrl_val;
Shinya Kitaoka 120a6e
  TIntParamP randomy_ctrl_val;
Shinya Kitaoka 120a6e
  TRangeParamP swing_val;
Shinya Kitaoka 120a6e
  TRangeParamP speed_val;
Shinya Kitaoka 120a6e
  TIntParamP speed_ctrl_val;
Shinya Kitaoka 120a6e
  TRangeParamP speeda_val;
Shinya Kitaoka 120a6e
  TIntParamP speeda_ctrl_val;
Shinya Kitaoka 120a6e
  TBoolParamP speeda_use_gradient_val;
Shinya Kitaoka 120a6e
  TBoolParamP speedscale_val;
Shinya Kitaoka 120a6e
  TIntEnumParamP toplayer_val;
Shinya Kitaoka 120a6e
  TRangeParamP mass_val;
Shinya Kitaoka 120a6e
  TRangeParamP scale_val;
Shinya Kitaoka 120a6e
  TIntParamP scale_ctrl_val;
Shinya Kitaoka 120a6e
  TBoolParamP scale_ctrl_all_val;
Shinya Kitaoka 120a6e
  TRangeParamP rot_val;
Shinya Kitaoka 120a6e
  TIntParamP rot_ctrl_val;
Shinya Kitaoka 120a6e
  TRangeParamP trail_val;
Shinya Kitaoka 120a6e
  TDoubleParamP trailstep_val;
Shinya Kitaoka 120a6e
  TIntEnumParamP rotswingmode_val;
Shinya Kitaoka 120a6e
  TDoubleParamP rotspeed_val;
Shinya Kitaoka 120a6e
  TRangeParamP rotsca_val;
Shinya Kitaoka 120a6e
  TRangeParamP rotswing_val;
Shinya Kitaoka 120a6e
  TBoolParamP pathaim_val;
Shinya Kitaoka 120a6e
  TRangeParamP opacity_val;
Shinya Kitaoka 120a6e
  TIntParamP opacity_ctrl_val;
Shinya Kitaoka 120a6e
  TRangeParamP trailopacity_val;
Shinya Kitaoka 120a6e
  TRangeParamP scalestep_val;
Shinya Kitaoka 120a6e
  TIntParamP scalestep_ctrl_val;
Shinya Kitaoka 120a6e
  TDoubleParamP fadein_val;
Shinya Kitaoka 120a6e
  TDoubleParamP fadeout_val;
Shinya Kitaoka 120a6e
  TIntEnumParamP animation_val;
Shinya Kitaoka 120a6e
  TIntParamP step_val;
Shinya Kitaoka 120a6e
  TSpectrumParamP gencol_val;
Shinya Kitaoka 120a6e
  TIntParamP gencol_ctrl_val;
Shinya Kitaoka 120a6e
  TDoubleParamP gencol_spread_val;
Shinya Kitaoka 120a6e
  TDoubleParamP genfadecol_val;
Shinya Kitaoka 120a6e
  TSpectrumParamP fincol_val;
Shinya Kitaoka 120a6e
  TIntParamP fincol_ctrl_val;
Shinya Kitaoka 120a6e
  TDoubleParamP fincol_spread_val;
Shinya Kitaoka 120a6e
  TDoubleParamP finrangecol_val;
Shinya Kitaoka 120a6e
  TDoubleParamP finfadecol_val;
Shinya Kitaoka 120a6e
  TSpectrumParamP foutcol_val;
Shinya Kitaoka 120a6e
  TIntParamP foutcol_ctrl_val;
Shinya Kitaoka 120a6e
  TDoubleParamP foutcol_spread_val;
Shinya Kitaoka 120a6e
  TDoubleParamP foutrangecol_val;
Shinya Kitaoka 120a6e
  TDoubleParamP foutfadecol_val;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  TBoolParamP source_gradation_val;
Shinya Kitaoka 120a6e
  TBoolParamP pick_color_for_every_frame_val;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*-  計算モード (背景+粒子/粒子/背景/照明された粒子)-*/
Shinya Kitaoka 120a6e
  TIntEnumParamP iw_rendermode_val;
Shinya Kitaoka 120a6e
  /*- 粒子に貼られる絵の素材 -*/
Shinya Kitaoka 120a6e
  TIntParamP base_ctrl_val;
Shinya Kitaoka 120a6e
  /*- カールノイズ的な動きを与える -*/
Shinya Kitaoka 120a6e
  TDoubleParamP curl_val;
Shinya Kitaoka 120a6e
  /*- 手前奥でコントロールを2つ持たせ、疑似立体化 -*/
Shinya Kitaoka 120a6e
  TIntParamP curl_ctrl_1_val;
Shinya Kitaoka 120a6e
  TIntParamP curl_ctrl_2_val;
Shinya Kitaoka 120a6e
  /*- 粒子敷き詰め。粒子を正三角形で敷き詰めたときの、
Shinya Kitaoka 120a6e
          正三角形の一辺の長さをインチで指定する-*/
Shinya Kitaoka 120a6e
  TDoubleParamP iw_triangleSize;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*- ひらひら回転 -*/
Shinya Kitaoka 120a6e
  TIntParamP flap_ctrl_val;
Shinya Kitaoka 120a6e
  TDoubleParamP iw_flap_velocity_val;        /*- 回転角速度 -*/
Shinya Kitaoka 120a6e
  TDoubleParamP iw_flap_dir_sensitivity_val; /* - 回転軸感度 -*/
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*- ひらひら粒子に照明を当てる -*/
Shinya Kitaoka 120a6e
  TDoubleParamP iw_light_theta_val; /*- 光源の方向(Degree) -*/
Shinya Kitaoka 120a6e
  TDoubleParamP iw_light_phi_val;   /*- 光源の傾き(Degree) -*/
Shinya Kitaoka 120a6e
  /*- 読み込みマージン -*/
Shinya Kitaoka 120a6e
  TDoubleParamP margin_val;
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  /*- 重力を徐々に与えるためのフレーム長 -*/
Shinya Kitaoka 120a6e
  TIntParamP iw_gravityBufferFrame_val;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  enum { UNIT_SMALL_INCH, UNIT_INCH };
Shinya Kitaoka 120a6e
  enum { MATTE_REF, GRAY_REF, H_REF };
Shinya Kitaoka 120a6e
  enum { SWING_RANDOM, SWING_SMOOTH };
Shinya Kitaoka 120a6e
  enum {
Shinya Kitaoka 120a6e
    ANIM_HOLD,
Shinya Kitaoka 120a6e
    ANIM_RANDOM,
Shinya Kitaoka 120a6e
    ANIM_CYCLE,
Shinya Kitaoka 120a6e
    ANIM_R_CYCLE,
Shinya Kitaoka 120a6e
    ANIM_S_CYCLE,
Shinya Kitaoka 120a6e
    ANIM_SR_CYCLE
Shinya Kitaoka 120a6e
  };
Shinya Kitaoka 120a6e
  enum { TOP_YOUNGER, TOP_OLDER, TOP_SMALLER, TOP_BIGGER, TOP_RANDOM };
Shinya Kitaoka 120a6e
  /*- 計算モード (背景+粒子/粒子/背景/照明された粒子) -*/
Shinya Kitaoka 120a6e
  enum { REND_ALL, REND_PARTICLES, REND_BG, REND_ILLUMINATED };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  Iwa_TiledParticlesFx();
Shinya Kitaoka 120a6e
  ~Iwa_TiledParticlesFx();
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  bool isZerary() const override { return true; }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  int dynamicPortGroupsCount() const override { return 2; }
Shinya Kitaoka 473e70
  const TFxPortDG *dynamicPortGroup(int g) const override {
Shinya Kitaoka 120a6e
    return (g == 0) ? &m_source : (g == 1) ? &m_control : 0;
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 38fd86
  bool canHandle(const TRenderSettings &info, double frame) override {
Shinya Kitaoka 38fd86
    return true;
Shinya Kitaoka 38fd86
  }
Shinya Kitaoka 473e70
  bool allowUserCacheOnPort(int port) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 38fd86
  std::string getAlias(double frame,
Shinya Kitaoka 38fd86
                       const TRenderSettings &info) const override;
Shinya Kitaoka 38fd86
  bool doGetBBox(double frame, TRectD &bBox,
Shinya Kitaoka 38fd86
                 const TRenderSettings &info) override;
Shinya Kitaoka 473e70
  TFxTimeRegion getTimeRegion() const override {
Shinya Kitaoka 120a6e
    return TFxTimeRegion::createUnlimited();
Shinya Kitaoka 120a6e
  }
Toshihiro Shimizu 890ddd
Shinya Kitaoka 38fd86
  void doDryCompute(TRectD &rect, double frame,
Shinya Kitaoka 38fd86
                    const TRenderSettings &info) override;
Shinya Kitaoka 473e70
  void doCompute(TTile &tile, double frame, const TRenderSettings &ri) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 473e70
  void getParamUIs(TParamUIConcept *&concepts, int &length) override;
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
  void compatibilityTranslatePort(int majorVersion, int minorVersion,
Shinya Kitaoka 473e70
                                  std::string &portName) override;
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
#endif  // IWA_TILEDPARTICLESFX_H