Sign in to follow this  
Kurt-olsson

Blender export file with text

Recommended Posts

Kurt-olsson    254
How do you export information from blender to import in directx?

i guess i would need a list of all my triangles from the model like this:

count
x,y,z , normal, u, v , texture name
x,y,z , normal, u, v , texture name
x,y,z , normal, u, v , texture name
x,y,z , normal, u, v , texture name
x,y,z , normal, u, v , texture name
x,y,z , normal, u, v , texture name
x,y,z , normal, u, v , texture name
x,y,z , normal, u, v , texture name


which export format do you use when using blender?

i am using DirectX11 and i want to read the triangles so i have full control over them.

Share this post


Link to post
Share on other sites
Daaark    3553
Open the script editor in blender, and write out a python script that saves that information to a file.

http://www.blender.org/documentation/blender_python_api_2_63_21/ Edited by Daaark

Share this post


Link to post
Share on other sites
LevyDee    376
If you are trying to get a .x file, blender already comes with a directx script to export data in that format. If you are trying to create your own format, then yes, you must learn the blender python api to pull data out and format it however you like.

Share this post


Link to post
Share on other sites
Kurt-olsson    254
I think i will try to export a new format that is good for me.
However i am not sure how to map the correct texture with the specific triangle.

I guess i have to load all textures and then map the texture array position to the triangle in some way...

hm....

Share this post


Link to post
Share on other sites
Daaark    3553
Sort your faces by material, then write them out like that. Much easier when you go to render.

Material 1

x,y,z , normal, u, v
x,y,z , normal, u, v
x,y,z , normal, u, v

Material 2

x,y,z , normal, u, v
x,y,z , normal, u, v
x,y,z , normal, u, v

etc...

But it will work best if you can make your models only use 1 material.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this