Animations not playing

  1. 6 months ago

    Skeletal animation doesn't seem to be working for me in the goodbye_cmake branch. Did something change in how you would play animations?

    Here's the code I'm using to initialize the mesh:

        mesh = new SceneMesh(globalPool, "character.mesh");
        mesh->setMaterial(globalPool->getMaterial("UnlitWireframe"));
        mesh->setColor(1, 1, 1, 1);
        scene->addEntity(mesh);
        
        mesh->loadSkeleton(core, "character.skeleton");
        mesh->getSkeleton()->bonesVisible(true);
        mesh->getSkeleton()->addAnimation(core, "idle", "idle.anim");
        mesh->getSkeleton()->addAnimation(core, "walk", "walk.anim");
        mesh->getSkeleton()->setBaseAnimationByName("idle");
        mesh->getSkeleton()->playAnimationByName("walk", 0.5, false, false);

    And here's the update loop:

        bool res = core->Update();
        
        scene->Update(core->getElapsed());
        
        mesh->Roll(1);
        mesh->Pitch(1);
        
        RenderFrame *frame = new RenderFrame(core->getViewport());
        scene->Render(frame, NULL, NULL, NULL, false);
        core->getRenderer()->submitRenderFrame(frame);
        
        return res;
  2. Ivan

    1 Aug 2016 Administrator

    Skeletal animations are now GPU-only in goodbye_cmake. You'll need a vertex shader that takes bone matrices( Look at GPUSkinning.vert). There is one material right now that you can use out of the box: DefaultShaderAnimated. It's just a simple textured material. I am planning on adding animated versions of all standard materials. Or someone else can do that too if they feel like contributing a thing ;)

  3. Interesting. Thanks!

 

or Sign Up to reply!