[dali_2.3.24] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / public-api / loader / animated-property.cpp
index 5f15815..e357516 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * limitations under the License.
  *
  */
-#include "dali-scene3d/public-api/loader/animated-property.h"
 
-namespace Dali
-{
-namespace Scene3D
-{
-namespace Loader
+// CLASS HEADER
+#include <dali-scene3d/public-api/loader/animated-property.h>
+
+namespace Dali::Scene3D::Loader
 {
-void AnimatedProperty::Animate(Animation& anim, GetActor getActor)
+void AnimatedProperty::Animate(Animation& anim, GetActor getActor) const
 {
-  if(Actor actor = getActor(mNodeName))
+  if(Actor actor = getActor(*this))
   {
     Property prop = GetProperty(actor);
-    if(mKeyFrames)
-    {
-      anim.AnimateBetween(prop, mKeyFrames, mAlphaFunction, mTimePeriod);
-    }
-    else if(mValue)
+    if(prop.propertyIndex != Property::INVALID_INDEX)
     {
-      if(mValue->mIsRelative)
+      if(mKeyFrames)
       {
-        anim.AnimateBy(prop, mValue->mValue, mAlphaFunction, mTimePeriod);
+        anim.AnimateBetween(prop, mKeyFrames, mAlphaFunction, mTimePeriod);
       }
-      else
+      else if(mValue)
       {
-        anim.AnimateTo(prop, mValue->mValue, mAlphaFunction, mTimePeriod);
+        if(mValue->mIsRelative)
+        {
+          anim.AnimateBy(prop, mValue->mValue, mAlphaFunction, mTimePeriod);
+        }
+        else
+        {
+          anim.AnimateTo(prop, mValue->mValue, mAlphaFunction, mTimePeriod);
+        }
       }
     }
   }
 }
 
-} // namespace Loader
-} // namespace Scene3D
-} // namespace Dali
+} // namespace Dali::Scene3D::Loader
\ No newline at end of file