{"action":"created","issue":{"url":"https://api.github.com/repos/urho3d/Urho3D/issues/828","labels_url":"https://api.github.com/repos/urho3d/Urho3D/issues/828/labels{/name}","comments_url":"https://api.github.com/repos/urho3d/Urho3D/issues/828/comments","events_url":"https://api.github.com/repos/urho3d/Urho3D/issues/828/events","html_url":"https://github.com/urho3d/Urho3D/issues/828","id":99902826,"number":828,"title":"Value Animation Bug","user":{"login":"BlueMagnificent","id":6633428,"avatar_url":"https://avatars.githubusercontent.com/u/6633428?v=3","gravatar_id":"","url":"https://api.github.com/users/BlueMagnificent","html_url":"https://github.com/BlueMagnificent","followers_url":"https://api.github.com/users/BlueMagnificent/followers","following_url":"https://api.github.com/users/BlueMagnificent/following{/other_user}","gists_url":"https://api.github.com/users/BlueMagnificent/gists{/gist_id}","starred_url":"https://api.github.com/users/BlueMagnificent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlueMagnificent/subscriptions","organizations_url":"https://api.github.com/users/BlueMagnificent/orgs","repos_url":"https://api.github.com/users/BlueMagnificent/repos","events_url":"https://api.github.com/users/BlueMagnificent/events{/privacy}","received_events_url":"https://api.github.com/users/BlueMagnificent/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-09T14:53:05Z","updated_at":"2015-08-10T08:36:52Z","closed_at":null,"body":"ValueAnimation, which derives from Resources, does not override the virtual `BeginLoad()` method instead it implements a non-virtual function `Load()` of Resource class. Due to this, value animations cannot be loaded from resource file into a ValueAnimation object. \r\nFunny enough, the codes in `Load()`, I suppose, are meant to be the codes in `BeginLoad()`.\r\nImplementing `BeginLoad()` method in the source solves this problem. \r\n\r\n```\r\nbool ValueAnimation::BeginLoad(Deserializer& source)\r\n{\r\n\tXMLFile xmlFile(context_);\r\n\tif (!xmlFile.Load(source))\r\n\treturn false;\r\n\t\r\n\treturn LoadXML(xmlFile.GetRoot());\r\n}\r\n```\r\n\r\nThis issue can be verified with the below code\r\n\r\n```\r\nsphereNode_ = scene_->CreateChild(\"SphereNode\");\r\nsphereNode_->Scale(3);\r\nsphereNode_->Translate(Vector3(0,4,0));\r\nResourceCache* cache = GetSubsystem<ResourceCache>();\r\n\r\nStaticModel* sphereModel = sphereNode_->CreateComponent<StaticModel>();\r\nsphereModel->SetModel(cache->GetResource<Model>(\"Models/Sphere.mdl\"));\r\nsphereModel->SetMaterial(cache->GetResource<Material>(\"Materials/Stone.xml\"));\r\n\r\nValueAnimation*valAnim=cache->GetResource<ValueAnimation(\"Objects/sphereScaleAnimation.xml\");\r\n\r\nsphereNode_->SetAttributeAnimation(\"Scale\",valAnim, WM_ONCE);\r\n```\r\n\r\n\r\nhere is the sample ValueAnimation file used (sphereScaleAnimation.xml)\r\n```\r\n<?xml version=\"1.0\"?>\r\n<valueanimation interpolationmethod=\"Linear\">\r\n\t<keyframe time=\"0\" type=\"Vector3\" value=\"3 3 3\" />\r\n\t<keyframe time=\"0.5\" type=\"Vector3\" value=\"6 6 6\" />\r\n\t<keyframe time=\"1\" type=\"Vector3\" value=\"3 3 3\" />\r\n</valueanimation>\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/urho3d/Urho3D/issues/comments/129366331","html_url":"https://github.com/urho3d/Urho3D/issues/828#issuecomment-129366331","issue_url":"https://api.github.com/repos/urho3d/Urho3D/issues/828","id":129366331,"user":{"login":"cadaver","id":51361,"avatar_url":"https://avatars.githubusercontent.com/u/51361?v=3","gravatar_id":"","url":"https://api.github.com/users/cadaver","html_url":"https://github.com/cadaver","followers_url":"https://api.github.com/users/cadaver/followers","following_url":"https://api.github.com/users/cadaver/following{/other_user}","gists_url":"https://api.github.com/users/cadaver/gists{/gist_id}","starred_url":"https://api.github.com/users/cadaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cadaver/subscriptions","organizations_url":"https://api.github.com/users/cadaver/orgs","repos_url":"https://api.github.com/users/cadaver/repos","events_url":"https://api.github.com/users/cadaver/events{/privacy}","received_events_url":"https://api.github.com/users/cadaver/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T08:36:52Z","updated_at":"2015-08-10T08:36:52Z","body":"Seems that this was overlooked as part of the threaded resource load refactoring, and due to little use was not noticed before."}}