Actor actor = Actor::New();
Stage::GetCurrent().Add(actor);
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), Vector3::ZERO, TEST_LOCATION );
+
// Build the animation
float durationSeconds(1.0f);
Animation animation = Animation::New(durationSeconds);
// Start the animation from 40% progress
animation.PlayFrom( 0.4f );
+ // Target value should be updated straight away
+ DALI_TEST_EQUALS( actor.GetProperty< Vector3 >( Actor::Property::POSITION ), targetPosition, TEST_LOCATION );
+
bool signalReceived(false);
AnimationFinishCheck finishCheck(signalReceived);
animation.FinishedSignal().Connect(&application, finishCheck);
mState = Dali::Animation::PLAYING;
- if( mEndAction != EndAction::Discard ) // If the animation is discarded, then we do not want to change the target values
- {
- // Sort according to end time with earlier end times coming first, if the end time is the same, then the connectors are not moved
- std::stable_sort( mConnectorTargetValues.begin(), mConnectorTargetValues.end(), CompareConnectorEndTimes );
-
- // Loop through all connector target values sorted by increasing end time
- ConnectorTargetValuesContainer::const_iterator iter = mConnectorTargetValues.begin();
- const ConnectorTargetValuesContainer::const_iterator endIter = mConnectorTargetValues.end();
- for( ; iter != endIter; ++iter )
- {
- AnimatorConnectorBase* connector = mConnectors[ iter->connectorIndex ];
-
- Object* object = connector->GetObject();
- if( object )
- {
- object->NotifyPropertyAnimation( *this, connector->GetPropertyIndex(), iter->targetValue, iter->animatorType );
- }
- }
- }
+ NotifyObjects();
// mAnimation is being used in a separate thread; queue a Play message
PlayAnimationMessage( mEventThreadServices, *mAnimation );
mState = Dali::Animation::PLAYING;
+ NotifyObjects();
+
// mAnimation is being used in a separate thread; queue a Play message
PlayAnimationFromMessage( mEventThreadServices, *mAnimation, progress );
}
return ( ( lhs.timePeriod.delaySeconds + lhs.timePeriod.durationSeconds ) < ( rhs.timePeriod.delaySeconds + rhs.timePeriod.durationSeconds ) );
}
+void Animation::NotifyObjects()
+{
+ if( mEndAction != EndAction::Discard ) // If the animation is discarded, then we do not want to change the target values
+ {
+ // Sort according to end time with earlier end times coming first, if the end time is the same, then the connectors are not moved
+ std::stable_sort( mConnectorTargetValues.begin(), mConnectorTargetValues.end(), CompareConnectorEndTimes );
+
+ // Loop through all connector target values sorted by increasing end time
+ ConnectorTargetValuesContainer::const_iterator iter = mConnectorTargetValues.begin();
+ const ConnectorTargetValuesContainer::const_iterator endIter = mConnectorTargetValues.end();
+ for( ; iter != endIter; ++iter )
+ {
+ AnimatorConnectorBase* connector = mConnectors[ iter->connectorIndex ];
+
+ Object* object = connector->GetObject();
+ if( object )
+ {
+ object->NotifyPropertyAnimation( *this, connector->GetPropertyIndex(), iter->targetValue, iter->animatorType );
+ }
+ }
+ }
+}
+
} // namespace Internal
} // namespace Dali