Revert "[Tizen] (Animation) Reorder animation variables according to size & remove...
[platform/core/uifw/dali-core.git] / dali / internal / event / animation / animation-impl.cpp
index 972c00f..c27f31b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
 
 // CLASS HEADER
 #include <dali/internal/event/animation/animation-impl.h>
+#include <dali/public-api/object/property-map.h>
+
+// EXTERNAL INCLUDES
 
 // INTERNAL INCLUDES
-#include <dali/public-api/animation/alpha-functions.h>
+#include <dali/public-api/animation/alpha-function.h>
 #include <dali/public-api/animation/time-period.h>
 #include <dali/public-api/common/dali-common.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/radian.h>
-#include <dali/internal/event/actors/actor-impl.h>
-#include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/event/animation/animator-connector.h>
 #include <dali/internal/event/animation/animation-playlist.h>
+#include <dali/internal/event/animation/animator-connector.h>
 #include <dali/internal/event/common/notification-manager.h>
-#include <dali/internal/update/manager/update-manager.h>
-#include <dali/internal/event/effects/shader-effect-impl.h>
+#include <dali/internal/event/common/property-helper.h>
+#include <dali/internal/event/common/stage-impl.h>
 #include <dali/internal/event/common/thread-local-storage.h>
-
-using namespace std;
+#include <dali/internal/update/animation/scene-graph-animator.h>
+#include <dali/internal/update/manager/update-manager.h>
 
 using Dali::Internal::SceneGraph::UpdateManager;
 using Dali::Internal::SceneGraph::AnimatorBase;
@@ -52,49 +53,66 @@ static bool HIDE_VALUE = false;
 namespace
 {
 
+// Signals
+
+const char* const SIGNAL_FINISHED = "finished";
+
+// Actions
+
+const char* const ACTION_PLAY =     "play";
+const char* const ACTION_STOP =     "stop";
+const char* const ACTION_PAUSE =    "pause";
+
 BaseHandle Create()
 {
   return Dali::Animation::New(0.f);
 }
 
-TypeRegistration mType( typeid(Dali::Animation), typeid(Dali::BaseHandle), Create );
+TypeRegistration mType( typeid( Dali::Animation ), typeid( Dali::BaseHandle ), Create );
+
+SignalConnectorType signalConnector1( mType, SIGNAL_FINISHED, &Animation::DoConnectSignal );
 
-SignalConnectorType signalConnector1( mType, Dali::Animation::SIGNAL_FINISHED, &Animation::DoConnectSignal );
+TypeAction action1( mType, ACTION_PLAY,  &Animation::DoAction );
+TypeAction action2( mType, ACTION_STOP,  &Animation::DoAction );
+TypeAction action3( mType, ACTION_PAUSE, &Animation::DoAction );
 
-TypeAction action1( mType, Dali::Animation::ACTION_PLAY, &Animation::DoAction );
-TypeAction action2( mType, Dali::Animation::ACTION_STOP, &Animation::DoAction );
-TypeAction action3( mType, Dali::Animation::ACTION_PAUSE, &Animation::DoAction );
+const Dali::Animation::EndAction DEFAULT_END_ACTION( Dali::Animation::Bake );
+const Dali::Animation::EndAction DEFAULT_DISCONNECT_ACTION( Dali::Animation::BakeFinal );
+const Dali::Animation::Interpolation DEFAULT_INTERPOLATION( Dali::Animation::Linear );
+const Dali::AlphaFunction DEFAULT_ALPHA_FUNCTION( Dali::AlphaFunction::DEFAULT );
 
 } // anon namespace
 
 
 AnimationPtr Animation::New(float durationSeconds)
 {
-  return New(durationSeconds, Dali::Animation::Bake, Dali::Animation::Bake, Dali::AlphaFunctions::Linear);
-}
-
-AnimationPtr Animation::New(float durationSeconds, EndAction endAction, EndAction destroyAction)
-{
-  return New(durationSeconds, endAction, destroyAction, Dali::AlphaFunctions::Linear);
-}
+  Stage* stage = Stage::GetCurrent();
 
-AnimationPtr Animation::New(float durationSeconds, EndAction endAction, EndAction destroyAction, AlphaFunction alpha)
-{
-  ThreadLocalStorage& tls = ThreadLocalStorage::Get();
-  UpdateManager& updateManager = tls.GetUpdateManager();
+  if( stage )
+  {
+    AnimationPlaylist& playlist = stage->GetAnimationPlaylist();
 
-  AnimationPlaylist& playlist = Stage::GetCurrent()->GetAnimationPlaylist();
+    if( durationSeconds < 0.0f )
+    {
+      DALI_LOG_WARNING("duration should be greater than 0.0f.\n");
+      durationSeconds = 0.0f;
+    }
 
-  AnimationPtr progress = new Animation( updateManager, playlist, durationSeconds, endAction, destroyAction, alpha );
+    AnimationPtr animation = new Animation( *stage, playlist, durationSeconds, DEFAULT_END_ACTION, DEFAULT_DISCONNECT_ACTION, DEFAULT_ALPHA_FUNCTION );
 
-  // Second-phase construction
-  progress->Initialize();
+    // Second-phase construction
+    animation->Initialize();
 
-  return progress;
+    return animation;
+  }
+  else
+  {
+    return NULL;
+  }
 }
 
-Animation::Animation( UpdateManager& updateManager, AnimationPlaylist& playlist, float durationSeconds, EndAction endAction, EndAction destroyAction, AlphaFunction defaultAlpha )
-: mUpdateManager( updateManager ),
+Animation::Animation( EventThreadServices& eventThreadServices, AnimationPlaylist& playlist, float durationSeconds, EndAction endAction, EndAction disconnectAction, AlphaFunction defaultAlpha )
+: mEventThreadServices( eventThreadServices ),
   mPlaylist( playlist ),
   mAnimation( NULL ),
   mNotificationCount( 0 ),
@@ -102,10 +120,13 @@ Animation::Animation( UpdateManager& updateManager, AnimationPlaylist& playlist,
   mFinishedCallbackObject( NULL ),
   mDurationSeconds( durationSeconds ),
   mSpeedFactor(1.0f),
-  mIsLooping( false ),
+  mLoopCount(1),
+  mCurrentLoop(0),
+  mPlayRange( Vector2(0.0f,1.0f)),
   mEndAction( endAction ),
-  mDestroyAction( destroyAction ),
-  mDefaultAlpha( defaultAlpha )
+  mDisconnectAction( disconnectAction ),
+  mDefaultAlpha( defaultAlpha ),
+  mState(Dali::Animation::STOPPED)
 {
 }
 
@@ -138,13 +159,13 @@ void Animation::CreateSceneObject()
   DALI_ASSERT_DEBUG( mAnimation == NULL );
 
   // Create a new animation, temporarily owned
-  SceneGraph::Animation* animation = SceneGraph::Animation::New( mDurationSeconds, mSpeedFactor, mIsLooping, mEndAction, mDestroyAction );
+  SceneGraph::Animation* animation = SceneGraph::Animation::New( mDurationSeconds, mSpeedFactor, mPlayRange, mLoopCount, mEndAction, mDisconnectAction );
 
   // Keep a const pointer to the animation.
   mAnimation = animation;
 
   // Transfer animation ownership to the update manager through a message
-  AddAnimationMessage( mUpdateManager, animation );
+  AddAnimationMessage( mEventThreadServices.GetUpdateManager(), animation );
 }
 
 void Animation::DestroySceneObject()
