Made a B3D Loader

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

put the b3d exported file in the account of gmail, julius, I'll look at it, as I have other b3d viewers. Also the blende file.

i have an strong suspect is in how you linked the bitmap files, I hope you also did put the bitmap files together with the b3d, as they dont get embedded. Also, could be an absolute/relative path prob matter.

but first to be checked is how u asign materials and textures in blender...I'll look at the gmail
Finally making games again!
http://www.konekogames.com
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

probelm with exporter

Post by juliusctw »

ok,
its in the gmail drive


this is all i did in the code

IAnimatedMesh* mesh = smgr->getMesh("girl.b3d");
AnimatedMeshSceneNode* node = smgr->addAnimatedMeshSceneNode( mesh );

i didn't specifically set material texture since i figured that it should automatically load, but it didn't , when its loading , it says that it

Loaded mesh: girl.b3d

but it never mention loading the material , when i export it , it also never export the material with it. :?

edit: my mesh has 4 separate materials (head, hair, body, leg) does that matter?
also , if the textures are supposed to be automatically applied, do you have commands that could change them?
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

seen

is not the loader, is artist's fault ;)

I'll tell u more later
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

ok

you need to:

be at face mode

click on one of the faces of the area u wanna set a texture to(ie, legs)

"select/same uv"

it gets the whole uv chunk (per texture) as you did it in maya.(legs stuff)

in "outliner" window select the material to which you decide will have tha legs texture

set "setFace" marked at each material (you hadnt them so)

"add New" texture in material buttons.Go to "texture" panel, click the button to browse yor hd for your texture (this whole tut is on the buttons panel, except select same uv, from menu bar of 3d Window)


in "map input" , at material settings , put "UV" button checked.

This way you fill each of your materials with each texture.

Then it works ok here just leaving selected or selecting the chunk desired, hit tab, and then , ctrl tab to get in faces... then "asign"...just ensure material in F5 (the ball icon) is actually showing in thepanel the image texture you want, meaning it's the right material.

Well, funny thing...in render it works ok (and in viewport, texture mode, would have been enough with my video tut of the other day of face mode (not tab/face as said just above) , select one of the faces, "select" "same uv", and then "replace" at uv window, choosing the right image.)

but...It doesnt work once exported. It asigns all UVs to just one material, surely the first asigned or somethin.

Probably is not supporting...several material indices?

Anyway, I know that luke did not have a prob as my worm and other models where just of one material.

maybe there's a forced way to do it inside blender.

I tend to use well the texture uv space pixels, and use only one texture, reason why I had yet not played with game export formats and severla material indices...

Anyway, am looking at it now to find an artist/side trick ;)

Both ultimate unwrap and your viewer and showing the "one material to rule them all" issue...
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

yup, am interested in the plugin, too ;)
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

sorry

I went unclear: it does support several material indices:

it is exporting perfectly the 4 materials, each with its texture asigned!


What it is not taking is...the asignment of each bunch UV coords to each material index(each one has the correct texture, tho...a fixe to the link of Uvs to each material index, and all fixed) as the artist does.

That's it.

BTW,julius, both ultimate Unwrap and the viewer are getting messed with the weights or better said, bones at feet and some other place: the skeleton was constructed in a too much broken way, or the constraints are unsupported if animation is not baked...But as is based on der ton's(he used pose module to carry constraints I think), probably this is not the case.A test that can be done is just bake the animation in the action editor and checks if it fixes it.
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

indeedy, it surely support several materials each with one texture, to several objects....question here is if it supports several materials pointing each one to a selection of uv faces of a single object...Blender can carry with it, but in the export, seems it's asigned to one of them only
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

looking at the python code, seems it grabs from materials not uv window (surely better in the long run)

...but I'm no coder, so I am not being able to guess accurately what it means in the Ui...
Finally making games again!
http://www.konekogames.com
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

I’ll thinking this maybe a bug in the exporter (the several materials not working on a singe mesh thing), sorry I haven’t had a chance to look at it yet, tomorrow afternoon I might have sometime.
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

