Sign in to follow this  

Blender export file with text

This topic is 1904 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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
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
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
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

This topic is 1904 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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