@@ -152,18 +173,24 @@ void Animation::DestroySceneObject()
   if ( mAnimation != NULL )
   {
     // Remove animation using a message to the update manager
-    RemoveAnimationMessage( mUpdateManager, *mAnimation );
+    RemoveAnimationMessage( mEventThreadServices.GetUpdateManager(), *mAnimation );
     mAnimation = NULL;
   }
 }
 
 void Animation::SetDuration(float seconds)
 {
+  if( seconds < 0.0f )
+  {
+    DALI_LOG_WARNING("duration should be greater than 0.0f.\n");
+    seconds = 0.0f;
+  }
+
   // Cache for public getters
   mDurationSeconds = seconds;
 
   // mAnimation is being used in a separate thread; queue a message to set the value
-  SetDurationMessage( mUpdateManager.GetEventToUpdate(), *mAnimation, seconds );
+  SetDurationMessage( mEventThreadServices, *mAnimation, seconds );
 }
 
 float Animation::GetDuration() const
@@ -172,19 +199,33 @@ float Animation::GetDuration() const
   return mDurationSeconds;
 }
 
-void Animation::SetLooping(bool looping)
+void Animation::SetLooping(bool on)
+{
+  SetLoopCount( on ? 0 : 1 );
+}
+
+void Animation::SetLoopCount(int count)
 {
   // Cache for public getters
-  mIsLooping = looping;
+  mLoopCount = count;
 
   // mAnimation is being used in a separate thread; queue a message to set the value
-  SetLoopingMessage( mUpdateManager.GetEventToUpdate(), *mAnimation, looping );
+  SetLoopingMessage( mEventThreadServices, *mAnimation, mLoopCount );
+}
+
+int Animation::GetLoopCount()
+{
+  return mLoopCount;
+}
+
+int Animation::GetCurrentLoop()
+{
+  return mCurrentLoop;
 }
 
 bool Animation::IsLooping() const
 {
-  // This is not animatable; the cached value is up-to-date.
-  return mIsLooping;
+  return mLoopCount != 1;
 }
 
 void Animation::SetEndAction(EndAction action)
@@ -193,7 +234,7 @@ void Animation::SetEndAction(EndAction action)
   mEndAction = action;
 
   // mAnimation is being used in a separate thread; queue a message to set the value
-  SetEndActionMessage( mUpdateManager.GetEventToUpdate(), *mAnimation, action );
+  SetEndActionMessage( mEventThreadServices, *mAnimation, action );
 }
 
 Dali::Animation::EndAction Animation::GetEndAction() const
@@ -202,19 +243,19 @@ Dali::Animation::EndAction Animation::GetEndAction() const
   return mEndAction;
 }
 
-void Animation::SetDestroyAction(EndAction action)
+void Animation::SetDisconnectAction(EndAction action)
 {
   // Cache for public getters
-  mDestroyAction = action;
+  mDisconnectAction = action;
 
   // mAnimation is being used in a separate thread; queue a message to set the value
-  SetDestroyActionMessage( mUpdateManager.GetEventToUpdate(), *mAnimation, action );
+  SetDisconnectActionMessage( mEventThreadServices, *mAnimation, action );
 }
 
-Dali::Animation::EndAction Animation::GetDestroyAction() const
+Dali::Animation::EndAction Animation::GetDisconnectAction() const
 {
   // This is not animatable; the cached value is up-to-date.
-  return mDestroyAction;
+  return mDisconnectAction;
 }
 
 void Animation::Play()
@@ -222,32 +263,78 @@ void Animation::Play()
   // Update the current playlist
   mPlaylist.OnPlay( *this );
 
+  mState = Dali::Animation::PLAYING;
+
+  if( mEndAction != EndAction::Discard ) // If the animation is discarded, then we do not want to change the target values
+  {
+    unsigned int connectorTargetValuesIndex( 0 );
+    unsigned int numberOfConnectorTargetValues = mConnectorTargetValues.size();
+
+    /*
+     * Loop through all Animator connectors, if connector index matches the current index stored in mConnectorTargetValues container then
+     * should apply target values for this index to the object.
+     */
+    for ( unsigned int connectorIndex = 0; connectorIndex < mConnectors.Count(); connectorIndex ++)
+    {
+      // Use index to check if the current connector is next in the mConnectorTargetValues container, meaning targetValues have been pushed in AnimateXXFunction
+      if ( connectorTargetValuesIndex < numberOfConnectorTargetValues )
+      {
+        ConnectorTargetValues& connectorPair = mConnectorTargetValues[ connectorTargetValuesIndex ];
+
+        if ( connectorPair.connectorIndex == connectorIndex )
+        {
+          // Current connector index matches next in the stored connectors with target values so apply target value.
+          connectorTargetValuesIndex++; // Found a match for connector so increment index to next one
+
+          AnimatorConnectorBase* connector = mConnectors[ connectorIndex ];
+
+          Object* object = connector->GetObject();
+          if( object )
+          {
+            object->NotifyPropertyAnimation( *this, connector->GetPropertyIndex(), connectorPair.targetValue );
+          }
+        }
+      }
+    }
+  }
+
   // mAnimation is being used in a separate thread; queue a Play message
-  PlayAnimationMessage( mUpdateManager.GetEventToUpdate(), *mAnimation );
+  PlayAnimationMessage( mEventThreadServices, *mAnimation );
 }
 
 void Animation::PlayFrom( float progress )
 {
-  if( progress >= 0.0f && progress <= 1.0f )
+  if( progress >= mPlayRange.x && progress <= mPlayRange.y )
   {
     // Update the current playlist
     mPlaylist.OnPlay( *this );
 
+    mState = Dali::Animation::PLAYING;
+
     // mAnimation is being used in a separate thread; queue a Play message
-    PlayAnimationFromMessage( mUpdateManager.GetEventToUpdate(), *mAnimation, progress );
+    PlayAnimationFromMessage( mEventThreadServices, *mAnimation, progress );
   }
 }
 
 void Animation::Pause()
 {
+  mState = Dali::Animation::PAUSED;
+
   // mAnimation is being used in a separate thread; queue a Pause message
-  PauseAnimationMessage( mUpdateManager.GetEventToUpdate(), *mAnimation );
+  PauseAnimationMessage( mEventThreadServices, *mAnimation );
+}
+
+Dali::Animation::State Animation::GetState() const
+{
+  return mState;
 }
 
 void Animation::Stop()
 {
+  mState = Dali::Animation::STOPPED;
+
   // mAnimation is being used in a separate thread; queue a Stop message
-  StopAnimationMessage( mUpdateManager, *mAnimation );
+  StopAnimationMessage( mEventThreadServices.GetUpdateManager(), *mAnimation );
 }
 
 void Animation::Clear()
