X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fbuilder%2Fbuilder-animations.cpp;h=c917d060335bac28fb8dfecbe87a08eaf07e9a39;hp=12a87c5ee27e4087b18a3f7ae3c6005da45c199e;hb=73eaac8af8efb9ac721db3fcf3c71a7a3115282a;hpb=5f6befa398f1c68fcc8edff409a086f54af4d5f9 diff --git a/dali-toolkit/internal/builder/builder-animations.cpp b/dali-toolkit/internal/builder/builder-animations.cpp index 12a87c5..c917d06 100644 --- a/dali-toolkit/internal/builder/builder-animations.cpp +++ b/dali-toolkit/internal/builder/builder-animations.cpp @@ -17,7 +17,7 @@ // EXTERNAL INCLUDES #include -#include +#include #include // INTERNAL INCLUDES @@ -134,7 +134,7 @@ AlphaFunction GetAlphaFunction( const std::string& alphaFunction ) } else { - DALI_ASSERT_ALWAYS( iter != alphaFunctionLut.end() && "Unknown Anchor Constant" ); + DALI_ASSERT_ALWAYS( iter != alphaFunctionLut.end() && "Unknown Alpha Constant" ); return Dali::AlphaFunction::DEFAULT; } } @@ -159,7 +159,7 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D Animation animation( Animation::New( 0.f ) ); - // duration needs to be set before AnimateTo calls for correct operation when AnimateTo has no "time-period". + // duration needs to be set before AnimateTo calls for correct operation when AnimateTo has no "timePeriod". OptionalFloat duration = constant.IsFloat( IsChild(child, "duration" ) ); if( duration ) @@ -172,35 +172,35 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D animation.SetLooping( *looping ); } - if( OptionalString endAction = constant.IsString( IsChild(child, "end-action" ) ) ) + if( OptionalString endAction = constant.IsString( IsChild(child, "endAction" ) ) ) { if("BAKE" == *endAction) { - animation.SetEndAction( Animation::Bake ); + animation.SetEndAction( Animation::BAKE ); } else if("DISCARD" == *endAction) { - animation.SetEndAction( Animation::Discard ); + animation.SetEndAction( Animation::DISCARD ); } else if("BAKE_FINAL" == *endAction) { - animation.SetEndAction( Animation::BakeFinal ); + animation.SetEndAction( Animation::BAKE_FINAL ); } } - if( OptionalString endAction = constant.IsString( IsChild(child, "disconnect-action" ) ) ) + if( OptionalString endAction = constant.IsString( IsChild(child, "disconnectAction" ) ) ) { if("BAKE" == *endAction) { - animation.SetDisconnectAction( Animation::Bake ); + animation.SetDisconnectAction( Animation::BAKE ); } else if("DISCARD" == *endAction) { - animation.SetDisconnectAction( Animation::Discard ); + animation.SetDisconnectAction( Animation::DISCARD ); } else if("BAKE_FINAL" == *endAction) { - animation.SetDisconnectAction( Animation::BakeFinal ); + animation.SetDisconnectAction( Animation::BAKE_FINAL ); } } @@ -229,37 +229,8 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D // to allow animating shader uniforms if( propIndex == Property::INVALID_INDEX ) { - ImageActor imageActor = ImageActor::DownCast( targetHandle ); - if( imageActor ) - { - // A limitation here is that its possible that between creation of animation - // and running it the ShaderEffect of the actor has been changed. - // However this is a unlikely use case especially when using scripts. - if( ShaderEffect effect = imageActor.GetShaderEffect() ) - { - propIndex = effect.GetPropertyIndex( *property ); - if(propIndex != Property::INVALID_INDEX) - { - targetHandle = effect; - } - else - { - DALI_SCRIPT_WARNING( "Cannot find property on object or ShaderEffect\n" ); - continue; - } - } - } - else - { - DALI_SCRIPT_WARNING( "Cannot find property on object or ShaderEffect\n" ); + DALI_SCRIPT_WARNING( "Cannot find property on object\n" ); continue; - } - } - - if( propIndex == Property::INVALID_INDEX) - { - DALI_ASSERT_ALWAYS( propIndex != Property::INVALID_INDEX && "Animation must specify a valid property" ); - continue; } } @@ -267,7 +238,7 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D AlphaFunction alphaFunction( AlphaFunction::DEFAULT ); TimePeriod timePeriod( 0.f ); - OptionalChild timeChild = IsChild( pKeyChild.second, "time-period" ); + OptionalChild timeChild = IsChild( pKeyChild.second, "timePeriod" ); if( timeChild ) { @@ -276,12 +247,12 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D durationSum = std::max( durationSum, timePeriod.delaySeconds + timePeriod.durationSeconds ); - if( OptionalString alphaChild = constant.IsString( IsChild(pKeyChild.second, "alpha-function" ) ) ) + if( OptionalString alphaChild = constant.IsString( IsChild(pKeyChild.second, "alphaFunction" ) ) ) { alphaFunction = GetAlphaFunction( *alphaChild ); } - if( OptionalChild keyFrameChild = IsChild(pKeyChild.second, "key-frames") ) + if( OptionalChild keyFrameChild = IsChild(pKeyChild.second, "keyFrames") ) { DALI_ASSERT_ALWAYS( property && "Animation must specify a property name" ); Property prop = Property( targetHandle, propIndex ); @@ -313,7 +284,7 @@ Animation CreateAnimation( const TreeNode& child, const Replacement& constant, D } AlphaFunction kfAlphaFunction( AlphaFunction::DEFAULT ); - if( OptionalString alphaFuncStr = constant.IsString( IsChild(pKeyChild.second, "alpha-function") ) ) + if( OptionalString alphaFuncStr = constant.IsString( IsChild(pKeyChild.second, "alphaFunction") ) ) { kfAlphaFunction = GetAlphaFunction( *alphaFuncStr ); }