+Property::Value Object::GetCurrentPropertyValue(const PropertyMetadata& entry) const
+{
+ Property::Value value;
+
+ if(!entry.IsAnimatable())
+ {
+ value = entry.GetPropertyValue();
+ }
+ else
+ {
+ BufferIndex bufferIndex(GetEventThreadServices().GetEventBufferIndex());
+
+ switch(entry.GetType())
+ {
+ case Property::BOOLEAN:
+ {
+ const AnimatableProperty<bool>* property = static_cast<const AnimatableProperty<bool>*>(entry.GetSceneGraphProperty());
+ DALI_ASSERT_DEBUG(property);
+
+ value = (*property)[bufferIndex];
+ break;
+ }
+
+ case Property::INTEGER:
+ {
+ const AnimatableProperty<int32_t>* property = static_cast<const AnimatableProperty<int32_t>*>(entry.GetSceneGraphProperty());
+ DALI_ASSERT_DEBUG(property);
+
+ value = (*property)[bufferIndex];
+ break;
+ }
+
+ case Property::FLOAT:
+ {
+ const AnimatableProperty<float>* property = static_cast<const AnimatableProperty<float>*>(entry.GetSceneGraphProperty());
+ DALI_ASSERT_DEBUG(property);
+
+ value = (*property)[bufferIndex];
+ break;
+ }
+
+ case Property::VECTOR2:
+ {
+ const AnimatableProperty<Vector2>* property = static_cast<const AnimatableProperty<Vector2>*>(entry.GetSceneGraphProperty());
+ DALI_ASSERT_DEBUG(property);
+
+ if(entry.componentIndex == 0)
+ {
+ value = (*property)[bufferIndex].x;
+ }
+ else if(entry.componentIndex == 1)
+ {
+ value = (*property)[bufferIndex].y;
+ }
+ else
+ {
+ value = (*property)[bufferIndex];
+ }
+ break;
+ }
+
+ case Property::VECTOR3:
+ {
+ const AnimatableProperty<Vector3>* property = static_cast<const AnimatableProperty<Vector3>*>(entry.GetSceneGraphProperty());
+ DALI_ASSERT_DEBUG(property);
+
+ if(entry.componentIndex == 0)
+ {
+ value = (*property)[bufferIndex].x;
+ }
+ else if(entry.componentIndex == 1)
+ {
+ value = (*property)[bufferIndex].y;
+ }
+ else if(entry.componentIndex == 2)
+ {
+ value = (*property)[bufferIndex].z;
+ }
+ else
+ {
+ value = (*property)[bufferIndex];
+ }
+ break;
+ }
+
+ case Property::VECTOR4:
+ {
+ const AnimatableProperty<Vector4>* property = static_cast<const AnimatableProperty<Vector4>*>(entry.GetSceneGraphProperty());
+ DALI_ASSERT_DEBUG(property);
+
+ if(entry.componentIndex == 0)
+ {
+ value = (*property)[bufferIndex].x;
+ }
+ else if(entry.componentIndex == 1)
+ {
+ value = (*property)[bufferIndex].y;
+ }
+ else if(entry.componentIndex == 2)
+ {
+ value = (*property)[bufferIndex].z;
+ }
+ else if(entry.componentIndex == 3)
+ {
+ value = (*property)[bufferIndex].w;
+ }
+ else
+ {
+ value = (*property)[bufferIndex];
+ }
+ break;
+ }
+
+ case Property::MATRIX:
+ {
+ const AnimatableProperty<Matrix>* property = static_cast<const AnimatableProperty<Matrix>*>(entry.GetSceneGraphProperty());
+ DALI_ASSERT_DEBUG(property);
+
+ value = (*property)[bufferIndex];
+ break;
+ }
+
+ case Property::MATRIX3:
+ {
+ const AnimatableProperty<Matrix3>* property = static_cast<const AnimatableProperty<Matrix3>*>(entry.GetSceneGraphProperty());
+ DALI_ASSERT_DEBUG(property);
+
+ value = (*property)[bufferIndex];
+ break;
+ }
+
+ case Property::ROTATION:
+ {
+ const AnimatableProperty<Quaternion>* property = static_cast<const AnimatableProperty<Quaternion>*>(entry.GetSceneGraphProperty());
+ DALI_ASSERT_DEBUG(property);
+
+ value = (*property)[bufferIndex];
+ break;
+ }
+
+ default:
+ {
+ // unreachable code due to higher level logic
+ }
+ } // switch(type)
+ } // if animatable
+
+ return value;