Target Values of animation only set on ::Play() 86/119386/5
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Wed, 15 Mar 2017 10:38:35 +0000 (10:38 +0000)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Mon, 20 Mar 2017 14:12:58 +0000 (14:12 +0000)
Change-Id: I834e151b4f06a08def523cf9d915fcafa79fd806

automated-tests/src/dali/utc-Dali-Actor.cpp
automated-tests/src/dali/utc-Dali-Animation.cpp
automated-tests/src/dali/utc-Dali-CustomActor.cpp
dali/internal/event/animation/animation-impl.cpp
dali/internal/event/animation/animation-impl.h
dali/internal/event/animation/animator-connector-base.h

index bcc2aca..849024e 100644 (file)
@@ -1040,7 +1040,7 @@ int UtcDaliActorGetCurrentSizeImmediate(void)
   const Vector3 targetValue( 10.0f, 20.0f, 30.0f );
   animation.AnimateTo( Property( actor, Actor::Property::SIZE ), targetValue );
 
-  DALI_TEST_CHECK( actor.GetTargetSize() == targetValue );
+  DALI_TEST_CHECK( actor.GetTargetSize() == vector );
 
   // Start the animation
   animation.Play();
index 8e617de..0f35aa8 100644 (file)
@@ -10141,3 +10141,251 @@ int UtcDaliAnimationAnimateBetweenNonAnimateableTypeN(void)
 
   END_TEST;
 }
