1 // NeL - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2019 Jan BOON (Kaetemi) <jan.boon@kaetemi.be>
7 // This program is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Affero General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU Affero General Public License for more details.
17 // You should have received a copy of the GNU Affero General Public License
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include "object_viewer.h"
22 #include "select_string.h"
24 #include <nel/misc/common.h>
27 #define DELTA_BLEND 0.1f
28 #define DELTA_TIME (getTimeIncrement ())
29 #define DELTA_MUL 0.1f
31 using namespace NLMISC
;
34 /////////////////////////////////////////////////////////////////////////////
38 CSlotDlg::CSlotDlg(CWnd
* pParent
/*=NULL*/)
39 : CDialog(CSlotDlg::IDD
, pParent
)
41 //{{AFX_DATA_INIT(CSlotDlg)
47 SkeletonWeightInverted
= FALSE
;
58 void CSlotDlg::init (uint id
, CObjectViewer
* mainDlg
)
64 void CSlotDlg::DoDataExchange(CDataExchange
* pDX
)
66 CDialog::DoDataExchange(pDX
);
67 //{{AFX_DATA_MAP(CSlotDlg)
68 DDX_Control(pDX
, IDC_INVERT_SKELETON_WEIGHT
, InvertSkeletonWeightCtrl
);
69 DDX_Control(pDX
, IDC_ALIGN_BLEND
, AlignBlendCtrl
);
70 DDX_Control(pDX
, IDC_CLAMP
, ClampCtrl
);
71 DDX_Control(pDX
, IDC_SCROLLBAR
, ScrollBarCtrl
);
72 DDX_Control(pDX
, IDC_OFFSET_SPIN
, OffsetSpinCtrl
);
73 DDX_Control(pDX
, IDC_OFFSET
, OffsetCtrl
);
74 DDX_Control(pDX
, IDC_START_TIME_SPIN
, StartTimeSpinCtrl
);
75 DDX_Control(pDX
, IDC_START_BLEND_SPIN
, StartBlendSpinCtrl
);
76 DDX_Control(pDX
, IDC_SPEED_FACTOR_SPIN
, SpeedFactorSpinCtrl
);
77 DDX_Control(pDX
, IDC_SMOOTHNESS_SPIN
, SmoothnessSpinCtrl
);
78 DDX_Control(pDX
, IDC_END_TIME_SPIN
, EndTimeSpinCtrl
);
79 DDX_Control(pDX
, IDC_END_BLEND_SPIN
, EndBlendSpinCtrl
);
80 DDX_Control(pDX
, IDC_START_TIME
, StartTimeCtrl
);
81 DDX_Control(pDX
, IDC_START_BLEND
, StartBlendCtrl
);
82 DDX_Control(pDX
, IDC_SPEED_FACTOR
, SpeddFactorCtrl
);
83 DDX_Control(pDX
, IDC_SMOOTHNESS
, SmoothnessCtrl
);
84 DDX_Control(pDX
, IDC_END_TIME
, EndTimeCtrl
);
85 DDX_Control(pDX
, IDC_END_BLEND
, EndBlendCtrl
);
86 DDX_Text(pDX
, IDC_END_BLEND
, EndBlend
);
87 DDX_Text(pDX
, IDC_SMOOTHNESS
, Smoothness
);
88 DDV_MinMaxFloat(pDX
, Smoothness
, 0.f
, 1.f
);
89 DDX_Text(pDX
, IDC_SPEED_FACTOR
, SpeedFactor
);
90 DDV_MinMaxFloat(pDX
, SpeedFactor
, 1.e
-002f
, 100.f
);
91 DDX_Text(pDX
, IDC_START_BLEND
, StartBlend
);
92 DDV_MinMaxFloat(pDX
, StartBlend
, 0.f
, 1.f
);
93 DDX_Radio(pDX
, IDC_CLAMP
, ClampMode
);
94 DDX_Check(pDX
, IDC_INVERT_SKELETON_WEIGHT
, SkeletonWeightInverted
);
95 DDX_Text(pDX
, IDC_OFFSET
, Offset
);
96 DDX_Text(pDX
, IDC_START_TIME
, StartTime
);
97 DDX_Text(pDX
, IDC_END_TIME
, EndTime
);
98 DDX_Check(pDX
, IDC_ENABLE
, enable
);
103 BEGIN_MESSAGE_MAP(CSlotDlg
, CDialog
)
104 //{{AFX_MSG_MAP(CSlotDlg)
106 ON_NOTIFY(UDN_DELTAPOS
, IDC_END_BLEND_SPIN
, OnDeltaposEndBlendSpin
)
107 ON_NOTIFY(UDN_DELTAPOS
, IDC_END_TIME_SPIN
, OnDeltaposEndTimeSpin
)
108 ON_NOTIFY(UDN_DELTAPOS
, IDC_SMOOTHNESS_SPIN
, OnDeltaposSmoothnessSpin
)
109 ON_NOTIFY(UDN_DELTAPOS
, IDC_SPEED_FACTOR_SPIN
, OnDeltaposSpeedFactorSpin
)
110 ON_NOTIFY(UDN_DELTAPOS
, IDC_START_BLEND_SPIN
, OnDeltaposStartBlendSpin
)
111 ON_NOTIFY(UDN_DELTAPOS
, IDC_START_TIME_SPIN
, OnDeltaposStartTimeSpin
)
112 ON_EN_CHANGE(IDC_END_BLEND
, OnChangeEndBlend
)
113 ON_EN_CHANGE(IDC_END_TIME
, OnChangeEndTime
)
114 ON_EN_CHANGE(IDC_SMOOTHNESS
, OnChangeSmoothness
)
115 ON_EN_CHANGE(IDC_SPEED_FACTOR
, OnChangeSpeedFactor
)
116 ON_EN_CHANGE(IDC_START_BLEND
, OnChangeStartBlend
)
117 ON_EN_CHANGE(IDC_START_TIME
, OnChangeStartTime
)
118 ON_BN_CLICKED(IDC_SET_ANIMATION
, OnSetAnimation
)
119 ON_BN_CLICKED(IDC_SET_SKELETON
, OnSetSkeleton
)
120 ON_EN_CHANGE(IDC_OFFSET
, OnChangeOffset
)
121 ON_NOTIFY(UDN_DELTAPOS
, IDC_OFFSET_SPIN
, OnDeltaposOffsetSpin
)
123 ON_BN_CLICKED(IDC_CLAMP
, OnClamp
)
124 ON_BN_CLICKED(IDC_REPEAT
, OnRepeat
)
125 ON_BN_CLICKED(IDC_DISABLE
, OnDisable
)
126 ON_BN_CLICKED(IDC_ALIGN_BLEND
, OnAlignBlend
)
128 ON_BN_CLICKED(IDC_ENABLE
, OnEnable
)
129 ON_BN_CLICKED(IDC_INVERT_SKELETON_WEIGHT
, OnInvertSkeletonWeight
)
133 /////////////////////////////////////////////////////////////////////////////
134 // CSlotDlg message handlers
136 BOOL
CSlotDlg::OnInitDialog()
138 CDialog::OnInitDialog();
140 // Init the blend window
143 return TRUE
; // return TRUE unless you set the focus to a control
144 // EXCEPTION: OCX Property Pages should return FALSE
147 // ***************************************************************************
149 void CSlotDlg::OnPaint()
151 //CPaintDC dc(this); // device context for painting
153 CDC
* pDc
=BeginPaint(&paint
);
155 // TODO: Add your message handler code here
158 GetDlgItem (IDC_DOOMY_BLEND
)->GetWindowRect (&rect
);
159 ScreenToClient (&rect
);
160 Blend
.OnPaint (rect
, pDc
, StartBlend
, EndBlend
, (float)StartTime
, (float)EndTime
,
161 Smoothness
, StartAnimTime
, EndAnimTime
, !isEmpty());
163 // Do not call CDialog::OnPaint() for painting messages
167 // ***************************************************************************
169 void CSlotDlg::OnDeltaposEndBlendSpin(NMHDR
* pNMHDR
, LRESULT
* pResult
)
171 NM_UPDOWN
* pNMUpDown
= (NM_UPDOWN
*)pNMHDR
;
172 // TODO: Add your control notification handler code here
178 if (pNMUpDown
->iDelta
<0)
179 EndBlend
+=DELTA_BLEND
;
180 if (pNMUpDown
->iDelta
>0)
181 EndBlend
-=DELTA_BLEND
;
182 clamp (EndBlend
, 0.f
, 1.f
);
187 // ***************************************************************************
189 void CSlotDlg::OnDeltaposEndTimeSpin(NMHDR
* pNMHDR
, LRESULT
* pResult
)
191 NM_UPDOWN
* pNMUpDown
= (NM_UPDOWN
*)pNMHDR
;
192 // TODO: Add your control notification handler code here
198 if (pNMUpDown
->iDelta
<0)
200 if (pNMUpDown
->iDelta
>0)
202 clamp (EndTime
, (int)StartAnimTime
, (int)EndAnimTime
);
203 if (EndTime
<StartTime
)
209 // ***************************************************************************
211 void CSlotDlg::OnDeltaposSmoothnessSpin(NMHDR
* pNMHDR
, LRESULT
* pResult
)
213 NM_UPDOWN
* pNMUpDown
= (NM_UPDOWN
*)pNMHDR
;
214 // TODO: Add your control notification handler code here
220 if (pNMUpDown
->iDelta
<0)
221 Smoothness
+=DELTA_BLEND
;
222 if (pNMUpDown
->iDelta
>0)
223 Smoothness
-=DELTA_BLEND
;
224 clamp (Smoothness
, 0.f
, 1.f
);
229 // ***************************************************************************
231 void CSlotDlg::OnDeltaposSpeedFactorSpin(NMHDR
* pNMHDR
, LRESULT
* pResult
)
233 NM_UPDOWN
* pNMUpDown
= (NM_UPDOWN
*)pNMHDR
;
234 // TODO: Add your control notification handler code here
240 if (pNMUpDown
->iDelta
<0)
241 SpeedFactor
+=DELTA_MUL
;
242 if (pNMUpDown
->iDelta
>0)
243 SpeedFactor
-=DELTA_MUL
;
244 clamp (SpeedFactor
, 0.01f
, 100.f
);
252 // ***************************************************************************
254 void CSlotDlg::OnDeltaposStartBlendSpin(NMHDR
* pNMHDR
, LRESULT
* pResult
)
256 NM_UPDOWN
* pNMUpDown
= (NM_UPDOWN
*)pNMHDR
;
257 // TODO: Add your control notification handler code here
263 if (pNMUpDown
->iDelta
<0)
264 StartBlend
+=DELTA_BLEND
;
265 if (pNMUpDown
->iDelta
>0)
266 StartBlend
-=DELTA_BLEND
;
267 clamp (StartBlend
, 0.f
, 1.f
);
272 // ***************************************************************************
274 void CSlotDlg::OnDeltaposStartTimeSpin(NMHDR
* pNMHDR
, LRESULT
* pResult
)
276 NM_UPDOWN
* pNMUpDown
= (NM_UPDOWN
*)pNMHDR
;
277 // TODO: Add your control notification handler code here
283 if (pNMUpDown
->iDelta
<0)
285 if (pNMUpDown
->iDelta
>0)
287 clamp (StartTime
, (int)StartAnimTime
, (int)EndAnimTime
);
288 if (EndTime
<StartTime
)
294 // ***************************************************************************
296 void CSlotDlg::OnChangeEndBlend()
298 // TODO: If this is a RICHEDIT control, the control will not
299 // send this notification unless you override the CDialog::OnInitDialog()
300 // function and call CRichEditCtrl().SetEventMask()
301 // with the ENM_CHANGE flag ORed into the mask.
303 // TODO: Add your control notification handler code here
306 clamp (EndBlend
, 0.f
, 1.f
);
311 // ***************************************************************************
313 void CSlotDlg::OnChangeEndTime()
315 // TODO: If this is a RICHEDIT control, the control will not
316 // send this notification unless you override the CDialog::OnInitDialog()
317 // function and call CRichEditCtrl().SetEventMask()
318 // with the ENM_CHANGE flag ORed into the mask.
320 // TODO: Add your control notification handler code here
323 clamp (EndTime
, (int)StartAnimTime
, (int)EndAnimTime
);
324 if (EndTime
<StartTime
)
330 // ***************************************************************************
332 void CSlotDlg::OnChangeSmoothness()
334 // TODO: If this is a RICHEDIT control, the control will not
335 // send this notification unless you override the CDialog::OnInitDialog()
336 // function and call CRichEditCtrl().SetEventMask()
337 // with the ENM_CHANGE flag ORed into the mask.
339 // TODO: Add your control notification handler code here
342 clamp (Smoothness
, 0.f
, 1.f
);
347 // ***************************************************************************
349 void CSlotDlg::OnChangeSpeedFactor()
351 // TODO: If this is a RICHEDIT control, the control will not
352 // send this notification unless you override the CDialog::OnInitDialog()
353 // function and call CRichEditCtrl().SetEventMask()
354 // with the ENM_CHANGE flag ORed into the mask.
356 // TODO: Add your control notification handler code here
359 clamp (SpeedFactor
, 0.01f
, 100.f
);
366 // ***************************************************************************
368 void CSlotDlg::OnChangeStartBlend()
370 // TODO: If this is a RICHEDIT control, the control will not
371 // send this notification unless you override the CDialog::OnInitDialog()
372 // function and call CRichEditCtrl().SetEventMask()
373 // with the ENM_CHANGE flag ORed into the mask.
375 // TODO: Add your control notification handler code here
378 clamp (StartBlend
, 0.f
, 1.f
);
383 // ***************************************************************************
385 void CSlotDlg::OnChangeStartTime()
387 // TODO: If this is a RICHEDIT control, the control will not
388 // send this notification unless you override the CDialog::OnInitDialog()
389 // function and call CRichEditCtrl().SetEventMask()
390 // with the ENM_CHANGE flag ORed into the mask.
392 // TODO: Add your control notification handler code here
395 clamp (StartTime
, (int)StartAnimTime
, (int)EndAnimTime
);
396 if (EndTime
<StartTime
)
403 // ***************************************************************************
405 void CSlotDlg::OnSetAnimation()
408 std::vector
<std::string
> vectString
;
410 // Build a list of string
411 for (uint a
=0; a
<getAnimationSetPointer()->getNumAnimation (); a
++)
412 vectString
.push_back (getAnimationSetPointer()->getAnimationName (a
));
415 CSelectString
select (vectString
, "Select your animation", this, true);
416 if (select
.DoModal ()==IDOK
)
419 if (select
.Selection
!=-1)
421 getSlotInformation ()->Animation
= vectString
[select
.Selection
];
426 getSlotInformation ()->Animation
.clear();
431 // ***************************************************************************
433 void CSlotDlg::OnSetSkeleton()
436 std::vector
<std::string
> vectString
;
438 // Build a list of string
439 for (uint s
=0; s
<getAnimationSetPointer()->getNumSkeletonWeight (); s
++)
440 vectString
.push_back (getAnimationSetPointer()->getSkeletonWeightName (s
));
443 CSelectString
select (vectString
, "Select your skeleton weight template", this, true);
444 if (select
.DoModal ()==IDOK
)
447 if (select
.Selection
!=-1)
448 getSlotInformation ()->Skeleton
= vectString
[select
.Selection
].c_str();
450 getSlotInformation ()->Skeleton
.clear();
457 // ***************************************************************************
459 void CSlotDlg::setWindowName ()
461 std::string tmp
= NLMISC::toString("Slot %d : ", Id
);
466 tmp
+= getSlotInformation ()->Animation
;
468 CSlotInfo
*information
= getSlotInformation ();
471 std::string SkeletonName
= information
->Skeleton
;
472 if (!SkeletonName
.empty())
474 tmp
+= " (" + SkeletonName
+ ")";
478 GetDlgItem(IDC_SLOT_NAME
)->SetWindowText(nlUtf8ToTStr(tmp
));
481 // ***************************************************************************
483 void CSlotDlg::OnChangeOffset()
485 // TODO: If this is a RICHEDIT control, the control will not
486 // send this notification unless you override the CDialog::OnInitDialog()
487 // function and call CRichEditCtrl().SetEventMask()
488 // with the ENM_CHANGE flag ORed into the mask.
490 // TODO: Add your control notification handler code here
497 // ***************************************************************************
499 void CSlotDlg::OnDeltaposOffsetSpin(NMHDR
* pNMHDR
, LRESULT
* pResult
)
501 NM_UPDOWN
* pNMUpDown
= (NM_UPDOWN
*)pNMHDR
;
502 // TODO: Add your control notification handler code here
505 if (pNMUpDown
->iDelta
<0)
507 if (pNMUpDown
->iDelta
>0)
517 // ***************************************************************************
519 void CSlotDlg::validateTime ()
522 if ((float)Offset
<StartAnimTime
)
524 StartAnimTime
=(float)Offset
;
527 if ((float)Offset
+AnimationLength
/SpeedFactor
>EndAnimTime
)
529 EndAnimTime
=(float)Offset
+AnimationLength
/SpeedFactor
;
533 MainDlg
->setAnimTime (StartAnimTime
, EndAnimTime
);
536 // ***************************************************************************
538 void CSlotDlg::updateScrollBar ()
542 memset (&info
, 0, sizeof (info
));
548 if (fabs(EndAnimTime
-StartAnimTime
)<0.00001f
)
555 info
.nPage
=(int)(10000.f
*(AnimationLength
/SpeedFactor
)/(EndAnimTime
-StartAnimTime
));
556 info
.nPos
=(int)(10000.f
*((float)Offset
-StartAnimTime
)/(EndAnimTime
-StartAnimTime
));
559 // Set scrollbar infos
560 ScrollBarCtrl
.SetScrollInfo (&info
, TRUE
);
562 // Invalidate blend bar
564 GetDlgItem (IDC_DOOMY_BLEND
)->GetWindowRect (&bar
);
565 ScreenToClient (&bar
);
566 InvalidateRect (&bar
);
569 // ***************************************************************************
571 void CSlotDlg::OnHScroll(UINT nSBCode
, UINT nPos
, CScrollBar
* pScrollBar
)
573 // TODO: Add your message handler code here and/or call default
574 if (pScrollBar
==GetDlgItem (IDC_SCROLLBAR
))
576 // Only drag and drop
577 if (nSBCode
==SB_THUMBTRACK
)
579 int DeltaOffset
=Offset
;
581 Offset
=(int)((EndAnimTime
-StartAnimTime
)*(float)nPos
/10000.f
+StartAnimTime
);
582 DeltaOffset
=Offset
-DeltaOffset
;
583 StartTime
+=DeltaOffset
;
584 EndTime
+=DeltaOffset
;
589 CDialog::OnHScroll(nSBCode
, nPos
, pScrollBar
);
592 // ***************************************************************************
594 void CSlotDlg::setAnimTime (float animStart
, float animEnd
)
596 StartAnimTime
=animStart
;
602 // ***************************************************************************
604 float CSlotDlg::getTimeIncrement ()
606 return (EndAnimTime
-StartAnimTime
)/100.f
;
609 // ***************************************************************************
611 void CSlotDlg::OnClamp()
616 // ***************************************************************************
618 void CSlotDlg::OnRepeat()
623 // ***************************************************************************
625 void CSlotDlg::OnDisable()
630 // ***************************************************************************
632 void CSlotDlg::OnAlignBlend()
637 // Change some of them
639 EndTime
=(int)((float)Offset
+AnimationLength
/SpeedFactor
);
644 // Invalidate blend bar
646 GetDlgItem (IDC_DOOMY_BLEND
)->GetWindowRect (&bar
);
647 ScreenToClient (&bar
);
648 InvalidateRect (&bar
);
651 // ***************************************************************************
653 float CSlotDlg::getStartTime ()
655 return (float)StartTime
/MainDlg
->getFrameRate ();
658 // ***************************************************************************
660 float CSlotDlg::getEndTime ()
662 return (float)EndTime
/MainDlg
->getFrameRate ();
665 // ***************************************************************************
667 void CSlotDlg::computeLength ()
669 if (getAnimationPointer())
670 AnimationLength
=(getAnimationPointer()->getEndTime()-getAnimationPointer()->getBeginTime())*MainDlg
->getFrameRate();
673 // ***************************************************************************
675 void CSlotDlg::OnDestroy()
677 // TODO: Add your message handler code here
678 CDialog::OnDestroy();
681 // ***************************************************************************
683 void CSlotDlg::refresh (BOOL update
)
685 CSlotInfo
*slotInfo
= getSlotInformation ();
689 CDialog::UpdateData (update
);
691 // Update from slot information
694 EndBlend
= slotInfo
->EndBlend
;
695 Smoothness
= slotInfo
->Smoothness
;
696 SpeedFactor
= slotInfo
->SpeedFactor
;
697 StartBlend
= slotInfo
->StartBlend
;
698 ClampMode
= slotInfo
->ClampMode
;
699 SkeletonWeightInverted
= slotInfo
->SkeletonInverted
?TRUE
:FALSE
;
700 StartTime
= slotInfo
->StartTime
;
701 Offset
= slotInfo
->Offset
;
702 EndTime
= slotInfo
->EndTime
;
703 enable
= slotInfo
->Enable
?TRUE
:FALSE
;
712 SkeletonWeightInverted
= FALSE
;
723 bool frozen
= (slotInfo
== NULL
) || (getAnimationPointer () == NULL
);
725 // Enable / disable windows
726 OffsetCtrl
.EnableWindow (!frozen
);
727 StartTimeCtrl
.EnableWindow (!frozen
);
728 StartBlendCtrl
.EnableWindow (!frozen
);
729 SpeddFactorCtrl
.EnableWindow (!frozen
);
730 SmoothnessCtrl
.EnableWindow (!frozen
);
731 EndTimeCtrl
.EnableWindow (!frozen
);
732 EndBlendCtrl
.EnableWindow (!frozen
);
733 OffsetSpinCtrl
.EnableWindow (!frozen
);
734 StartTimeSpinCtrl
.EnableWindow (!frozen
);
735 StartBlendSpinCtrl
.EnableWindow (!frozen
);
736 SpeedFactorSpinCtrl
.EnableWindow (!frozen
);
737 SmoothnessSpinCtrl
.EnableWindow (!frozen
);
738 EndTimeSpinCtrl
.EnableWindow (!frozen
);
739 EndBlendSpinCtrl
.EnableWindow (!frozen
);
740 ScrollBarCtrl
.EnableWindow (!frozen
);
741 AlignBlendCtrl
.EnableWindow (!frozen
);
742 InvertSkeletonWeightCtrl
.EnableWindow (!frozen
);
743 GetDlgItem (IDC_CLAMP
)->EnableWindow (!frozen
);
744 GetDlgItem (IDC_REPEAT
)->EnableWindow (!frozen
);
745 GetDlgItem (IDC_DISABLE
)->EnableWindow (!frozen
);
750 GetDlgItem (IDC_DOOMY_BLEND
)->GetWindowRect (&bar
);
751 ScreenToClient (&bar
);
752 InvalidateRect (&bar
);
754 CDialog::UpdateData (FALSE
);
758 CDialog::UpdateData (TRUE
);
760 // Update from slot information
761 slotInfo
->EndBlend
= EndBlend
;
762 slotInfo
->Smoothness
= Smoothness
;
763 slotInfo
->SpeedFactor
= SpeedFactor
;
764 slotInfo
->StartBlend
= StartBlend
;
765 slotInfo
->ClampMode
= ClampMode
;
766 slotInfo
->SkeletonInverted
= SkeletonWeightInverted
?true:false;
767 slotInfo
->StartTime
= StartTime
;
768 slotInfo
->Offset
= Offset
;
769 slotInfo
->EndTime
= EndTime
;
770 slotInfo
->Enable
= enable
?true:false;
772 CDialog::UpdateData (update
);
775 GetDlgItem (IDC_DOOMY_BLEND
)->GetWindowRect (&bar
);
776 ScreenToClient (&bar
);
777 InvalidateRect (&bar
);
781 // ***************************************************************************
783 const CAnimation
*CSlotDlg::getAnimationPointer () const
785 // The animation pointer
786 const CAnimation
*pointer
= NULL
;
788 // Get an instance pointer
789 CInstanceInfo
*instance
= getInstanceInformation ();
792 // Get a slot pointer
793 CSlotInfo
*slot
= getSlotInformation ();
794 uint animId
= instance
->AnimationSet
.getAnimationIdByName (slot
->Animation
);
795 if (animId
!= CAnimationSet::NotFound
)
797 // Get the animation pointer
798 pointer
= instance
->AnimationSet
.getAnimation (animId
);
802 // Return the pointer
806 // ***************************************************************************
808 const CSkeletonWeight
*CSlotDlg::getSkeletonPointer () const
810 // The skeleton pointer
811 const CSkeletonWeight
*pointer
= NULL
;
813 // Get an instance pointer
814 CInstanceInfo
*instance
= getInstanceInformation ();
817 // Get a slot pointer
818 CSlotInfo
*slot
= getSlotInformation ();
819 uint animId
= instance
->AnimationSet
.getSkeletonWeightIdByName (slot
->Skeleton
);
820 if (animId
!= CAnimationSet::NotFound
)
822 // Get the skeleton pointer
823 pointer
= instance
->AnimationSet
.getSkeletonWeight (animId
);
827 // Return the pointer
831 // ***************************************************************************
833 const NL3D::CAnimationSet
*CSlotDlg::getAnimationSetPointer () const
835 // Get an instance pointer
836 CInstanceInfo
*instance
= getInstanceInformation ();
838 return &instance
->AnimationSet
;
843 // ***************************************************************************
845 CSlotInfo
*CSlotDlg::getSlotInformation () const
848 CInstanceInfo
*instance
= getInstanceInformation ();
851 return &instance
->Saved
.SlotInfo
[Id
];
857 // ***************************************************************************
859 CInstanceInfo
*CSlotDlg::getInstanceInformation () const
863 uint instance
= MainDlg
->getEditedObject ();
864 if (instance
!= 0xffffffff)
865 return MainDlg
->getInstance (instance
);
870 // ***************************************************************************
872 bool CSlotDlg::isEmpty()
874 return (getInstanceInformation () == NULL
) || (getAnimationPointer () == NULL
);
877 // ***************************************************************************
879 void CSlotDlg::OnEnable()
884 // ***************************************************************************
886 void CSlotDlg::OnInvertSkeletonWeight()