How much can Normal avergaing do for you? o)

Started by
25 comments, last by adder_noir 13 years, 9 months ago
I think I'm going to have to bow out now and live with it. Blender is acting odd and I'm too much of a noob to follow all this stuff tbh. Thanks for the help though everyone much appreciated.
Advertisement
Quote:Original post by adder_noir
They will show in blender but they won't export.


Blender *will* export per-vertex normals! I assume you've written your own python exporter? You want to do something like this:
normal1 = mesh.faces[this_face].v[0].nonormal2 = mesh.faces[this_face].v[1].nonormal3 = mesh.faces[this_face].v[2].no


Hi,

Oh I know all that realy I'm a noob :o) Thanks for the tip mate I'll try it out alright ;o) Voted you up too - as I do everyone.

**Edit**

One thing mate, can I use that code for an iteration of kind:

out.write( 'Normals:\n' )	for face in mesh.faces:       		normal1 = face.v[0].no       		normal2 = face.v[1].no       		normal3 = face.v[2].no       		out.write ('%f,%f,%f#\n' % (normal1.x,normal1.y,normal1.z) )		out.write ('%f,%f,%f#\n' % (normal2.x,normal2.y,normal2.z) )		out.write ('%f,%f,%f#\n' % (normal3.x,normal3.y,normal3.z)


This actually ran fine. Nice one thanks. All I need now is to work out how to get Blender to export seperate vertices per face and I'll be away.

[Edited by - adder_noir on July 22, 2010 1:25:35 AM]
Quote:Original post by adder_noir
All I need now is to work out how to get Blender to export seperate vertices per face and I'll be away.


You can get the vertex positions like so:
p1 = mesh.faces[this_face].v[0].cop2 = mesh.faces[this_face].v[1].cop3 = mesh.faces[this_face].v[2].co


See the Blender python API reference for more info.
Well I really don't know what to say. Using a much rougher version of your very nice above code I still managed to get this to work. I will for sure include your latest stuf into my export script thank you so much this pic below would not have happened without the code you posted above. I don't know if there are words to describe how proud I feel about this. It's one of the greatest things I've ever done. Last night I was swearing off code for life, tearing up text books and so on. Now finally it's here. I have it, and thanks to you I have an even easier way to implement it now:

http://img19.imageshack.us/img19/6383/normalpiccopy.jpg

Thanks so much this has truly made my day. Simple though it may look, bugger me if it isn't a normal averaged cube just as it looked in blender. Thanks so much mate ;)
http://img46.imageshack.us/img46/9451/normalpic2copy.jpg
http://img683.imageshack.us/img683/8617/gamepic2.jpg

Flying away now boyo ;o) This is big stuff for me atm ;o)

This topic is closed to new replies.

Advertisement