@@ -257,6 +344,9 @@ void Animation::Clear()
   // Remove all the connectors
   mConnectors.Clear();
 
+  // Reset the connector target values
+  mConnectorTargetValues.clear();
+
   // Replace the old scene-object with a new one
   DestroySceneObject();
   CreateSceneObject();
@@ -270,66 +360,69 @@ void Animation::Clear()
 
 void Animation::AnimateBy(Property& target, Property::Value& relativeValue)
 {
-  AnimateBy(target, relativeValue, AlphaFunctions::Default, mDurationSeconds);
+  AnimateBy(target, relativeValue, mDefaultAlpha, TimePeriod(mDurationSeconds));
 }
 
 void Animation::AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha)
 {
-  AnimateBy(target, relativeValue, alpha, mDurationSeconds);
+  AnimateBy(target, relativeValue, alpha, TimePeriod(mDurationSeconds));
 }
 
 void Animation::AnimateBy(Property& target, Property::Value& relativeValue, TimePeriod period)
 {
-  AnimateBy(target, relativeValue, AlphaFunctions::Default, period);
+  AnimateBy(target, relativeValue, mDefaultAlpha, period);
 }
 
 void Animation::AnimateBy(Property& target, Property::Value& relativeValue, AlphaFunction alpha, TimePeriod period)
 {
-  ProxyObject& proxy = dynamic_cast<ProxyObject&>( GetImplementation(target.object) );
+  Object& object = GetImplementation( target.object );
+  const Property::Type targetType = object.GetPropertyType( target.propertyIndex );
+  const Property::Type destinationType = relativeValue.GetType();
+  DALI_ASSERT_ALWAYS( targetType == destinationType && "Animated value and Property type don't match" );
 
   ExtendDuration( period );
 
-  switch ( relativeValue.GetType() )
+  switch ( targetType )
   {
     case Property::BOOLEAN:
     {
-      AddAnimatorConnector( AnimatorConnector<bool>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<bool>::New( object,
                                                           target.propertyIndex,
                                                           target.componentIndex,
-                                                          AnimateByBoolean(relativeValue.Get<bool>()),
+                                                          new AnimateByBoolean(relativeValue.Get<bool>()),
                                                           alpha,
                                                           period ) );
       break;
     }
 
-    case Property::FLOAT:
-    {
-      AddAnimatorConnector( AnimatorConnector<float>::New( proxy,
-                                                           target.propertyIndex,
-                                                           target.componentIndex,
-                                                           AnimateByFloat(relativeValue.Get<float>()),
-                                                           alpha,
-                                                           period ) );
-      break;
-    }
-
     case Property::INTEGER:
     {
-      AddAnimatorConnector( AnimatorConnector<int>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<int>::New( object,
                                                          target.propertyIndex,
                                                          target.componentIndex,
-                                                         AnimateByInteger(relativeValue.Get<int>()),
+                                                         new AnimateByInteger(relativeValue.Get<int>()),
                                                          alpha,
                                                          period ) );
       break;
     }
 
+    case Property::FLOAT:
+    {
+      AddAnimatorConnector( AnimatorConnector<float>::New( object,
+                                                           target.propertyIndex,
+                                                           target.componentIndex,
+                                                           new AnimateByFloat(relativeValue.Get<float>()),
+                                                           alpha,
+                                                           period ) );
+      break;
+    }
+
     case Property::VECTOR2:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector2>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<Vector2>::New( object,
                                                              target.propertyIndex,
                                                              target.componentIndex,
-                                                             AnimateByVector2(relativeValue.Get<Vector2>()),
+                                                             new AnimateByVector2(relativeValue.Get<Vector2>()),
                                                              alpha,
                                                              period ) );
       break;
@@ -337,10 +430,10 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
 
     case Property::VECTOR3:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector3>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<Vector3>::New( object,
                                                              target.propertyIndex,
                                                              target.componentIndex,
-                                                             AnimateByVector3(relativeValue.Get<Vector3>()),
+                                                             new AnimateByVector3(relativeValue.Get<Vector3>()),
                                                              alpha,
                                                              period ) );
       break;
@@ -348,10 +441,10 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
 
     case Property::VECTOR4:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector4>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<Vector4>::New( object,
                                                              target.propertyIndex,
                                                              target.componentIndex,
-                                                             AnimateByVector4(relativeValue.Get<Vector4>()),
+                                                             new AnimateByVector4(relativeValue.Get<Vector4>()),
                                                              alpha,
                                                              period ) );
       break;
@@ -361,173 +454,191 @@ void Animation::AnimateBy(Property& target, Property::Value& relativeValue, Alph
     {
       AngleAxis angleAxis = relativeValue.Get<AngleAxis>();
 
-      AddAnimatorConnector( AnimatorConnector<Quaternion>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<Quaternion>::New( object,
                                                                 target.propertyIndex,
                                                                 target.componentIndex,
-                                                                RotateByAngleAxis(angleAxis.angle, angleAxis.axis),
+                                                                new RotateByAngleAxis(angleAxis.angle, angleAxis.axis),
                                                                 alpha,
                                                                 period ) );
       break;
     }
 
     default:
-      DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should never come here
-      break;
+    {
+      // non animatable types handled already
+    }
   }
 }
 
 void Animation::AnimateTo(Property& target, Property::Value& destinationValue)
 {
-  AnimateTo(target, destinationValue, AlphaFunctions::Default, mDurationSeconds);
+  AnimateTo(target, destinationValue, mDefaultAlpha, TimePeriod(mDurationSeconds));
 }
 
 void Animation::AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha)
 {
-  AnimateTo(target, destinationValue, alpha, mDurationSeconds);
+  AnimateTo(target, destinationValue, alpha, TimePeriod(mDurationSeconds));
 }
 
 void Animation::AnimateTo(Property& target, Property::Value& destinationValue, TimePeriod period)
 {
-  AnimateTo(target, destinationValue, AlphaFunctions::Default, period);
+  AnimateTo(target, destinationValue, mDefaultAlpha, period);
 }
 
 void Animation::AnimateTo(Property& target, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period)
 {
-  ProxyObject& proxy = dynamic_cast<ProxyObject&>( GetImplementation(target.object) );
+  Object& object = GetImplementation(target.object);
 
-  AnimateTo( proxy, target.propertyIndex, target.componentIndex, destinationValue, alpha, period );
+  AnimateTo( object, target.propertyIndex, target.componentIndex, destinationValue, alpha, period );
 }
 
