Browse Source

Remove animation only attribute support.

aster2013 11 years ago
parent
commit
2c672b154b

+ 1 - 2
Bin/Data/LuaScripts/30_LightAnimation.lua

@@ -70,8 +70,7 @@ function CreateScene()
     positionAnimation:SetKeyFrame(2.0, Variant(Vector3( 30.0, 5.0,  30.0)))
     positionAnimation:SetKeyFrame(3.0, Variant(Vector3(-30.0, 5.0,  30.0)))
     positionAnimation:SetKeyFrame(4.0, Variant(Vector3(-30.0, 5.0, -30.0)))
-    -- Set animation to node's world position
-    lightNode:SetAttributeAnimation("World Position", positionAnimation)
+    lightNode:SetAttributeAnimation("Position", positionAnimation)
 
     -- Create more StaticModel objects to the scene, randomly positioned, rotated and scaled. For rotation, we construct a
     -- quaternion from Euler angles where the Y angle (rotation about the Y axis) is randomized. The mushroom model contains

+ 1 - 2
Bin/Data/Scripts/30_LightAnimation.as

@@ -72,8 +72,7 @@ void CreateScene()
     positionAnimation.SetKeyFrame(2.0f, Variant(Vector3( 30.0f, 5.0f,  30.0f)));
     positionAnimation.SetKeyFrame(3.0f, Variant(Vector3(-30.0f, 5.0f,  30.0f)));
     positionAnimation.SetKeyFrame(4.0f, Variant(Vector3(-30.0f, 5.0f, -30.0f)));
-    // Set animation to node's world position
-    lightNode.SetAttributeAnimation("World Position", positionAnimation);
+    lightNode.SetAttributeAnimation("Position", positionAnimation);
 
     // Create more StaticModel objects to the scene, randomly positioned, rotated and scaled. For rotation, we construct a
     // quaternion from Euler angles where the Y angle (rotation about the Y axis) is randomized. The mushroom model contains

+ 0 - 2
Source/Engine/Core/Attribute.h

@@ -46,8 +46,6 @@ static const unsigned AM_NODEID = 0x10;
 static const unsigned AM_COMPONENTID = 0x20;
 /// Attribute is a node ID vector where first element is the amount of nodes.
 static const unsigned AM_NODEIDVECTOR = 0x40;
-/// Attribute is for attribute animation only, for example Node's world position attribute.
-static const unsigned AM_ATTRANIMATION= 0x80 | AM_NOEDIT;
 
 class Serializable;
 

+ 0 - 6
Source/Engine/Scene/Animatable.h

@@ -78,12 +78,6 @@ public:
     /// Return object animation attribute.
     ResourceRef GetObjectAnimationAttr() const;
 
-    /// Dummy function for REF_ACCESSOR_ATTRIBUTE macro, do not call.
-    const Vector2& GetDummyVector2() const { return Vector2::ZERO; }
-    const Vector3& GetDummyVector3() const { return Vector3::ZERO; }
-    const Vector4& GetDummyVector4() const { return Vector4::ZERO; }
-    const Quaternion& GetDummyQuaternion() const { return Quaternion::IDENTITY; }
-
 protected:
     /// Handle attribute animation added.
     virtual void OnAttributeAnimationAdded() = 0;

+ 0 - 7
Source/Engine/Scene/Node.cpp

@@ -79,13 +79,6 @@ void Node::RegisterObject(Context* context)
     REF_ACCESSOR_ATTRIBUTE(Node, VAR_VECTOR3, "Network Position", GetNetPositionAttr, SetNetPositionAttr, Vector3, Vector3::ZERO, AM_NET | AM_LATESTDATA | AM_NOEDIT);
     REF_ACCESSOR_ATTRIBUTE(Node, VAR_BUFFER, "Network Rotation", GetNetRotationAttr, SetNetRotationAttr, PODVector<unsigned char>, Variant::emptyBuffer, AM_NET | AM_LATESTDATA | AM_NOEDIT);
     REF_ACCESSOR_ATTRIBUTE(Node, VAR_BUFFER, "Network Parent Node", GetNetParentAttr, SetNetParentAttr, PODVector<unsigned char>, Variant::emptyBuffer, AM_NET | AM_NOEDIT);
-
-    // Attention, all get function are replaced with dummy function, because these get function not return reference type
-    REF_ACCESSOR_ATTRIBUTE(Node, VAR_VECTOR3, "Direction", GetDummyVector3, SetDirection, Vector3, Vector3::ZERO, AM_ATTRANIMATION);
-    REF_ACCESSOR_ATTRIBUTE(Node, VAR_VECTOR3, "World Position", GetDummyVector3, SetWorldPosition, Vector3, Vector3::ZERO, AM_ATTRANIMATION);
-    REF_ACCESSOR_ATTRIBUTE(Node, VAR_QUATERNION, "World Rotation", GetDummyQuaternion, SetWorldRotation, Quaternion, Quaternion::IDENTITY, AM_ATTRANIMATION);
-    REF_ACCESSOR_ATTRIBUTE(Node, VAR_VECTOR3, "World Direction", GetDummyVector3, SetWorldDirection, Vector3, Vector3::ZERO, AM_ATTRANIMATION);
-    REF_ACCESSOR_ATTRIBUTE(Node, VAR_VECTOR3, "World Scale", GetDummyVector3, SetWorldScale, Vector3, Vector3::ZERO, AM_ATTRANIMATION);
 }
 
 void Node::OnSetAttribute(const AttributeInfo& attr, const Variant& src)

+ 1 - 2
Source/Samples/30_LightAnimation/LightAnimation.cpp

@@ -115,8 +115,7 @@ void LightAnimation::CreateScene()
     positionAnimation->SetKeyFrame(2.0f, Vector3( 30.0f, 5.0f,  30.0f));
     positionAnimation->SetKeyFrame(3.0f, Vector3(-30.0f, 5.0f,  30.0f));
     positionAnimation->SetKeyFrame(4.0f, Vector3(-30.0f, 5.0f, -30.0f));
-    // Set animation to node's world position
-    lightNode->SetAttributeAnimation("World Position", positionAnimation);
+    lightNode->SetAttributeAnimation("Position", positionAnimation);
 
     // Create more StaticModel objects to the scene, randomly positioned, rotated and scaled. For rotation, we construct a
     // quaternion from Euler angles where the Y angle (rotation about the Y axis) is randomized. The mushroom model contains