Dont worry, as you can and if you can, in case you feel in the mood. It is a gift :) ...As is, is such a jewel for many b3d users that actually like blender. many of several game engines (not only blitz3d, blitzmax or irrlicht..several more) have been really eager to get something like this. I my self would have mor ethan enough: I can build it all in a single 1024 texture, and theweapon is a different object, so wouldnt be a prob.

I mention only if u wanna polish a last detail :)
Finally making games again!
http://www.konekogames.com
juliusctw
Posts: 392
Joined: Fri Apr 21, 2006 6:56 am
Contact:

hey vermeer

Post by juliusctw »

hey Vermeer,
:D I'm a little confused by your instructions :oops: :oops: :oops:
especially with the part of "setFace" , i can't find it under outline or anywhere else. :?


here's a video showing what i did, i probably didn't get something
you'd have to download it first or it would be too small.
http://juliusctw.multiply.com/video/item/2


would you be so kind to do a short video of your self doing it . :D

I also don't know what "baking" an action means :oops:

Once I learn it, i think it would be a good idea if I teach a short video tutorial of exporting it correctly for other people wanting to use this wonderful b3d exporter.


@luke
hey as a check, when you export "correctly" is it suppose to export all the textures that comes with it to your destined folder??? Cus currently nothing is being exported. :D

does the exporter export material that i create inside blender , for example, if i just set a cube to blue, and maybe add some blender texture such as noise and try to export the object, would the color and texture be exported???
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Re: hey vermeer

Post by vermeer »

I'm going out to work, but i'll explain u all some hours later...


noise textures in blender, if u speak about procedural textures, thpse arent exported with game formats, unles u use texture baker to bake em into an standard uv texture. bake a texture is different from baking an action, dont get messed with the word

baking an action is like freezing stuff, converting to keyframes, I'll tell u later
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

julius

- there are 3 usual concepts about giving color to an object :

* material color. You can do this in any usual software. But is just a plain color.

* vertex colors. Each vertex takes a color and there's blending among them. Only useful in some cases and extra light or effects.
A detailed textured with needs to be to much hipoly.

* uv textures.
Inthis exporter as in many others, procedure more problem free is: have you blend file, your textures, your b3d, in SAME folder. :)
It's you the want to carry th etextures, in your windows or linux. In the case you are using same folder, just leave em there, and if port to gaem folder, care on b3d file and texture be in same folder. I dunno if the exporter supports paths, relative or not, for th etextures.
The textures are not embeded, just are files apart.

A procedural texture is a nice thing, to make noise materials, etc, but many blender users think u can just export that as an uv texture...and no...you need at least first to bake the procedural with a script called texture baker.

Setface is a thingie that allows to setthe texture u set in the uv image editor as the asigned texture to that material.

Bake an action is unrelated to texturing. The model shows some probs once exported: maybe due to bad bones, bad weights, bad connections, or simply the exporter would need to bake constraints. A constraint is a helper, for animate easierly. Md5 exporter can just bake that itself, or handle it in some way, taking th eipos, or something. As far as I remember, Luke took a good deal of it. So, probably, is related to some prob in the model of weights or armature , on how u built it.

Anyway. I'll do a vid,yep.
Finally making games again!
http://www.konekogames.com
vermeer
Posts: 2017
Joined: Wed Jan 21, 2004 3:22 pm
Contact:

Post by vermeer »

Finally making games again!
http://www.konekogames.com
Luke
Admin
Posts: 449
Joined: Fri Jul 14, 2006 7:55 am
Location: Australia
Contact:

Post by Luke »

Hi,

I stopped being lazy for an hour, and did some work of the b3d exporter, it’s in the Gmail account.

Several materials and textures now work on a singe mesh. Textures on a face overwrite the material on the face.

I fixed a bug where you export a mesh the second time with the same exporter window open it would write a corrupt mesh :o


The exported meshes are all looking pretty good… in blitz3d. There is still that problem with juliusctw’s mesh’s hands going weird when animating, but strangely it does not happen in blitz3d, maybe because on the 4 bones per vertex limit or maybe there are some extra checks on the mesh blitz3d is doing.

Let me know if you find anymore problems.
Post Reply