How can I create a QSkeleton manually with C++ and apply it to a mesh so that I can animate using C++?



  • Basically, I'm able to load a mesh via SceneLoader, but have no access to the joints. So I thought I could use the QSkeleton class and add a skeleton to my entity, but it hasn't worked.

    I don't know how to create a skeleton and apply it to my mesh in Qt so I can animate it using C++.

    For example, if I add one joint to a skeleton and apply it to the same Entity as the Mesh nothing happens when I update the transform of the joint and reapply the skeleton in the Update loop I have.

    Qt3DCore::QSkeleton* skeleton = new Qt3DCore::QSkeleton();
    Qt3DCore::QJoint* joint = new Qt3DCore::QJoint();
    joint->setTranslation(entityTransform->translation());
    skeleton->setRootJoint(joint);
    Qt3DCore::QArmature* a = new Qt3DCore::QArmature();
    a->setSkeleton(skeleton);
    entity->addComponent(a);
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.