Jump to content

Editing Vertex Normals in Blender


Rahkis Andel
 Share

You are about to reply to a thread that has been inactive for 3922 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

It looks like there is a lot of development going on in this subject and since it is so important to game asset creation I thought I'd record some of the more interesting developments here.

I feel like this thread holds an implementation that could already be of great use to a lot of us. I haven't used the addon yet, but I will be testing it soon to see what results I can get. I'd like to at least be able to upload the default avatar as a single peice without merging the vertices at the object boundaries and still get a smooth shading transition.

I know this is already possible for users of Avastar, but I the more options we have, the better.

It seems that for those of us who are creating trees, this could already be a nice addon -- that said, I haven't tested it yet, so I don't know what is possible or if Blender will recalc the normals upon export to collada or not.

Feel free to add any related news here as well.

 

  • Like 1
Link to comment
Share on other sites

Yeah it's a neat addon, and something blender (opposed to maya / 3DS) is still missing.
For certain cases one might want to edit the V-Normals directions instead of relying the general way they are being calculated based on the adjacent edges.

Eventho there have been a few things to manipulate them by enabling autosmooth and setting angles, or by marking as sharp, as well as the edge split.

But nothing compared to i.e. Maya where you can manipulate them one by one.

Problem with that addon is still as i have seen (i had it for older blender versions) that it breaks in rendermode and cycles etc. Which is rather a Blender internal issue, and might need to be fixed first hand, and possibly even the reason why they didn't include an own / or usermade plugin of that kind yet.

We'll see what the future brings : )

Link to comment
Share on other sites

Well, this issue can be separated into two parts:

 

  1. How to modify (edit) the normals in Blender
  2. How to export the mesh(es) with the modified normals

 

The good news first: Collada supports the vertex normals, so if your object "currently" has modified vertex normals then the collada exporters (Blender Default and Avastar) will also export them correctly (i just tested that it works).

The bad news for scripted solutions: The vertex normals are recalculated frequently by Blender, so the normals which a script has just created will no longer be available a few moments later. Furthermore there are some issues when meshes have shape keys and i believe it just does not at all work when meshes have modifiers. so a scripted solution does not work well. However this one does already some useful things and as i stated above what the tool does can be exported by the Collada exporter (i tested that one):

http://www.pasteall.org/40119/python

And more good news: Recently there was some work started about adding vertex normals editing into Blender. The first approach was very promising, see this work from felix:

http://blenderartists.org/forum/showthread.php?284736-Normals-Editing-in-Blender

The problem with this first approach was that it would not fit very well into blender's architecture, especially there was a few doubts about how vertex normals would be handled with a modifier stack in action.

Currently there is a second approach which is currently inspected for feasbility. This approach tries to make vertex normals flow nicely through the modifier stack. Think of how mirror modifier and subdivision modifiers need to take care of edited normals in the base mesh. Well, its not easy task and there are reasons why Blender has not yet vertex normals editing...

However there is a chance that Blender will be able to support vertex normals modification sometime in the near future, but surely not for Blender 2.67  In the meantime you can use the script i mentioned above, or occasionally check out what else i have to offer :matte-motes-sunglasses-1:

  • Like 2
Link to comment
Share on other sites

I am very positive they will implement it as soon as everything is in place, Gaia. =)

Thanks for the additional pointers and links

It's one of the things that keeps me often jump back and forth between programs, which would be nice when i could do those amongst the poly modeling workflow (and for that one i still prefer blender the most), and wouldn't need to switch at that point already.

About the modifier stacks, yeah i can imagine that this is a big part of the trouble to go through.



 

Link to comment
Share on other sites

@Codewarrior: I will try to avoid jumping on the "we should have had this years ago" train and just keep my fingers crossed!

@Gaia: Thanks for the info! Felix's video makes things look very promising, but it's disappointing that it only looks to be a video and nothing I can actually play with myself.

I'm just glad to see some progress being made. It would be nice to see a more final implementation, but for my uses at least, I only really care that I can export the results, which is possible! That itself is great news for us.

Link to comment
Share on other sites

Yes and yes. SL understands how to shade the mesh based on normal direction, just like any other render engine.

And as Gaia already tested, the normal direction is respected by the collada exporter and therefore will be understood by the importer as it appears in the .dae file.

Link to comment
Share on other sites

Hi, Nalates, i have shown that it works for Second Life in the last 30 seconds of my video about "The secret life of (vertex-) Normals (Smooth shading) " on YouTube

Really the only problem is currently how to keep Blender from recalculating the normals every here and then. That's why i added this feature to our own Collada exporter instead of trying to convince Blender to do what i want :)

 

Link to comment
Share on other sites

  • 2 weeks later...

I came across this problem again while trying to make some modular building pieces that would work better if they joined along a smooth surfaced pillar. After making some ugly attempts to make them join along available sharp edges, I then came up with the following workaround.

At the top here are three segments of a smooth-shaded pipe in Blender, with the parts joined (and doubles eliminated) on the left, and the parts as separate objects, on the right. On the right, you can see the seams that appear because the vertex normals don't match across the join. This seam is also there in SL (bottom left). This is made from the two parts on the left in the middle row.

