+ if( mImpl->mRenderer )
+ {
+ if( animator.animate == false )
+ {
+ mImpl->mRenderer.SetProperty( index, animator.targetValue );
+ if( isMixColor )
+ {
+ mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, mImpl->mMixColor.a < 1.0 ? BlendMode::ON : BlendMode::AUTO );
+ }
+ }
+ else
+ {
+ if( animator.initialValue.GetType() != Property::NONE )
+ {
+ if( isMixColor )
+ {
+ animator.initialValue.Get( currentMixColor );
+ }
+
+#if defined(DEBUG_ENABLED)
+ {
+ std::ostringstream oss;
+ oss << animator.initialValue;
+ DALI_LOG_INFO( gVisualBaseLogFilter, Debug::General, " Setting Initial Value - %s\n", oss.str().c_str() );
+ }
+#endif
+ mImpl->mRenderer.SetProperty( index, animator.initialValue );
+ }
+
+ if( isMixColor )
+ {
+ mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE,
+ ( currentMixColor.a < 1.0 || mImpl->mMixColor.a < 1.0 ) ? BlendMode::ON : BlendMode::AUTO );
+ }
+
+ if( ! transition )
+ {
+ transition = Dali::Animation::New( 0.1f );
+ }
+
+#if defined(DEBUG_ENABLED)
+ {
+ std::ostringstream oss;
+ oss << animator.targetValue;
+ DALI_LOG_INFO( gVisualBaseLogFilter, Debug::General, " Animating to Value - %s\n", oss.str().c_str() );
+ }
+#endif
+
+ transition.AnimateTo( Property( mImpl->mRenderer, index ),
+ animator.targetValue,
+ animator.alphaFunction,
+ TimePeriod( animator.timePeriodDelay,
+ animator.timePeriodDuration ) );
+
+ if( isMixColor && currentMixColor.a < 1.0f && mImpl->mMixColor.a >= 1.0f )
+ {
+ // When it becomes opaque, set the blend mode back to automatically
+ if( ! mImpl->mBlendSlotDelegate )
+ {
+ mImpl->mBlendSlotDelegate = new SlotDelegate<Visual::Base>(this);
+ }
+ transition.FinishedSignal().Connect( *(mImpl->mBlendSlotDelegate), &Visual::Base::OnMixColorFinished );
+ }
+ }
+ }