Problem animating a simple .b3d model exported from Blender.

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
InstinctCH
Posts: 16
Joined: Fri Feb 25, 2011 12:48 pm
Location: Switzerland

Problem animating a simple .b3d model exported from Blender.

Post by InstinctCH »

Hello everyone,

I had some issue when trying to animate a simple .b3d model that I exported from Blender. It's only a cube that makes a little translation via a skeletal animation. I found that piece of code somewhere on this forum and it worked perfectly with the ninja.b3d model but when I replace the ninja mesh by my cube, it seems like there is no animation. I've tried moving the mesh bone by bone but it still doesn't work. Here is the code :

Code: Select all

#include <IRR/irrlicht.h>

using namespace irr;
using namespace core;
using namespace scene;
using namespace video;

#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
#endif

int main()
{
   IrrlichtDevice *device =
      createDevice( video::EDT_OPENGL, dimension2d<u32>(800, 600));

   IVideoDriver* driver = device->getVideoDriver();
   ISceneManager* smgr = device->getSceneManager();

        smgr->addCameraSceneNode(0, vector3df(0,10,-10), vector3df(0,5,0));

        IAnimatedMesh* mesh = smgr->getMesh("testanim.b3d");
        IAnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode(mesh);
        node->setMaterialFlag(EMF_LIGHTING, false);
        node->setJointMode(EJUOR_CONTROL);

   while(device->run()) {

            node->animateJoints();
            driver->beginScene();
            smgr->drawAll();
            driver->endScene();
   }


   device->drop();

   return 0;
}
I'm using these models:
testanim.b3d
testanim.blend
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Turn debug data on for the skeleton to make sure it is there and animating correctly. I've had trouble recently with blender trying to get the influences right.
InstinctCH
Posts: 16
Joined: Fri Feb 25, 2011 12:48 pm
Location: Switzerland

Post by InstinctCH »

Actually, I can see the skeleton moving but the mesh stands still. I noticed that the skeleton wasn't like in Blender, it looks like cut in two parts.


Image
Image
Lonesome Ducky
Competition winner
Posts: 1123
Joined: Sun Jun 10, 2007 11:14 pm

Post by Lonesome Ducky »

Yep, this is a problem with blender's export. There's something special you have to do with the armatures, but I can't remember what it is. I've seen plenty of topics on forums on the internet related to it though. Maybe search for something like "Export blender animations correctly" in google.
ChaiRuiPeng
Posts: 363
Joined: Thu Dec 16, 2010 8:50 pm
Location: Somewhere in the clouds.. drinking pink lemonade and sunshine..

Post by ChaiRuiPeng »

Lonesome Ducky wrote:Yep, this is a problem with blender's export. There's something special you have to do with the armatures, but I can't remember what it is. I've seen plenty of topics on forums on the internet related to it though. Maybe search for something like "Export blender animations correctly" in google.
oh good, i am thankful someone elses was experenceing problems with blend exporting animated mesh.

i thought i was doing something terribly wrong.
i will look into that
Luben
Posts: 568
Joined: Sun Oct 09, 2005 10:12 am
Location: #irrlicht @freenode

Post by Luben »

There is some info and links to various threads gathered at http://www.irrlicht3d.org/wiki/index.php?n=Main.B3d
Post Reply