In the middle, the two parts on the left were joined, doubles removed, duplicated, and separated again with just the immediately adjacent faces of the other part. The extra faces were given a new texture with a distinctive name ("edgy"), which is shown in green. These two objects were exported, Then the <polylist> section containing the new material was found by searching for the material name and deleted, as shown in the inset. The resultant files contain anly the original geometry without the extra faces, but the vertex normals along their edges are those resulting from nthe smooth shading across the junction of the materials instead of simply copies of the face normals. When they are joined in SL, the seam is no lonmger visible (bottom right.).

Note that this doesn't use up an extra material. In fact if you have 8 materials already, the ninth will be removed by the uploader and you don't need to edit the collada file. This seems to be simple and effective, It could be even simpler if the Blender exported allowed you to specify a material to omit. (Any chance of that Gaia?).

vertnormsfix.jpg

Link to comment
Share on other sites

Hi, Drongle;

I do not understand why you need such a complicated workflow to create welded normals for adjacent objects. Unless i have overlooked something.

You can use the addon i mentioned near the beginning of this thread: http://www.pasteall.org/40119/python This program allows you to weld normals of adjacent objects (as long as they do not use any modifier or shape keys). If you export immediately after you have applied the addon, then you can get perfect vertex normal welding for your adjacent parts.

We have meanwhile added automatic welding of adjacent parts to the Avastar Collada exporter (as per default settings). It works also when shape keys and modifiers are involved. Here is a funny demo showing a mask with a scripted lip morph:

The intersting part starts at about 1:15 in the video.

About the idea to ommit materials from export: I am not sure if that is a good idea. Wouldn't that make more trouble than it helps ?

Link to comment
Share on other sites

It was just to note that it's quite easy without any extras. I saw it as rather simple, not complicated at all. Besides, I thought you had implied that there were problems with the addon, and didn't get it for that reason. Maybe I misunderstood that. As for Avastar, as usual, there are always people who can't or don't want to use commercial products. I won't argue that optional material exclusion is worth the effort of incorporating it in the exporter. Doing it manually is already too easy. I don't see why you see it causing trouble though, unless you mean by lack of sense and/or knowlege from users, but then the whole of Blender is risky in that way.

 

Link to comment
Share on other sites


Drongle McMahon wrote:

Besides, I thought you had implied that there were problems with the addon, and didn't get it for that reason. Maybe I misunderstood that.

The only issue with that addon is that it does something that is not really supported by blender, so it behaves a bit weird. But as long as you know what you do and use it with care (only on simple meshes and only just before exporting) it can be used without problems.


Drongle McMahon wrote:

I won't argue that optional material exclusion is worth the effort of incorporating it in the exporter. Doing it manually is already too easy. I don't see why you see it causing trouble though, unless you mean by lack of sense and/or knowlege from users, but then the whole of Blender is risky in that way.

Nono, i just expressed my uncertainty about such an option. Is it useful in a more general view ? What would be good examples where this option makes sense in the exporter ?

Well, you are right, indeed Blender is a risky tool. But shouldn't we try to make it less risky instead of more wonky ? :matte-motes-wink:  (just thinking loud)

Link to comment
Share on other sites

  • 4 months later...

Drongle, I love you! :D

 I was trying to figure for a while how to solve this issue, and was actually thinking about leaving the extra face loop, just like as the first part of your method, either set invisible or with flipped normals, but the idea of including lot of extra, useless triangles just to get rid of those nasty hard seams made me frown... I was thinking about checking what I find in the Collada file, hoping for some structured data like XML, but your solution of simply giving it a mat with distinctive name and using that to easily find and remove it from the Collada is just brilliantly simple and effective.

 Actually, I could write a simple program that strips it automatically from the Collada.

 

P.s.: I tried to use the script Gaia linked but it simply never shows up in Blender, no matter what. Even though I both placed it manually to the proper folder, and tried using the Install button, it never shows up in the addon list so I'm unable to use it. :(

Link to comment
Share on other sites


Storm Engineer wrote:

 

P.s.: I tried to use the script Gaia linked but it simply never shows up in Blender, no matter what. Even though I both placed it manually to the proper folder, and tried using the Install button, it never shows up in the addon list so I'm unable to use it.
:(

As far as i recall there is no button on the user interface. After installing and enabling the addon:

 

  • Go to object mode
  • select 2 mesh objects
  • SPACE -> "transfer vertex normals"

However i made a quick check on the current development version of blender and there it seems to no longer work as intended :matte-motes-angry: But as far as i know there is activity in this area. So it may be possible that we get the vertex normals editor soon into Blender (no promise, just rumours)

Link to comment
Share on other sites

Yes, I couldn't enable it because it didn't show up in the list of addons.

I really hope those rumors turn out to be true, because the normal manipulation is simply a vital feature if you want to do professional quality work. And even though many say that Blender is never meant to be professional software, I think it is more than capable of it in the right hands.

Until that, I'm just using the extra material method described above. It really isn't that much extra work.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3922 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...