OROCHI
 
Loading...
Searching...
No Matches
GxToolMotionBlend.h
Go to the documentation of this file.
1//===========================================================================
8//
9//===========================================================================
10#pragma once
11
12#if GX_EDITOR
13
14GX_MOTION_NAMESPACE_BEGIN()
15
16//===========================================================================
18//===========================================================================
19class GxToolMotionBlend : public GxToolResourceEditBase
20{
21 //-----------------------------------------------------------
23 //-----------------------------------------------------------
25public:
26 // RTTI定義
27 GX_RTTI_CLASS_NAME_ICON(GxToolMotionBlend, GxToolResourceEditBase, "モーションブレンド編集", GxRtti::ICON_TYPE::MOTION)
28 GX_PROHIBIT_CLASS_BASE_REFERENCE( GxToolMotionBlend )
29private:
31 static constexpr u32 OFFSET_MOTION_LIST = 230;
33 static constexpr u32 OFFSET_FILE_PATH = 70;
34
35 class GxGuiFormControl;
36 class GxGuiPropertyTableMotion;
37
39 //-----------------------------------------------------------
41 //-----------------------------------------------------------
43public:
45 GxToolMotionBlend(void);
47 void cleanup(void) override;
49 b32 initialize( void ) override;
50
52 //-----------------------------------------------------------
54 //-----------------------------------------------------------
56private:
58 void save(void) override;
60 void load(u32 attribute) override;
62 void convertAs( u32 attribute ) override;
64 void convert( void ) override;
66 void setResource(GxResBase* pRes) override;
68 void setResourceModel( GxResModel* pResModel );
70 void setResourceMotionPackage( GxResMotionPackage* pResMotionPackage );
72 void setResourceMotionBlendXml( GxResMotionBlendXml* pResMotionBlend );
73public:
75 void updateNeedModule(void);
76
78 void onCreate(void) override;
80 void update(void) override;
82 void addMenuOwnProperty(GxPropertyTable& table) override;
84 static GxGuiBase* createGui(GxProperty& property, GxTypedObject* pOwner, const GxRtti& rtti, u32 index = 0);
85private:
87 static GxString removeReservedCharacters(GxString string);
89 void createUnitModel(void);
91 void changeMotion(s32 motionNumber);
93 b32 createGuiFilePath(void);
95 void createGuiMotionTable(void);
97 void eventButtonCreateBlendResource(void);
99 void createBlendResource(void);
100
102 //-----------------------------------------------------------
104 //-----------------------------------------------------------
106public:
108 constexpr void getPropertyResModel(void* const pValue) { *static_cast<GxResModel**>(pValue) = _pResModel; }
110 void setPropertyResModel(const void* const pValue);
112 constexpr void getPropertyGxResMotionPackage(void* const pValue) { *static_cast<GxResMotionPackage**>(pValue) = _pResMotionPackage; }
114 void setPropertyGxResMotionPackage(const void* const pValue);
116 constexpr void getPropertyResMotionBlendXml(void* const pValue) { *static_cast<GxResMotionBlendXml**>(pValue) = _pResMotionBlendXml; }
118 void setPropertyResMotionBlendXml(const void* const pValue);
120 void getPropertyInterpolateXTranslate(const void* pValue);
122 void getPropertyInterpolateYTranslate(const void* pValue);
124 void getPropertyInterpolateZTranslate(const void* pValue);
126 void getPropertyInterpolatePosition(const void* pValue);
128 void getPropertyInterpolateRotate(const void* pValue);
130 void getPropertyInterpolateScale(const void* pValue);
132 void getPropertyInterpolateLoop(const void* pValue);
134 void setPropertyInterpolateXTranslate(const void* pValue);
136 void setPropertyInterpolateYTranslate(const void* pValue);
138 void setPropertyInterpolateZTranslate(const void* pValue);
140 void setPropertyInterpolatePosition(const void* pValue);
142 void setPropertyInterpolateRotate(const void* pValue);
144 void setPropertyInterpolateScale(const void* pValue);
146 void setPropertyInterpolateLoop(const void* pValue);
147
149 constexpr GxUnitMotion* getModel(void) const { return _pUnitModel; }
151 constexpr GxResMotionBlendXml* getResMotionBlendXml(void) const { return _pResMotionBlendXml; }
153 GX_FORCE_INLINE GxMotionNamesList* getMotionNamesList(void){ return &_motionNamesList; }
155 constexpr GxGuiFormControl* getFormControl(void) const { return _pFormControl; }
157 constexpr GxGuiPropertyTableMotion* getMotionTable(void) const { return _pMotionTable; }
158
160 //-----------------------------------------------------------
162 //-----------------------------------------------------------
164private:
165 GxResModel* _pResModel;
166 GxUnitMotion* _pUnitModel;
167 GxResMotionPackage* _pResMotionPackage;
168 GxResMotionBlendXml* _pResMotionBlendXml;
169 GxMotionNamesList _motionNamesList;
170 GxString _resBlendPathByDialog;
171 GxGuiSplitter* _pSplitterMain;
172 GxGuiSplitter* _pSplitterFile;
173 GxGuiFormControl* _pFormControl;
174 GxGuiPropertyTableMotion* _pMotionTable;
175 s32 _oldBaseMotion;
176 s32 _oldBlendMotion[static_cast<u32>(GxModUnitMotionBlend::MOTION_PLAYER::BLEND_MAX)];
177
179};
180
181//===========================================================================
183//===========================================================================
184class GxToolMotionBlend::GxGuiFormControl : public GxGuiForm
185{
186 //-----------------------------------------------------------
188 //-----------------------------------------------------------
190public:
191 // RTTI定義
192 GX_RTTI_CLASS(GxToolMotionBlend::GxGuiFormControl, GxGuiForm)
193 // GxClassBaseReference継承クラス用禁止宣言
194 GX_PROHIBIT_CLASS_BASE_REFERENCE( GxGuiFormControl )
195
196
197 //-----------------------------------------------------------
199 //-----------------------------------------------------------
201public:
203 GxGuiFormControl(GxToolMotionBlend* pRoot = nullptr);
205 b32 initialize( void ) override;
206
208 //-----------------------------------------------------------
210 //-----------------------------------------------------------
212public:
214 void createMotionGui(void);
216 void update(void) override;
218 void pushButtonPlay(void);
220 void onPlay (void);
222 void offPlay(void);
224 void addFrame(f32 addFrame);
226 void pushButtonTop(void);
228 void pushButtonBottom(void);
230 void pushButtonBack(void);
232 void pushButtonForward(void);
233
235 //-----------------------------------------------------------
237 //-----------------------------------------------------------
239public:
241 constexpr GxUnitMotion* getModel(void) const { if(!_pRoot){ return nullptr; } return _pRoot->getModel(); }
243 GX_FORCE_INLINE b32 isPlay(void) const { return _isMotionPlaying; }
245 constexpr s32 getBaseMotionNumber (void) const { return _baseMotionNumber; }
247 constexpr s32 getTargetMotionNumber (void) const { return _targetMotionNumber; }
249 GX_FORCE_INLINE b32 isDrawModel(void) const { return _isDrawModel; }
251 GX_FORCE_INLINE b32 isDrawJointLine(void) const { return _isDrawJointLine; }
253 GX_FORCE_INLINE b32 isDrawJointName(void) const { return _isDrawJointName; }
254
256 //-----------------------------------------------------------
258 //-----------------------------------------------------------
260private:
261 GxToolMotionBlend* _pRoot;
262 GxGuiButton* _pButtonPlay;
263 f32 _motionSpeed;
264 b32 _isMotionPlaying;
265 s32 _baseMotionNumber;
266 s32 _targetMotionNumber;
267 GxGuiPropertyComboBoxEnum* _pGuiEnumStartMotion;
268 GxGuiPropertyComboBoxEnum* _pGuiEnumBlendMotion;
269 b32 _isDrawModel;
270 b32 _isDrawJointLine;
271 b32 _isDrawJointName;
272
274};
275
276//===========================================================================
278//===========================================================================
279class GxToolMotionBlend::GxGuiPropertyTableMotion : public gx::core::GxGuiPropertyTable
280{
281 //-----------------------------------------------------------
283 //-----------------------------------------------------------
285public:
286 GX_RTTI_CLASS( GxToolMotionBlend::GxGuiPropertyTableMotion, gx::core::GxGuiPropertyTable )
287 // GxClassBaseReference継承クラス用禁止宣言
288 GX_PROHIBIT_CLASS_BASE_REFERENCE(GxGuiPropertyTableMotion)
289
290
291 //-----------------------------------------------------------
293 //-----------------------------------------------------------
295private:
297 GxGuiPropertyTableMotion( void ) : _pRoot(nullptr), _pSelectObject(nullptr){}
298public:
300 GxGuiPropertyTableMotion( GxToolMotionBlend* pTool, const GxProperty& property, GxTypedObject* pObject, u32 index = 0, b32 useFilter = false, TYPE type = TYPE::HORIZON );
301
303 //-----------------------------------------------------------
305 //-----------------------------------------------------------
307public:
309 GX_FORCE_INLINE b32 isChange( void ){ return updateObjectList(); }
311 GX_FORCE_INLINE b32 isChangeBlendParameterCount(void) const { return _isChangeBlendParameterCount; }
313 constexpr void resetIsChangeBlendParameterCount(void){ _isChangeBlendParameterCount = false; }
315 constexpr s32 getSelectBlendMotion(void){ return _pSelectObject ? static_cast<s32>(_pSelectObject->_targetMotionNumber) : -1; }
316
318 //-----------------------------------------------------------
320 //-----------------------------------------------------------
322private:
324 void onClick( const GxPoint2& position, u32 button ) override;
326 void createPopUpMenu(const GxPoint2& position);
328 void eventDeleteInterpolationSettings(void);
330 void eventCreateInterpolationSettings(GxResMotionBlend::BlendParam::BLEND_TYPE blendType);
331
333 //-----------------------------------------------------------
335 //-----------------------------------------------------------
337private:
338 GxToolMotionBlend* _pRoot;
339 GxResMotionBlend::BlendParam* _pSelectObject;
340 b32 _isChangeBlendParameterCount;
341
343};
344
345GX_MOTION_NAMESPACE_END()
346#endif // GX_EDITOR
#define GX_PROHIBIT_CLASS_BASE_REFERENCE(__CLASS__)
GxClassBaseReference継承の禁止宣言(new以外の生成禁止 + コピー禁止)
Definition GxBase.h:244
void GxTypedObject
その他
Definition GxDefine.h:213
@ BLEND_MAX
ブレンドモーションの最大数
プロパティクラス
Definition GxProperty.h:48
プロパティテーブルクラス
Definition GxProperty.h:1641
リソース基底クラス
Definition GxResBase.h:23
モデルリソースクラス
Definition GxResModel.h:20
ブレンド用パラメーター
Definition GxResMotionBlend.h:31
BLEND_TYPE
ブレンドタイプ
Definition GxResMotionBlend.h:48
モーションパッケージリソース
Definition GxResMotionPackage.h:20
実行時型情報クラス
Definition GxRtti.h:154
モーションユニット
Definition GxUnitMotion.h:20
座標
Definition GxStruct.h:867
文字列型クラス
Definition GxString.h:18
32bitブーリアン
Definition GxDefine.h:173