Hello. I was playing around with Urho animation system. I want to animate grabber (Open/Close animation). But I am stuck with weird behavior: in blender all animation looks good for me, but when I am trying to export animation and model to Urho only right part of mesh is moving.
Here is video: https://youtu.be/XwktXtbv_B0
Here is blend file and exported data: https://drive.google.com/file/d/1y6zX8azHHd5uoWABFJ9MnWDFggycagXx/
Here is how I added mesh and animation into Urho:
//! Create the Grabber
{
m_grabberNode = m_scene->CreateChild("Grabber");
m_grabberNode->SetPosition(m_boxNode->LocalToWorld(Urho3D::Vector3(0.0f, 0.0f, 0.0f)));
auto grabberObject = m_grabberNode->CreateComponent<Urho3D::AnimatedModel>();
m_grabberNode->CreateComponent<Urho3D::AnimationController>();
grabberObject->SetModel(cache->GetResource<Urho3D::Model>("Models/Grabber.mdl"));
grabberObject->ApplyMaterialList("Materials/Grabber.txt");
grabberObject->SetCastShadows(true);
for (auto i = 0; i < grabberObject->GetSkeleton().GetNumBones(); ++i) {
auto bone = grabberObject->GetSkeleton().GetBone(i);
auto boneNode = bone->node_;
auto boneRigidBody = boneNode->CreateComponent<Urho3D::RigidBody>();
boneRigidBody->SetTrigger(true);
boneRigidBody->SetFriction(1.0f);
boneRigidBody->SetMass(0.0f);
boneRigidBody->SetLinearDamping(0.1f);
boneRigidBody->SetAngularDamping(0.1f);
boneRigidBody->SetCollisionLayer(1);
auto boneCollisionShape = boneNode->CreateComponent<Urho3D::CollisionShape>();
boneCollisionShape->SetBox(bone->boundingBox_.Size() * 0.7f, bone->boundingBox_.Center());
}
}
//! Animate the Grabber
{
if (Space Pressed)) {
m_grabberOpened = !m_grabberOpened;
auto animator = m_grabberNode->GetComponent<Urho3D::AnimationController>(true);
if (m_grabberOpened) {
animator->PlayExclusive("Animation/GrabberOpen.ani", 0, false, 0.5f);
} else {
animator->PlayExclusive("Animation/GrabberIDLE.ani", 0, false, 0.5f);
}
}
}
Blender v2.77 with Blender to Urho3D export plugin from master branch (branch for 2.8 does not work for me).