+
+int UtcDaliAnimationSetAndGetTargetBeforePlayP(void)
+{
+  tet_infoline("Setting up an animation should not effect it's position property until the animation plays");
+
+  TestApplication application;
+
+  tet_infoline("Set initial position and set up animation to re-position actor");
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  Vector3 initialPosition(0.0f, 0.0f, 0.0f);
+  actor.SetProperty( Actor::Property::POSITION, initialPosition );
+
+  // Build the animation
+  Animation animation = Animation::New(2.0f);
+
+  //Test GetCurrentProgress return 0.0 as the duration is 0.0
+  DALI_TEST_EQUALS( 0.0f, animation.GetCurrentProgress(), TEST_LOCATION );
+  DALI_TEST_EQUALS( Vector3( 0.0f, 0.0f, 0.0f ), actor.GetCurrentPosition(), TEST_LOCATION );
+
+  tet_infoline("Set target position in animation without intiating play");
+
+  Vector3 targetPosition(100.0f, 100.0f, 100.0f);
+  animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPosition, AlphaFunction::LINEAR);
+
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline("Ensure position of actor is still at intial value");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), initialPosition.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), initialPosition.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), initialPosition.z, TEST_LOCATION );
+
+  tet_infoline("Play animation and ensure actor position is now target");
+
+  animation.Play();
+  application.SendNotification();
+  application.Render(1000u);
+
+  tet_infoline("Ensure position of actor is at target value when aninmation half way");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), targetPosition.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), targetPosition.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), targetPosition.z, TEST_LOCATION );
+
+  tet_printf( "x position at half way point(%f)\n", actor.GetCurrentPosition().x );
+
+  application.Render(2000u);
+
+  tet_infoline("Ensure position of actor is still at target value when aninmation complete");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), targetPosition.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), targetPosition.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), targetPosition.z, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsPositionP(void)
+{
+  tet_infoline("Setting up an animation should not effect it's position property until the animation plays even with mulitple animators");
+
+  TestApplication application;
+
+  std::vector<Vector3> targetPositions;
+
+  targetPositions.push_back( Vector3( 100.0f, 100.0f, 100.0f ) );
+  targetPositions.push_back( Vector3( 200.0f, 1.0f, 100.0f ) );
+  targetPositions.push_back( Vector3( 50.0f, 10.0f, 100.0f ) );
+
+  tet_infoline("Set initial position and set up animation to re-position actor");
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  Vector3 initialPosition(0.0f, 0.0f, 0.0f);
+  actor.SetProperty( Actor::Property::POSITION, initialPosition );
+
+  // Build the animation
+  Animation animation = Animation::New(2.0f);
+
+  //Test GetCurrentProgress return 0.0 as the duration is 0.0
+  DALI_TEST_EQUALS( 0.0f, animation.GetCurrentProgress(), TEST_LOCATION );
+  DALI_TEST_EQUALS( Vector3( 0.0f, 0.0f, 0.0f ), actor.GetCurrentPosition(), TEST_LOCATION );
+
+  tet_infoline("Set target position in animation without intiating play");
+
+  for ( unsigned int i = 0; i < targetPositions.size(); i++ )
+  {
+    animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPositions[i], AlphaFunction::LINEAR);
+  }
+
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline("Ensure position of actor is still at intial value");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), initialPosition.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), initialPosition.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), initialPosition.z, TEST_LOCATION );
+
+  tet_infoline("Play animation and ensure actor position is now target");
+
+  animation.Play();
+  application.SendNotification();
+  application.Render(1000u);
+
+  tet_infoline("Ensure position of actor is at target value when aninmation half way");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), targetPositions[2].x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), targetPositions[2].y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), targetPositions[2].z, TEST_LOCATION );
+
+  tet_printf( "x position at half way point(%f)\n", actor.GetCurrentPosition().x );
+
+  application.Render(2000u);
+
+  tet_infoline("Ensure position of actor is still at target value when aninmation complete");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), targetPositions[2].x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), targetPositions[2].y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), targetPositions[2].z, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsSizeAndPositionP(void)
+{
+  tet_infoline("Setting up an animation should not effect it's size property until the animation plays even with mulitple animators of different Property Indexes");
+
+  TestApplication application;
+
+  std::vector<Vector3> targetSizes;
+  std::vector<Vector3> targetPositions;
+
+  targetSizes.push_back( Vector3( 100.0f, 100.0f, 100.0f ) );
+  targetSizes.push_back( Vector3( 50.0f, 10.0f, 100.0f ) );
+
+  targetPositions.push_back( Vector3( 200.0f, 1.0f, 100.0f ) );
+
+  tet_infoline("Set initial position and set up animation to re-position actor");
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  Vector3 initialSize( 10.0f, 10.0f, 10.0f);
+  Vector3 initialPosition(10.0f, 10.0f, 10.0f);
+
+  actor.SetProperty( Actor::Property::SIZE, initialSize );
+  actor.SetProperty( Actor::Property::POSITION, initialPosition );
+
+  // Build the animation
+  Animation animation = Animation::New(2.0f);
+
+  tet_infoline("Set target size in animation without intiating play");
+  animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[0], AlphaFunction::LINEAR);
+  tet_infoline("Set target position in animation without intiating play");
+  animation.AnimateTo(Property(actor, Actor::Property::POSITION), targetPositions[0], AlphaFunction::LINEAR);
+  animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[1], AlphaFunction::LINEAR);
+
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline("Ensure position of actor is still at intial size and position");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), initialSize.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), initialSize.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_DEPTH), initialSize.z, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), initialPosition.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), initialPosition.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_DEPTH), initialPosition.z, TEST_LOCATION );
+
+  tet_infoline("Play animation and ensure actor position and size is now matches targets");
+
+  animation.Play();
+  application.SendNotification();
+  application.Render(2000u);
+
+  tet_infoline("Ensure position and size of actor is at target value when aninmation playing");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), targetSizes[1].x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), targetSizes[1].y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_DEPTH), targetSizes[1].z, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_X), targetPositions[0].x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Y), targetPositions[0].y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::POSITION_Z), targetPositions[0].z, TEST_LOCATION );
+
+  END_TEST;
+}
+
+int UtcDaliAnimationSetAndGetTargetBeforePlayMulitpleAnimatorsSizeAndPositionColourP(void)
+{
+  tet_infoline("Setting up an animation should not effect it's size property until the animation plays even if other Properties animated");
+
+  TestApplication application;
+
+  std::vector<Vector3> targetSizes;
+  std::vector<float> targetColors;
+
+  targetSizes.push_back( Vector3( 100.0f, 100.0f, 100.0f ) );
+  targetSizes.push_back( Vector3( 50.0f, 10.0f, 150.0f ) );
+
+  targetColors.push_back( 1.0f );
+
+  tet_infoline("Set initial position and set up animation to re-position actor");
+
+  Actor actor = Actor::New();
+  Stage::GetCurrent().Add(actor);
+  Vector3 initialSize( 10.0f, 5.0f, 10.0f);
+
+  actor.SetProperty( Actor::Property::SIZE, initialSize );
+
+  // Build the animation
+  Animation animation = Animation::New(2.0f);
+
+  tet_infoline("Set target size in animation without intiating play");
+  animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[0], AlphaFunction::LINEAR);
+  tet_infoline("Set target position in animation without intiating play");
+  animation.AnimateTo(Property(actor, Actor::Property::COLOR_RED), targetColors[0], AlphaFunction::LINEAR);
+  animation.AnimateTo(Property(actor, Actor::Property::SIZE), targetSizes[1], AlphaFunction::LINEAR);
+
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline("Ensure position of actor is still at intial size and position");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), initialSize.x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), initialSize.y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_DEPTH), initialSize.z, TEST_LOCATION );
+
+  tet_infoline("Play animation and ensure actor position and size is now matches targets");
+
+  animation.Play();
+  application.SendNotification();
+  application.Render(2000u);
+
+  tet_infoline("Ensure position and size of actor is at target value when aninmation playing");
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_WIDTH), targetSizes[1].x, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_HEIGHT), targetSizes[1].y, TEST_LOCATION );
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::SIZE_DEPTH), targetSizes[1].z, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( actor.GetProperty<float>(Actor::Property::COLOR_RED), targetColors[0], TEST_LOCATION );
+
+  END_TEST;
+}
index c8dbb97..db7fca7 100644 (file)
@@ -876,6 +876,11 @@ int UtcDaliCustomActorOnSizeAnimation(void)
 
   Animation anim = Animation::New( 1.0f );
   anim.AnimateTo( Property( custom, Actor::Property::SIZE ), Vector3( 8.0f, 9.0f, 10.0f ) );