-void Animation::AnimateTo(ProxyObject& targetObject, Property::Index targetPropertyIndex, int componentIndex, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period)
+void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIndex, int componentIndex, Property::Value& destinationValue, AlphaFunction alpha, TimePeriod period)
 {
-  Property::Type type = targetObject.GetPropertyType(targetPropertyIndex);
-  if(componentIndex != Property::INVALID_COMPONENT_INDEX)
+  Property::Type targetType = targetObject.GetPropertyType(targetPropertyIndex);
+  if( componentIndex != Property::INVALID_COMPONENT_INDEX )
   {
-    if( type == Property::VECTOR2
-        || type == Property::VECTOR3
-        || type == Property::VECTOR4 )
+    if( ( targetType == Property::VECTOR2 ) ||
+        ( targetType == Property::VECTOR3 ) ||
+        ( targetType == Property::VECTOR4 ) )
     {
-      type = Property::FLOAT;
+      targetType = Property::FLOAT;
     }
   }
-  DALI_ASSERT_ALWAYS( type == destinationValue.GetType() && "DestinationValue does not match Target Property type" );
+  const Property::Type destinationType = destinationValue.GetType();
+  DALI_ASSERT_ALWAYS( targetType == destinationType && "Animated value and Property type don't match" );
 
   ExtendDuration( period );
 
-  switch (destinationValue.GetType())
+  // Store data to later notify the object that its property is being animated
+  ConnectorTargetValues connectorPair;
+  connectorPair.targetValue = destinationValue;
+  connectorPair.connectorIndex = mConnectors.Count();
+  mConnectorTargetValues.push_back( connectorPair );
+
+  switch ( destinationType )
   {
     case Property::BOOLEAN:
     {
-      AddAnimatorConnector( AnimatorConnector<bool>::New(targetObject,
-                                                         targetPropertyIndex,
-                                                         componentIndex,
-                                                         AnimateToBoolean(destinationValue.Get<bool>()),
-                                                         alpha,
-                                                         period) );
-      break;
-    }
-
-    case Property::FLOAT:
-    {
-      AddAnimatorConnector( AnimatorConnector<float>::New(targetObject,
+      AddAnimatorConnector( AnimatorConnector<bool>::New( targetObject,
                                                           targetPropertyIndex,
                                                           componentIndex,
-                                                          AnimateToFloat(destinationValue.Get<float>()),
+                                                          new AnimateToBoolean( destinationValue.Get<bool>() ),
                                                           alpha,
-                                                          period) );
+                                                          period ) );
       break;
     }
 
     case Property::INTEGER:
     {
-      AddAnimatorConnector( AnimatorConnector<int>::New(targetObject,
-                                                        targetPropertyIndex,
-                                                        componentIndex,
-                                                        AnimateToInteger(destinationValue.Get<int>()),
-                                                        alpha,
-                                                        period) );
+      AddAnimatorConnector( AnimatorConnector<int>::New( targetObject,
+                                                         targetPropertyIndex,
+                                                         componentIndex,
+                                                         new AnimateToInteger( destinationValue.Get<int>() ),
+                                                         alpha,
+                                                         period ) );
+      break;
+    }
+
+    case Property::FLOAT:
+    {
+      AddAnimatorConnector( AnimatorConnector<float>::New( targetObject,
+                                                           targetPropertyIndex,
+                                                           componentIndex,
+                                                           new AnimateToFloat( destinationValue.Get<float>() ),
+                                                           alpha,
+                                                           period ) );
       break;
     }
 
     case Property::VECTOR2:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector2>::New(targetObject,
-                                                            targetPropertyIndex,
-                                                            componentIndex,
-                                                            AnimateToVector2(destinationValue.Get<Vector2>()),
-                                                            alpha,
-                                                            period) );
+      AddAnimatorConnector( AnimatorConnector<Vector2>::New( targetObject,
+                                                             targetPropertyIndex,
+                                                             componentIndex,
+                                                             new AnimateToVector2( destinationValue.Get<Vector2>() ),
+                                                             alpha,
+                                                             period ) );
       break;
     }
 
     case Property::VECTOR3:
     {
-      if ( Dali::Actor::SIZE == targetPropertyIndex )
-      {
-        // Test whether this is actually an Actor
-        Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
-        if ( maybeActor )
-        {
-          // Notify the actor that its size is being animated
-          maybeActor->NotifySizeAnimation( *this, destinationValue.Get<Vector3>() );
-        }
-      }
-
-      AddAnimatorConnector( AnimatorConnector<Vector3>::New(targetObject,
-                                                            targetPropertyIndex,
-                                                            componentIndex,
-                                                            AnimateToVector3(destinationValue.Get<Vector3>()),
-                                                            alpha,
-                                                            period) );
+      AddAnimatorConnector( AnimatorConnector<Vector3>::New( targetObject,
+                                                             targetPropertyIndex,
+                                                             componentIndex,
+                                                             new AnimateToVector3( destinationValue.Get<Vector3>() ),
+                                                             alpha,
+                                                             period ) );
       break;
     }
 
     case Property::VECTOR4:
     {
-      AddAnimatorConnector( AnimatorConnector<Vector4>::New(targetObject,
-                                                            targetPropertyIndex,
-                                                            componentIndex,
-                                                            AnimateToVector4(destinationValue.Get<Vector4>()),
-                                                            alpha,
-                                                            period) );
+      AddAnimatorConnector( AnimatorConnector<Vector4>::New( targetObject,
+                                                             targetPropertyIndex,
+                                                             componentIndex,
+                                                             new AnimateToVector4( destinationValue.Get<Vector4>() ),
+                                                             alpha,
+                                                             period ) );
       break;
     }
 
     case Property::ROTATION:
     {
-      AddAnimatorConnector( AnimatorConnector<Quaternion>::New(targetObject,
-                                                               targetPropertyIndex,
-                                                               componentIndex,
-                                                               RotateToQuaternion(destinationValue.Get<Quaternion>()),
-                                                               alpha,
-                                                               period) );
+      AddAnimatorConnector( AnimatorConnector<Quaternion>::New( targetObject,
+                                                                targetPropertyIndex,
+                                                                componentIndex,
+                                                                new RotateToQuaternion( destinationValue.Get<Quaternion>() ),
+                                                                alpha,
+                                                                period ) );
       break;
     }
 
     default:
