yet another animation/mesh question

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
Shingetsu
Posts: 2
Joined: Sun Nov 11, 2012 11:13 pm

yet another animation/mesh question

Post by Shingetsu »

I've been trying (for hours now) to get a b3d model loaded, shown and animated properly. The model has an animation between frames 0 and 45, it was made and painted (the whole kit) in blender as testing model. Only half of the model is shown, it's completely white and it doesn't move.
I've been googling on information on loading b3d into irrlicht and it's animation system, but trying to load texture from the b3d file failed and all other information I incorporated into the program.

I've also read on the forums but most redirect to "how to use the new animation system" which isn't particularly helpful (I've incorporated what it tells me and still nothing)

Here is the link to the picture of the actual result. (http://picpaste.com/af00c9fec265405db38 ... 14d661.jpg)

Here is the link to the code (shortened with comments on the insignificant parts). (http://pastebin.com/tyMfJ8GR)

I read tutorials 1 through 4 (which are relevant to this case) and it doesn't work even close to how it should be. Isn't built in texture supported? (if not, I guess the texture problem is identified and I'll ask for a UV). For the animation I'm completely stumped. And for only half the mesh showing as well.

P.S. for some reason the url tag was blocked, so just pasted, hope you don't mind.
mongoose7
Posts: 1227
Joined: Wed Apr 06, 2011 12:13 pm

Re: yet another animation/mesh question

Post by mongoose7 »

What are the messages Irrlicht prints to the console while loading the model?

I'm guessing that the link is to a texture on your hard drive. I would expect "d:\data\texture\texture1.jpg", but you said it was Linux so I can't make that joke.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: yet another animation/mesh question

Post by CuteAlien »

You shouldn't have to set the jointmode or all animateJoints. Please try the model first in the model-viewer (example 09) and check what kind of results you get there.
Can you also link to the model itself or can't you give that out?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Shingetsu
Posts: 2
Joined: Sun Nov 11, 2012 11:13 pm

Re: yet another animation/mesh question

Post by Shingetsu »

mongoose7 wrote:What are the messages Irrlicht prints to the console while loading the model?
About loading BONES and loading the mesh. The bone names correspond to that which the one that made the model named them as. If/when I try to load the texture from the same file, it tells me that it can't load texture from it.
mongoose7 wrote:I'm guessing that the link is to a texture on your hard drive. I would expect "d:\data\texture\texture1.jpg", but you said it was Linux so I can't make that joke.
You can always make the /tmp joke.
Maybe it was in /tmp/data/texture/texture1.jpg and you ran out of RAM D:
(explanation: /tmp is tmpfs, so in the RAM. When you start running out of it it deletes the files in it to make up)
CuteAlien wrote:You shouldn't have to set the jointmode or all animateJoints. Please try the model first in the model-viewer (example 09) and check what kind of results you get there.
Ok, I wasn't aware it was there, I'll try that.
CuteAlien wrote:Can you also link to the model itself or can't you give that out?
Sure, I'll link to it as soon as I get home >_> which will be tomorrow evening (lol). In the meanwhile, he made a new model (and exported UV) so I'll test that one as well.
Destructavator
Posts: 40
Joined: Sat Feb 06, 2010 9:00 pm
Location: Ohio, USA

Re: yet another animation/mesh question

Post by Destructavator »

Hey everyone,

I've downloaded the new 1.8 SDK and have tried various models of my own design (made in the latest stable Blender, which is version 2.64), and I can also confirm issues with .b3d files and the newly released Irrlicht SDK. I've found these issues exist with both my own little quick test app built with MinGW TDM 32-bit build as well as the pre-compiled mesh viewer example that comes with the SDK, on Windows. (Not sure if this also makes a difference, but I stick to OpenGL.)

*However* ----- After trying various versions of the .b3d exporter on the Internet and doing some research (reading posts in various places), I strongly suspect that this is *not* an Irrlicht issue, but rather an issue between the latest version of Blender and the .b3d exporter.

In my case, I've gotten textures to load properly on an animated mesh scene node with a skeletal-based animation, except I just can't get any animations to play. For the record, with older versions of Blender and older versions of the .b3d exporter, I've done plenty of animations, even custom ones with direct control of the bones to work fine, so I do have a little experience with making Irrlicht do this successfully.

I think someone will have to roll up their sleeves and get into the Python code of the .b3d exporter to get animations to export properly. From my research, others are waiting for someone to do this but I haven't seen anyone post about doing it themselves.

Again, I don't think this is a bug in Irrlicht.

BTW, If anyone is interested, I'm working on some code and models for a program that I intend to make open-source anyways, so if anyone wants some test models and code that works (once I get it working), I don't mind uploading what I have, if that helps anyone.

As for fixing the .b3d exporter, If no one else "steps up to the plate" anytime soon, I guess I can try to tackle it myself, although I must warn people that I don't write the best code (my C++ alone looks like a kid wrote it sometimes), as I'm a self-taught amateur programmer.

As for why the original poster in this thread was having issues getting the texture to work, that part I don't know, I've just been struggling with getting my animations to work.

EDIT / UPDATE: I found another version of the .b3d exporter for Blender 2.63, which is almost as recent as the 2.64 Blender release. It is also discussed in a tutorial with Irrlicht 1.8, so it looks like someone got a working exporter together already: http://www.youtube.com/watch?v=sT3KV3z5pA8

I'm going to have to try this out and fiddle with it, along with my models and the new Irrlicht 1.8 release...
- - - -
"Destructavator" Dave: Developer of OS GPL VST "ScorchCrafter" Audio Plug-ins, contributer to UFO AI, Day Job: Guitar Luthier (Customize musical instruments, repainting w/ custom artwork, graphics, logos, decals, etc.)
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: yet another animation/mesh question

Post by CuteAlien »

Did you see the b3d exporter from tuxracer? http://supertuxkart.svn.sourceforge.net ... lender_25/
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Destructavator
Posts: 40
Joined: Sat Feb 06, 2010 9:00 pm
Location: Ohio, USA

Re: yet another animation/mesh question

Post by Destructavator »

CuteAlien wrote:Did you see the b3d exporter from tuxracer? http://supertuxkart.svn.sourceforge.net ... lender_25/
Yeah, that's another one I've tried (The internet has a number of them floating around), it doesn't export the animations from Blender 2.64 properly, although textures, meshes, etc., export fine (at least in my tests).

I've seen that it does work with Blender 2.63 though.

I could be wrong, but I think someone will have to update the Python code so the exporter works with 2.64 and beyond, or wait to see if another future version of Blender becomes compatible with that exporter again.

Until then, I did find that I could use the built-in DirectX (.x) exporter in 2.64 and get everything to load into Irrlicht 1.8 just fine.
- - - -
"Destructavator" Dave: Developer of OS GPL VST "ScorchCrafter" Audio Plug-ins, contributer to UFO AI, Day Job: Guitar Luthier (Customize musical instruments, repainting w/ custom artwork, graphics, logos, decals, etc.)
teto
Posts: 159
Joined: Thu Dec 03, 2009 9:37 pm
Location: /home
Contact:

Re: yet another animation/mesh question

Post by teto »

I think someone will have to roll up their sleeves and get into the Python code of the .b3d exporter to get animations to export properly. From my research, others are waiting for someone to do this but I haven't seen anyone post about doing it themselves.
I think that's what the guys from supertuxkart usually do, thought they might not be against some help from time to time
Using trunk with mingw/gcc 4.6, Windows 7 64 bits driver opengl
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Re: yet another animation/mesh question

Post by christianclavet »

I've been trying (for hours now) to get a b3d model loaded, shown and animated properly. The model has an animation between frames 0 and 45, it was made and painted (the whole kit) in blender as testing model. Only half of the model is shown, it's completely white and it doesn't move.
Hello, The first thing you should do is to load your model inside the Irrlicht model viewer to see how Irrlicht is interpreting it.

Looking at the picture there are 2 possibilities:
- Your mesh doesnt have the proper texture. (It MUST be a 2D Texture coming from a picture, if you used any other type of texture that Blender it will not work)
- The reference to the texture picture filename path is incorrect, you should try put the texture and mesh in the same path (check your exporter if you can do this)
..it tells me that it can't load texture from it.
Then check what is the path it's looking for...

For the animation, you added too much stuff in there.

Code: Select all

if(node)
        {
                node->setFrameLoop(0,45);
                node->setCurrentFrame(0.f);
                node->setAnimationSpeed(90.0f);
                node->setMaterialFlag(EMF_LIGHTING, false);
                node->setJointMode(EJUOR_CONTROL);
        }
        //make camera...
 
        while(device->run())
        {
                driver->beginScene(true,true,SColor(255,100,101,140));
               
                node->animateJoints();
 
                smgr->drawAll();
                guienv->drawAll();//gui
 
 
                driver->endScene();
        }
Try this:

Code: Select all

if(node)
        {
                node->setFrameLoop(0,45);
                node->setCurrentFrame(0.0f);
                node->setAnimationSpeed(90.0f);
                node->setLoopMode(true);
                node->setMaterialFlag(EMF_LIGHTING, false);
                //node->setJointMode(EJUOR_CONTROL);
        }
        //make camera...
 
        while(device->run())
        {
                driver->beginScene(true,true,SColor(255,100,101,140));
               
               // node->animateJoints();
 
                smgr->drawAll();
                guienv->drawAll();//gui
 
 
                driver->endScene();
        }
I've just commented our the JointControl (Used to manipulate bones directly by code), and added a loop mode, so you'll be able to see it moving of there is animation inside your model. Again, the easiest way to check this is the model viewer. IS your animation was created to be played back running at 90FPS?!
Post Reply