Model format that links textures by itself.

Post your questions, suggestions and experiences regarding to Image manipulation, 3d modeling and level editing for the Irrlicht engine here.
Post Reply
Repgahroll
Posts: 88
Joined: Tue Jul 29, 2008 11:48 am

Model format that links textures by itself.

Post by Repgahroll »

Hello there.

I have a model made in Blendar exported to b3d along with a png texture, to load the model in irrlicht is very simple, the only annoying thing is that i have to load the texture separately (setMaterialTexture...->getTexture)... Is there a way to make the model file handle the textures? Because in the b3d files theres a line referring to the texture "untitled.png".

It will be very very annoying if i have to link every texture manually in the code :(.

Thanks in advance.
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Re: Model format that links textures by itself.

Post by Virion »

Repgahroll wrote:Hello there.

I have a model made in Blendar exported to b3d along with a png texture, to load the model in irrlicht is very simple, the only annoying thing is that i have to load the texture separately (setMaterialTexture...->getTexture)... Is there a way to make the model file handle the textures? Because in the b3d files theres a line referring to the texture "untitled.png".

It will be very very annoying if i have to link every texture manually in the code :(.

Thanks in advance.
hmm. all my models (made in blender and exported into .b3d) can load the textures by itself. when you export did you open the image in UV window?
Repgahroll
Posts: 88
Joined: Tue Jul 29, 2008 11:48 am

Re: Model format that links textures by itself.

Post by Repgahroll »

Virion wrote: hmm. all my models (made in blender and exported into .b3d) can load the textures by itself. when you export did you open the image in UV window?
For sure! :)

I was doing everything in Blender and the textures was packed inside blend files then i was exporting as png but the link breaks because the packed textures has no extension by default, so the right address is "Untitled" (for example) and not Untitled.png :D.

The easy fix in this case is to delete the texture extension or add the extension while saving the textures into blend files.

The best thing by the way is to work with external texture files, so such problems are avoided and it's much easier to organize and edit the files, and both the blender model and the ready to use b3d model loads the same texture. I'm used to pack everything inside blend files :).

Thank you very much!
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

I wrote a tutorial for this http://zhieng.com/tutorials/b3d_texture.html
I'm not sure about the exact way to do this but at least this one works for me. I hope it could help other people as well.
Repgahroll
Posts: 88
Joined: Tue Jul 29, 2008 11:48 am

Post by Repgahroll »

By the way... two features that the b3d format doesn't have and would very useful:

-two-sided normals
(i have to duplicate the normals in blender and flip the twins)

-search textures in other directories
(for example, to have a structure like 'data/models' and 'data/textures')


EDIT: Useful tutorial, just a little bit too late :D
Repgahroll
Posts: 88
Joined: Tue Jul 29, 2008 11:48 am

Post by Repgahroll »

I was looking your blog...

Man! look these nice textures:

Image

Image

Man! Seriously, i can't wait to see other stuff like cars etc. In low-poly models, good textures are everything :D

Sorry to steal bandwith from your site :).
Virion
Competition winner
Posts: 2148
Joined: Mon Dec 18, 2006 5:04 am

Post by Virion »

Repgahroll wrote:I was looking your blog...

Man! look these nice textures:

Image

Image

Man! Seriously, i can't wait to see other stuff like cars etc. In low-poly models, good textures are everything :D

Sorry to steal bandwith from your site :).
it's (going to be) my portfolio page, but atm I'm still preparing some more artworks and tutorials before opening the page.

blog.zhieng.com is my blog 8)

thanks.
Post Reply