-      DALI_ASSERT_ALWAYS( false && "Property type enumeration out of bounds" ); // should never come here
-      break;
+    {
+      // non animatable types handled already
+    }
   }
 }
 
 void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames)
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, mDurationSeconds);
+  AnimateBetween(target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION );
+}
+
+void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Interpolation interpolation )
+{
+  AnimateBetween(target, keyFrames, mDefaultAlpha, TimePeriod(mDurationSeconds), interpolation );
 }
 
 void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period)
 {
-  AnimateBetween(target, keyFrames, mDefaultAlpha, period);
+  AnimateBetween(target, keyFrames, mDefaultAlpha, period, DEFAULT_INTERPOLATION);
+}
+
+void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, TimePeriod period, Interpolation interpolation)
+{
+  AnimateBetween(target, keyFrames, mDefaultAlpha, period, interpolation);
 }
 
 void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha)
 {
-  AnimateBetween(target, keyFrames, alpha, mDurationSeconds);
+  AnimateBetween(target, keyFrames, alpha, TimePeriod(mDurationSeconds), DEFAULT_INTERPOLATION);
+}
+
+void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, Interpolation interpolation)
+{
+  AnimateBetween(target, keyFrames, alpha, TimePeriod(mDurationSeconds), interpolation);
 }
 
 void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period)
 {
-  ProxyObject& proxy = dynamic_cast<ProxyObject&>( GetImplementation(target.object) );
+  AnimateBetween(target, keyFrames, alpha, period, DEFAULT_INTERPOLATION);
+}
+
+void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, AlphaFunction alpha, TimePeriod period, Interpolation interpolation)
+{
+  Object& object = GetImplementation( target.object );
 
   ExtendDuration( period );
 
@@ -538,52 +649,52 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
       const KeyFrameBoolean* kf;
       GetSpecialization(keyFrames, kf);
       KeyFrameBooleanPtr kfCopy = KeyFrameBoolean::Clone(*kf);
-      AddAnimatorConnector( AnimatorConnector<bool>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<bool>::New( object,
                                                           target.propertyIndex,
                                                           target.componentIndex,
-                                                          KeyFrameBooleanFunctor(kfCopy),
+                                                          new KeyFrameBooleanFunctor(kfCopy),
                                                           alpha,
                                                           period ) );
       break;
     }
 
-    case Dali::Property::FLOAT:
-    {
-      const KeyFrameNumber* kf;
-      GetSpecialization(keyFrames, kf);
-      KeyFrameNumberPtr kfCopy = KeyFrameNumber::Clone(*kf);
-      AddAnimatorConnector( AnimatorConnector<float>::New( proxy,
-                                                           target.propertyIndex,
-                                                           target.componentIndex,
-                                                           KeyFrameNumberFunctor(kfCopy),
-                                                           alpha,
-                                                           period ) );
-      break;
-    }
-
     case Dali::Property::INTEGER:
     {
       const KeyFrameInteger* kf;
       GetSpecialization(keyFrames, kf);
       KeyFrameIntegerPtr kfCopy = KeyFrameInteger::Clone(*kf);
-      AddAnimatorConnector( AnimatorConnector<int>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<int>::New( object,
                                                          target.propertyIndex,
                                                          target.componentIndex,
-                                                         KeyFrameIntegerFunctor(kfCopy),
+                                                         new KeyFrameIntegerFunctor(kfCopy,interpolation),
                                                          alpha,
                                                          period ) );
       break;
     }
 