+  anim.Play();
+
+  application.SendNotification();
+  application.Render( static_cast<unsigned int>( 1000.0f ) );
+
   DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
   DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 0 ], TEST_LOCATION );
   DALI_TEST_EQUALS( 8.0f, custom.GetTargetSize().width, TEST_LOCATION );
@@ -884,6 +889,38 @@ int UtcDaliCustomActorOnSizeAnimation(void)
   END_TEST;
 }
 
+int UtcDaliCustomActorSizeComponentAnimation(void)
+{
+  TestApplication application;
+  tet_infoline("Testing Size component animation");
+
+  Test::TestCustomActor custom = Test::TestCustomActor::New();
+  float intialWidth( 10.0f );
+
+  DALI_TEST_EQUALS( 0, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+  custom.SetSize( intialWidth, 10.0f); // First method
+
+  Animation anim = Animation::New( 1.0f );
+
+  DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
+  anim.AnimateTo( Property( custom, Actor::Property::SIZE_WIDTH ), 20.0f );
+
+  DALI_TEST_EQUALS( 1, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
+  anim.Play();   // Triggers second method ( OnSizeAnimation )
+
+  application.SendNotification();
+  application.Render( static_cast<unsigned int>( 1000.0f ) );
+
+  DALI_TEST_EQUALS( 2, (int)(custom.GetMethodsCalled().size()), TEST_LOCATION );
+
+  DALI_TEST_EQUALS( "OnSizeAnimation", custom.GetMethodsCalled()[ 1 ], TEST_LOCATION );
+
+  END_TEST;
+
+}
+
 int UtcDaliCustomActorOnTouchEvent(void)
 {
   TestApplication application;
index ec1a6ca..c09c4b1 100644 (file)
@@ -36,6 +36,7 @@
 #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>
+#include <dali/internal/update/animation/scene-graph-animator.h>
 #include <dali/internal/update/manager/update-manager.h>
 
 using Dali::Internal::SceneGraph::UpdateManager;
@@ -266,6 +267,77 @@ void Animation::Play()
 
   mState = Dali::Animation::PLAYING;
 
+  unsigned int connectorTargetValuesIndex( 0 );
+  unsigned int numberOfConnectorTargetValues = mConnectorActorTargetValues.size();
+
+  /*
+   * Loop through all Animator connectors, if connector index matches the current index stored in mConnectorActorTargetValues container then
+   * should apply target values for this index to the Actor.
+   * Confirm object is an actor and it is a POSITION or SIZE Property Index before sending Notify message to Actor.
+   */
+  for ( unsigned int connectorIndex = 0; connectorIndex < mConnectors.Count(); connectorIndex ++)
+  {
+    // Use index to check if the current connector is next in the mConnectorActorTargetValues container, meaning targetValues have been pushed in AnimateXXFunction
+    if ( connectorTargetValuesIndex < numberOfConnectorTargetValues )
+    {
+      ConnectorTargetValues& connectorPair = mConnectorActorTargetValues[ 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 ];
+
+        Actor* maybeActor = static_cast<Actor*>( connector->GetObject() ); // Only Actors would be in mConnectorActorTargetValues container
+
+        if ( maybeActor )
+        {
+          // Get Stored Target Value and corresponding connector index
+          const Property::Type valueType = connectorPair.targetValue.GetType();
+          Property::Index propertyIndex = connector->GetPropertyIndex();
+
+          if ( valueType == Property::VECTOR3 )
+          {
+            Vector3 targetVector3 = connectorPair.targetValue.Get<Vector3>();
+
+            if ( propertyIndex == Dali::Actor::Property::POSITION )
+            {
+              maybeActor->NotifyPositionAnimation( *this, targetVector3 );
+            }
+            else if ( propertyIndex == Dali::Actor::Property::SIZE )
+            {
+              maybeActor->NotifySizeAnimation( *this, targetVector3 );
+            }
+          }
+          else if ( valueType == Property::FLOAT )
+          {
+            float targetFloat = connectorPair.targetValue.Get<float>();
+
+            if ( ( Dali::Actor::Property::POSITION_X == propertyIndex ) ||
+                 ( Dali::Actor::Property::POSITION_Y == propertyIndex ) ||
+                 ( Dali::Actor::Property::POSITION_Z == propertyIndex ) )
+            {
+              maybeActor->NotifyPositionAnimation( *this, targetFloat, propertyIndex );
+            }
+            else if ( ( Dali::Actor::Property::SIZE_WIDTH == propertyIndex ) ||
+                    ( Dali::Actor::Property::SIZE_HEIGHT == propertyIndex ) ||
+                    ( Dali::Actor::Property::SIZE_DEPTH == propertyIndex ) )
+
+            {
+              maybeActor->NotifySizeAnimation( *this, targetFloat, propertyIndex );
+            }
+          }
+          else
+          {
+            // Currently only FLOAT and VECTOR3 is supported for Target values in AnimateXXFunctions
+            DALI_LOG_WARNING("Animation::Play Unsupported Value Type provided as TargetValue\n");
+          }
+        }
+      }
+    }
+  }
+
   // mAnimation is being used in a separate thread; queue a Play message
   PlayAnimationMessage( mEventThreadServices, *mAnimation );
 }
@@ -502,26 +574,21 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
     {
       if ( ( Dali::Actor::Property::SIZE_WIDTH == targetPropertyIndex ) ||
            ( Dali::Actor::Property::SIZE_HEIGHT == targetPropertyIndex ) ||
-           ( Dali::Actor::Property::SIZE_DEPTH == targetPropertyIndex ) )
+           ( Dali::Actor::Property::SIZE_DEPTH == targetPropertyIndex )  ||
+           ( Dali::Actor::Property::POSITION_X == targetPropertyIndex ) ||
+           ( Dali::Actor::Property::POSITION_Y == targetPropertyIndex ) ||
+           ( Dali::Actor::Property::POSITION_Z == 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<float>(), targetPropertyIndex );
-        }
-      }
-      else if ( ( Dali::Actor::Property::POSITION_X == targetPropertyIndex ) ||
-                 ( Dali::Actor::Property::POSITION_Y == targetPropertyIndex ) ||
-                 ( Dali::Actor::Property::POSITION_Z == targetPropertyIndex ) )
-      {
-        // Test whether this is actually an Actor
+
         Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
         if ( maybeActor )
         {
-          // Notify the actor that its position is being animated
-          maybeActor->NotifyPositionAnimation( *this, destinationValue.Get<float>(), targetPropertyIndex );
+          // Store data to later notify the actor that its size or position is being animated
+          ConnectorTargetValues connectorPair;
+          connectorPair.targetValue = destinationValue;
+          connectorPair.connectorIndex = mConnectors.Count();
+
+          mConnectorActorTargetValues.push_back( connectorPair );
         }
       }
 
