'smoothing' normals in Blender?

I wrote this in another post:

Can you guys tell me if/how this can be done? Looks like a dead end.

Can’t you use the egg-trans program included in Panda?

egg-trans -nv 30 file.egg

I think that would average adjacent vertices’ normals when the angle of the corresponding planes is lower than 30.

But I guess maybe I’m misundertanding your problem cause otherwise you would have been told this already. But your pic should looks like the kind of situation where egg-trans -nv helps.

EDIT: Ah, I see, they are different files, I get it now. I thought you had pasted them inside your modeling program. OK, then I’ll answer in another post.

You will need to write a script for Blender that does the following:

  • Get the normal of each selected vertex.
  • Average those normals.
  • Apply the averaged normal back to the selected verts.

Then select a matching pair of verts (one on the face, one on the body) and run the script, and repeat for each vertex along the seam.
You could spiff up the script by allowing it to compare many selected verts and average the normals of those that sit in the same point in space.

It’s been a long time since I’ve used Blender, this functionality might even be built in. It would be called something like smooth/average verts/normals/mesh.

The problem you will run into next, though, is that now the normals for ONE face will match the body, but unless the geometry of all the faces are the same at the connection point (for example if you have an elongated face), this method will not work perfectly.

I suggest applying a fading transparency to the edges of the faces that will blend it into the head and not worry about the normals at all.

OK, so if you have the face and the body in different egg files, egg-trans isn’t gonna help you.

But you could flatten the two models into one once inside panda (I think you can do this, I’ve never had to do it myself). Now let’s assume that the flattening process identifies redundant vertices.

Then you would access the geometry data and modify it as explained in:

panda3d.org/manual/index.php … metry_data

And then for every vertex recalculate the normal yourself, you can google the algorithm, it’s pretty simple.

Now although this is what I would do, it is maybe too complicated so drwr’s solution is still the best. Fix it inside your modelling program, any good modelling program should give you control over normals. Do you understand the nature of the problem you are having? If not ask.

Or probably somebody has a better answer.

I dont know Blender API. Don’t tell me Blender doesnt support such a basic thing.

Uh, what? And how would that fix the shading?

Even if it does remove doubles, it will be VERY inefficient for my purpose.
Think of my case: you have a ‘create your avatar’ screen. You have about 10 parts that can be changed. Now, when you choose your 10 shapes and flatten it… what will happen if th the user changes on of the pieces? The geom would need to be removed, 9 parts reloaded + the new 1 part and flattened again. Each single time you change one of the 1 pieces.

If I was gonna need to write a script to recalculate normals (this might also be slow for Python) then why would I need to remove doubles?

Yeah, but I can’t find anything in Blender. I think you guys use Maya.
Anyone using Blender here?

Ok, out of curiosity I just tried drwr’s original suggestion (As you pasted into the first post of this thread.) of smoothing the normals then deleting the geometry that is not wanted in Blender 2.49 and it worked - normals were not recalculated and should hence be exported with the values as required.

Are you sure that you understand what we are all saying? You have to start from the original mesh and delete what you do not want, and apply the smoothing before duplicating to create the face. Also you must use the smooth normals button - the smoothing modifier will not work. Additionally, are you sure your two meshes have the same material applied? It just doesn’t look like they do in your screenshots.

It would hide the shading seam caused by mismatched normals, thereby removing the need to fix it.
Also I agree with lethe, it looks like the face is coloured white, while the body is grey.

But how would you do that?

Thats what i asked: how do you ‘smooth’ normals in Blender?

Both parts dont have material in the demo file. I know, it looks like white.

Apply a texture that has alpha transparency at the edges to the face (or use vertex colour alpha).
Model the face geometry so it sits nicely on the head with a bit of overlap so the hole is not visible.
The end result should be a nice smooth transition.
I’ll do my best ASCII art just for you. :slight_smile:

                  /             \
                //               \   <-- head geo
               //                 \
              /                    |
              |                    |
face geo -->  |                    |
              |                    |
              \                    |
   opaque -->  \\                 /
 50% alpha -->  \\               /
transparent -->   \_____________/

Hopefully that is legible.

Have you tried that? I think you’ll still notice that the shades on the pieces are different, probably even more for lowpoly models. it might fix the tiny holes, though.
Anyway, its not a good idea, UVing 100 pieces. And its a hacky way of solving the problem.

I’ll just go with the smoothing normals technique, if I find how to do it in Blender.

Its just the set smooth button on the editing tab. I would observe that your models are already smooth - the key point is that the smoothing depends on the geometry at the time of the smoothing, hence you must smooth and then cut out the various parts. I’ld do some experiments to determine what you can and can’t get away with!



I would simply replace parts of models on seams. Or in other words: make the edge between models where nobody sees it or where it doesn’t matter.

In the case of such a small character, why don’t you replace the whole model? you could have three same models with a different face each.

That button. I wonder what Im doing wrong. Rereading.

Do you honestly think I didnt think of that? :laughing:
Its impossible, to allow people to load their own heads or own faces you cant put the intersection lines in a place where “no one can see it”.

I said this is a demo model to demonstrate my problem.
And I also mentioned there can be around 10 parts which can be changed, have 10 versions for each part and how much you get? Too much, isn’t it? Not to mention I’ll have to load a whole new model in the chracer creation screen each time the player changes a body part.
And if it wasn’t very slow, this is still impossible since the players can place their own made models (body parts) in the ‘model’ folder and use them in the game.

lethe, I think I dont quite understand what youre saying.

So I,

  1. take the whole mesh
  2. click on the solid button (since its already smoothed.)
  3. click the smooth button
  4. select the body faces an delete them, leaving the head faces only

Is this it? Because if you have vertex normals visible and do like this, you can clearly see that the normals change their direction after you delete the faces.

Yeah - that is it precisely, though I’ve done it with the vertex normals visible and they do not appear to change for me. There must be something different between our setups, though I can’t think what - I just loaded up 2.49b, subdivided the cube a bit and went from there.

can you show me your blend file?

Hmmm, just tried the same trick, and your right, there is a difference - I had previously only watched the normals and they do not appear to change. Guess your going to have to try other tricks - sorry - it looked like it worked when I tested it.

Saying that you have sub-surfaced your geometry, which forces a recalcaulation - you must work on the final mesh. Whilst I got a change it was very slight, and I could only see if by taking two screenshots and applying a difference operator in the gimp. Honestly with a high res mesh and a normal map you probably wouldn’t notice.

Honestly my meshes arent hi res and don’t have normal maps.

So lets just face it: Blender lacks this feature.