+    case Dali::Property::FLOAT:
+    {
+      const KeyFrameNumber* kf;
+      GetSpecialization(keyFrames, kf);
+      KeyFrameNumberPtr kfCopy = KeyFrameNumber::Clone(*kf);
+      AddAnimatorConnector( AnimatorConnector<float>::New( object,
+                                                           target.propertyIndex,
+                                                           target.componentIndex,
+                                                           new KeyFrameNumberFunctor(kfCopy,interpolation),
+                                                           alpha,
+                                                           period ) );
+      break;
+    }
+
     case Dali::Property::VECTOR2:
     {
       const KeyFrameVector2* kf;
       GetSpecialization(keyFrames, kf);
       KeyFrameVector2Ptr kfCopy = KeyFrameVector2::Clone(*kf);
-      AddAnimatorConnector( AnimatorConnector<Vector2>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<Vector2>::New( object,
                                                              target.propertyIndex,
                                                              target.componentIndex,
-                                                             KeyFrameVector2Functor(kfCopy),
+                                                             new KeyFrameVector2Functor(kfCopy,interpolation),
                                                              alpha,
                                                              period ) );
       break;
@@ -594,10 +705,10 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
       const KeyFrameVector3* kf;
       GetSpecialization(keyFrames, kf);
       KeyFrameVector3Ptr kfCopy = KeyFrameVector3::Clone(*kf);
-      AddAnimatorConnector( AnimatorConnector<Vector3>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<Vector3>::New( object,
                                                              target.propertyIndex,
                                                              target.componentIndex,
-                                                             KeyFrameVector3Functor(kfCopy),
+                                                             new KeyFrameVector3Functor(kfCopy,interpolation),
                                                              alpha,
                                                              period ) );
       break;
@@ -608,10 +719,10 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
       const KeyFrameVector4* kf;
       GetSpecialization(keyFrames, kf);
       KeyFrameVector4Ptr kfCopy = KeyFrameVector4::Clone(*kf);
-      AddAnimatorConnector( AnimatorConnector<Vector4>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<Vector4>::New( object,
                                                              target.propertyIndex,
                                                              target.componentIndex,
-                                                             KeyFrameVector4Functor(kfCopy),
+                                                             new KeyFrameVector4Functor(kfCopy,interpolation),
                                                              alpha,
                                                              period ) );
       break;
@@ -622,156 +733,44 @@ void Animation::AnimateBetween(Property target, const KeyFrames& keyFrames, Alph
       const KeyFrameQuaternion* kf;
       GetSpecialization(keyFrames, kf);
       KeyFrameQuaternionPtr kfCopy = KeyFrameQuaternion::Clone(*kf);
-      AddAnimatorConnector( AnimatorConnector<Quaternion>::New( proxy,
+      AddAnimatorConnector( AnimatorConnector<Quaternion>::New( object,
                                                                 target.propertyIndex,
                                                                 target.componentIndex,
-                                                                KeyFrameQuaternionFunctor(kfCopy),
+                                                                new KeyFrameQuaternionFunctor(kfCopy),
                                                                 alpha,
                                                                 period ) );
       break;
     }
 
-    default: // not all property types are animateable
-      break;
-  }
-}
-
-void Animation::Animate( Property& target, Property::Type targetType, AnyFunction& func )
-{
-  Animate( target, targetType, func, mDefaultAlpha, mDurationSeconds );
-}
-
-void Animation::Animate( Property& target, Property::Type targetType, AnyFunction& func, AlphaFunction& alpha )
-{
-  Animate( target, targetType, func, alpha, mDurationSeconds );
-}
-
-void Animation::Animate( Property& target, Property::Type targetType, AnyFunction& func, TimePeriod period )
-{
-  Animate( target, targetType, func, mDefaultAlpha, period );
-}
-
-void Animation::Animate( Property& target, Property::Type targetType, AnyFunction& func, AlphaFunction& alpha, TimePeriod period )
-{
-  Property::Type type = target.object.GetPropertyType(target.propertyIndex);
-  if(target.componentIndex != Property::INVALID_COMPONENT_INDEX)
-  {
-    if( type == Property::VECTOR2
-        || type == Property::VECTOR3
-        || type == Property::VECTOR4 )
-    {
-      type = Property::FLOAT;
-    }
-  }
-  DALI_ASSERT_ALWAYS( type == targetType && "Animation function must match target property type" );
-
-  ProxyObject& proxy = dynamic_cast<ProxyObject&>( GetImplementation(target.object) );
-
-  ExtendDuration( period );
-
-  switch ( targetType )
-  {
-    case Property::BOOLEAN:
-    {
-      AddAnimatorConnector( AnimatorConnector<bool>::New(proxy,
-                                                         target.propertyIndex,
-                                                         target.componentIndex,
-                                                         AnyCast< AnimatorFunctionBool >( func ),
-                                                         alpha,
-                                                         period) );
-      break;
-    }
-
-    case Property::FLOAT:
-    {
-      AddAnimatorConnector( AnimatorConnector<float>::New(proxy,
-                                                          target.propertyIndex,
-                                                          target.componentIndex,
-                                                          AnyCast< AnimatorFunctionFloat >( func ),
-                                                          alpha,
-                                                          period) );
-      break;
-    }
-
-    case Property::INTEGER:
-    {
-      AddAnimatorConnector( AnimatorConnector<int>::New(proxy,
-                                                        target.propertyIndex,
-                                                        target.componentIndex,
-                                                        AnyCast< AnimatorFunctionInteger >( func ),
-                                                        alpha,
-                                                        period) );
-      break;
-    }
-
-    case Property::VECTOR2:
-    {
-      AddAnimatorConnector( AnimatorConnector<Vector2>::New(proxy,
-                                                            target.propertyIndex,
-                                                            target.componentIndex,
-                                                            AnyCast< AnimatorFunctionVector2 >( func ),
-                                                            alpha,
-                                                            period) );
-      break;
-    }
-
-    case Property::VECTOR3:
-    {
-      AddAnimatorConnector( AnimatorConnector<Vector3>::New(proxy,
-                                                            target.propertyIndex,
-                                                            target.componentIndex,
-                                                            AnyCast< AnimatorFunctionVector3 >( func ),
-                                                            alpha,
-                                                            period) );
-      break;
-    }
-
-    case Property::VECTOR4:
-    {
-      AddAnimatorConnector( AnimatorConnector<Vector4>::New(proxy,
-                                                            target.propertyIndex,
-                                                            target.componentIndex,
-                                                            AnyCast< AnimatorFunctionVector4 >( func ),
-                                                            alpha,
-                                                            period) );
-      break;
-    }
-
-    case Property::ROTATION:
+    default:
     {
-      AddAnimatorConnector( AnimatorConnector<Quaternion>::New(proxy,
-                                                               target.propertyIndex,
-                                                               target.componentIndex,
-                                                               AnyCast< AnimatorFunctionQuaternion >( func ),
-                                                               alpha,
-                                                               period) );
-      break;
+      // non animatable types handled by keyframes
     }
-
-    default:
-      DALI_ASSERT_ALWAYS(false && "Property type enumeration out of bounds" ); // should never come here
-      break;
   }
 }
 
 bool Animation::HasFinished()
 {
   bool hasFinished(false);
-  const int playCount(mAnimation->GetPlayCount());
+  const int playedCount(mAnimation->GetPlayedCount());
 
   // If the play count has been incremented, then another notification is required
-  if (playCount > mNotificationCount)
+  mCurrentLoop = mAnimation->GetCurrentLoop();
+
+  if (playedCount > mNotificationCount)
   {
     // Note that only one signal is emitted, if the animation has been played repeatedly
-    mNotificationCount = playCount;
+    mNotificationCount = playedCount;
 
     hasFinished = true;
+
+    mState = Dali::Animation::STOPPED;
   }
 
   return hasFinished;
 }
 
-Dali::Animation::AnimationSignalV2& Animation::FinishedSignal()
+Dali::Animation::AnimationSignalType& Animation::FinishedSignal()
 {
   return mFinishedSignal;
 }
@@ -794,9 +793,9 @@ void Animation::EmitSignalFinish()
 bool Animation::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
 {
   bool connected( true );
-  Animation* animation = dynamic_cast<Animation*>(object);
+  Animation* animation = static_cast< Animation* >(object); // TypeRegistry guarantees that this is the correct type.
 
-  if ( Dali::Animation::SIGNAL_FINISHED == signalName )
+  if( 0 == signalName.compare( SIGNAL_FINISHED ) )
   {
     animation->FinishedSignal().Connect( tracker, functor );
   }
@@ -824,190 +823,46 @@ void Animation::AddAnimatorConnector( AnimatorConnectorBase* connector )
   mConnectors.PushBack( connector );
 }
 
-void Animation::MoveBy(Actor& actor, float x, float y, float z)
-{
-  MoveBy(actor, Vector3(x, y, z), mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::MoveBy(Actor& actor, const Vector3& displacement, AlphaFunction alpha)
-{
-  MoveBy(actor, displacement, alpha, 0.0f, GetDuration());
-}
-
-void Animation::MoveBy(Actor& actor, const Vector3& displacement, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
-                                                         Dali::Actor::POSITION,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateByVector3(displacement),
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::MoveTo(Actor& actor, float x, float y, float z)
-{
-  MoveTo(actor, Vector3(x, y, z), mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::MoveTo(Actor& actor, const Vector3& position, AlphaFunction alpha)
-{
-  MoveTo(actor, position, alpha, 0.0f, GetDuration());
-}
-
-void Animation::MoveTo(Actor& actor, const Vector3& position, AlphaFunction alpha,  float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
-                                                         Dali::Actor::POSITION,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateToVector3(position),
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::Move(Actor& actor, AnimatorFunctionVector3 func, AlphaFunction alpha,  float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
-                                                         Dali::Actor::POSITION,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         func,
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::RotateBy(Actor& actor, Radian angle, const Vector3& axis)
+void Animation::Animate( Actor& actor, const Path& path, const Vector3& forward )
 {
-  RotateBy(actor, angle, axis, mDefaultAlpha, 0.0f, GetDuration());
+  Animate( actor, path, forward, mDefaultAlpha, TimePeriod(mDurationSeconds) );
 }
 
-void Animation::RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha)
+void Animation::Animate( Actor& actor, const Path& path, const Vector3& forward, AlphaFunction alpha )
 {
-  RotateBy(actor, angle, axis, alpha, 0.0f, GetDuration());
+  Animate( actor, path, forward, alpha, TimePeriod(mDurationSeconds) );
 }
 
-void Animation::RotateBy(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
+void Animation::Animate( Actor& actor, const Path& path, const Vector3& forward, TimePeriod period )
 {
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
-                                                            Dali::Actor::ROTATION,
-                                                            Property::INVALID_COMPONENT_INDEX,
-                                                            RotateByAngleAxis(angle, axis),
-                                                            alpha,
-                                                            TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::RotateTo(Actor& actor, Radian angle, const Vector3& axis)
-{
-  Vector4 normalizedAxis(axis.x, axis.y, axis.z, 0.0f);
-  normalizedAxis.Normalize();
-
-  Quaternion orientation(Quaternion::FromAxisAngle(normalizedAxis, angle));
-
-  RotateTo(actor, orientation, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateTo(Actor& actor, const Quaternion& orientation)
-{
-  RotateTo(actor, orientation, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateTo(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha)
-{
-  Vector4 normalizedAxis(axis.x, axis.y, axis.z, 0.0f);
-  normalizedAxis.Normalize();
-
-  Quaternion orientation(Quaternion::FromAxisAngle(normalizedAxis, angle));
-
-  RotateTo(actor, orientation, alpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateTo(Actor& actor, const Quaternion& orientation, AlphaFunction alpha)
-{
-  RotateTo(actor, orientation, alpha, 0.0f, GetDuration());
-}
-
-void Animation::RotateTo(Actor& actor, Radian angle, const Vector3& axis, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  Vector4 normalizedAxis(axis.x, axis.y, axis.z, 0.0f);
-  normalizedAxis.Normalize();
-
-  Quaternion orientation(Quaternion::FromAxisAngle(normalizedAxis, angle));
-
-  RotateTo(actor, orientation, alpha, delaySeconds, durationSeconds);
-}
-
-void Animation::RotateTo(Actor& actor, const Quaternion& rotation, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
-                                                            Dali::Actor::ROTATION,
-                                                            Property::INVALID_COMPONENT_INDEX,
-                                                            RotateToQuaternion(rotation),
-                                                            alpha,
-                                                            TimePeriod(delaySeconds, durationSeconds) ) );
+  Animate( actor, path, forward, mDefaultAlpha, period );
 }
 
-void Animation::Rotate(Actor& actor, AnimatorFunctionQuaternion func, AlphaFunction alpha,  float delaySeconds, float durationSeconds)
+void Animation::Animate( Actor& actor, const Path& path, const Vector3& forward, AlphaFunction alpha, TimePeriod period)
 {
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
-                                                            Dali::Actor::ROTATION,
-                                                            Property::INVALID_COMPONENT_INDEX,
-                                                            func,
-                                                            alpha,
-                                                            TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::ScaleBy(Actor& actor, float x, float y, float z)
-{
-  ScaleBy(actor, Vector3(x, y, z), mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha)
-{
-  ScaleBy(actor, scale, alpha, 0.0f, GetDuration());
-}
+  ExtendDuration( period );
 
-void Animation::ScaleBy(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+  PathPtr pathCopy = Path::Clone(path);
 
+  //Position animation
   AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
-                                                         Dali::Actor::SCALE,
+                                                         Dali::Actor::Property::POSITION,
                                                          Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateByVector3(scale),
+                                                         new PathPositionFunctor( pathCopy ),
                                                          alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::ScaleTo(Actor& actor, float x, float y, float z)
-{
-  ScaleTo(actor, Vector3(x, y, z), mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha)
-{
-  ScaleTo(actor, scale, alpha, 0.0f, GetDuration());
-}
-
-void Animation::ScaleTo(Actor& actor, const Vector3& scale, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
+                                                         period ) );
 
-  AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
-                                                         Dali::Actor::SCALE,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateToVector3(scale),
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
+  //If forward is zero, PathRotationFunctor will always return the unit quaternion
+  if( forward != Vector3::ZERO )
+  {
+    //Rotation animation
+    AddAnimatorConnector( AnimatorConnector<Quaternion>::New( actor,
+                                                              Dali::Actor::Property::ORIENTATION,
+                                                              Property::INVALID_COMPONENT_INDEX,
+                                                              new PathRotationFunctor( pathCopy, forward ),
+                                                              alpha,
+                                                              period ) );
+  }
 }
 
 void Animation::Show(Actor& actor, float delaySeconds)
@@ -1015,10 +870,10 @@ void Animation::Show(Actor& actor, float delaySeconds)
   ExtendDuration( TimePeriod(delaySeconds, 0) );
 
   AddAnimatorConnector( AnimatorConnector<bool>::New( actor,
-                                                      Dali::Actor::VISIBLE,
+                                                      Dali::Actor::Property::VISIBLE,
                                                       Property::INVALID_COMPONENT_INDEX,
-                                                      AnimateToBoolean(SHOW_VALUE),
-                                                      AlphaFunctions::Default,
+                                                      new AnimateToBoolean(SHOW_VALUE),
+                                                      mDefaultAlpha,
                                                       TimePeriod(delaySeconds, 0.0f/*immediate*/) ) );
 }
 
@@ -1027,176 +882,36 @@ void Animation::Hide(Actor& actor, float delaySeconds)
   ExtendDuration( TimePeriod(delaySeconds, 0) );
 
   AddAnimatorConnector( AnimatorConnector<bool>::New( actor,
-                                                      Dali::Actor::VISIBLE,
+                                                      Dali::Actor::Property::VISIBLE,
                                                       Property::INVALID_COMPONENT_INDEX,
-                                                      AnimateToBoolean(HIDE_VALUE),
-                                                      AlphaFunctions::Default,
+                                                      new AnimateToBoolean(HIDE_VALUE),
+                                                      mDefaultAlpha,
                                                       TimePeriod(delaySeconds, 0.0f/*immediate*/) ) );
 }
 
-void Animation::OpacityBy(Actor& actor, float opacity)
-{
-  OpacityBy(actor, opacity, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::OpacityBy(Actor& actor, float opacity, AlphaFunction alpha)
-{
-  OpacityBy(actor, opacity, alpha, 0.0f, GetDuration());
-}
-
-void Animation::OpacityBy(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
-                                                         Dali::Actor::COLOR,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateByOpacity(opacity),
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::OpacityTo(Actor& actor, float opacity)
-{
-  OpacityTo(actor, opacity, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::OpacityTo(Actor& actor, float opacity, AlphaFunction alpha)
-{
-  OpacityTo(actor, opacity, alpha, 0.0f, GetDuration());
-}
-
-void Animation::OpacityTo(Actor& actor, float opacity, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
-                                                         Dali::Actor::COLOR,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateToOpacity(opacity),
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::ColorBy(Actor& actor, const Vector4& color)
-{
-  ColorBy(actor, color, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha)
-{
-  ColorBy(actor, color, alpha, 0.0f, GetDuration());
-}
-
-void Animation::ColorBy(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
-                                                         Dali::Actor::COLOR,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateByVector4(color),
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::ColorTo(Actor& actor, const Vector4& color)
-{
-  ColorTo(actor, color, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha)
-{
-  ColorTo(actor, color, alpha, 0.0f, GetDuration());
-}
-
-void Animation::ColorTo(Actor& actor, const Vector4& color, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  AddAnimatorConnector( AnimatorConnector<Vector4>::New( actor,
-                                                         Dali::Actor::COLOR,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateToVector4(color),
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::Resize(Actor& actor, float width, float height)
-{
-  Resize(actor, width, height, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::Resize(Actor& actor, float width, float height, AlphaFunction alpha)
-{
-  Resize(actor, width, height, alpha, 0.0f, GetDuration());
-}
-
-void Animation::Resize(Actor& actor, float width, float height, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  Vector3 targetSize( width, height, min(width, height) );
-
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  // Notify the actor impl that its size is being animated
-  actor.NotifySizeAnimation( *this, targetSize );
-
-  AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
-                                                         Dali::Actor::SIZE,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateToVector3(targetSize),
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-void Animation::Resize(Actor& actor, const Vector3& size)
-{
-  Resize(actor, size, mDefaultAlpha, 0.0f, GetDuration());
-}
-
-void Animation::Resize(Actor& actor, const Vector3& size, AlphaFunction alpha)
-{
-  Resize(actor, size, alpha, 0.0f, GetDuration());
-}
-
-void Animation::Resize(Actor& actor, const Vector3& size, AlphaFunction alpha, float delaySeconds, float durationSeconds)
-{
-  ExtendDuration( TimePeriod(delaySeconds, durationSeconds) );
-
-  // Notify the actor impl that its size is being animated
-  actor.NotifySizeAnimation( *this, size );
-
-  AddAnimatorConnector( AnimatorConnector<Vector3>::New( actor,
-                                                         Dali::Actor::SIZE,
-                                                         Property::INVALID_COMPONENT_INDEX,
-                                                         AnimateToVector3(size),
-                                                         alpha,
-                                                         TimePeriod(delaySeconds, durationSeconds) ) );
-}
-
-bool Animation::DoAction(BaseObject* object, const std::string& actionName, const std::vector<Property::Value>& attributes)
+bool Animation::DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes )
 {
   bool done = false;
-  Animation* animation = dynamic_cast<Animation*>(object);
+  Animation* animation = dynamic_cast<Animation*>( object );
 
   if( animation )
   {
-    if(Dali::Animation::ACTION_PLAY == actionName)
+    if( 0 == actionName.compare( ACTION_PLAY ) )
     {
-      if(attributes.size() > 0)
+      if( Property::Value* value = attributes.Find("duration", Property::FLOAT) )
       {
-        animation->SetDuration(attributes[0].Get<float>());
+        animation->SetDuration( value->Get<float>() );
       }
 
       animation->Play();
       done = true;
     }
-    else if(Dali::Animation::ACTION_STOP == actionName)
+    else if( 0 == actionName.compare( ACTION_STOP ) )
     {
       animation->Stop();
       done = true;
     }
-    else if(Dali::Animation::ACTION_PAUSE == actionName)
+    else if( 0 == actionName.compare( ACTION_PAUSE ) )
     {
       animation->Pause();
       done = true;
@@ -1206,23 +921,23 @@ bool Animation::DoAction(BaseObject* object, const std::string& actionName, cons
   return done;
 }
 
-float Animation::GetCurrentProgress()
+void Animation::SetCurrentProgress(float progress)
 {
-  if( mAnimation )
+  if( mAnimation && progress >= mPlayRange.x && progress <= mPlayRange.y )
   {
-    return mAnimation->GetCurrentProgress();
+    // mAnimation is being used in a separate thread; queue a message to set the current progress
+    SetCurrentProgressMessage( mEventThreadServices, *mAnimation, progress );
   }
-
-  return 0.0f;
 }
 
-void Animation::SetCurrentProgress(float progress)
+float Animation::GetCurrentProgress()
 {
-  if( mAnimation && progress >= 0.0f && progress <= 1.0f )
+  if( mAnimation )
   {
-    // mAnimation is being used in a separate thread; queue a message to set the current progress
-    SetCurrentProgressMessage( mUpdateManager.GetEventToUpdate(), *mAnimation, progress );
+    return mAnimation->GetCurrentProgress();
   }
+
+  return 0.0f;
 }
 
 void Animation::ExtendDuration( const TimePeriod& timePeriod )
@@ -1240,7 +955,7 @@ void Animation::SetSpeedFactor( float factor )
   if( mAnimation )
   {
     mSpeedFactor = factor;
-    SetSpeedFactorMessage( mUpdateManager.GetEventToUpdate(), *mAnimation, factor );
+    SetSpeedFactorMessage( mEventThreadServices, *mAnimation, factor );
   }
 }
 
@@ -1249,6 +964,30 @@ float Animation::GetSpeedFactor() const
   return mSpeedFactor;
 }
 
+void Animation::SetPlayRange( const Vector2& range)
+{
+  //Make sure the range specified is between 0.0 and 1.0
+  if( range.x >= 0.0f && range.x <= 1.0f && range.y >= 0.0f && range.y <= 1.0f )
+  {
+    Vector2 orderedRange( range );
+    //If the range is not in order swap values
+    if( range.x > range.y )
+    {
+      orderedRange = Vector2(range.y, range.x);
+    }
+
+    // Cache for public getters
+    mPlayRange = orderedRange;
+
+    // mAnimation is being used in a separate thread; queue a message to set play range
+    SetPlayRangeMessage( mEventThreadServices, *mAnimation, orderedRange );
+  }
+}
+
+Vector2 Animation::GetPlayRange() const
+{
+  return mPlayRange;
+}
 
 
 } // namespace Internal