@@ -547,24 +614,18 @@ void Animation::AnimateTo(Object& targetObject, Property::Index targetPropertyIn
 
     case Property::VECTOR3:
     {
-      if ( Dali::Actor::Property::SIZE == targetPropertyIndex )
+      if ( Dali::Actor::Property::SIZE == targetPropertyIndex || Dali::Actor::Property::POSITION == 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>() );
-        }
-      }
-      else if ( Dali::Actor::Property::POSITION == targetPropertyIndex )
-      {
-        // Test whether this is actually an Actor
-        Actor* maybeActor = dynamic_cast<Actor*>( &targetObject );
-        if ( maybeActor )
-        {
-          // Notify the actor that its position is being animated
-          maybeActor->NotifyPositionAnimation( *this, destinationValue.Get<Vector3>() );
+          // Store data to later notify the actor that its size or position is being animated
+          ConnectorTargetValues connectorPair;
+          connectorPair.targetValue = destinationValue;
+          connectorPair.connectorIndex = mConnectors.Count();
+
+          mConnectorActorTargetValues.push_back( connectorPair );
         }
       }
 
index 24dc3ff..7239ed4 100644 (file)
@@ -448,6 +448,13 @@ private:
   Animation& operator=(const Animation& rhs);
 
 private:
+
+  struct ConnectorTargetValues
+  {
+    unsigned int connectorIndex;
+    Property::Value targetValue;
+  };
+
   EventThreadServices& mEventThreadServices;
   AnimationPlaylist& mPlaylist;
 
@@ -462,6 +469,8 @@ private:
 
   AnimatorConnectorContainer mConnectors; ///< Owned by the Animation
 
+  std::vector< ConnectorTargetValues > mConnectorActorTargetValues; //< Store Actor target values and matchinf connector index that need to set value on Animation::Play
+
   // Cached for public getters
   float mDurationSeconds;
   float mSpeedFactor;
index 5a54bc8..8ab2a8c 100644 (file)
@@ -89,7 +89,7 @@ public:
    * Retrieve the parent of the AnimatorConnector.
    * @return The parent object, or NULL.
    */
-  Animation* GetParent()
+  Animation* GetParent() const
   {
     return mParent;
   }