GSoC 2017 - Normal Editing Tools

Hi everyone!
As you may already know, I’m Rohan and I have been accepted to work on Normal Editing tools in this years GSoC.

I’m looking forward to work with all of you to help me make Normal Editing a user friendly experience. I’ve already implemented the base of my proposal and you can view all of my functionality goals here:

You can pull my git branch to try any of the features I will implement:
Feel free to ask any question regarding my project or regarding how custom loop normals are stored and manipulated.
I’ll be updating this post to show what I’m currently working on and what is already implemented. So far, I’ve coded a base on which my project will be based on along with native normal rotation support in blender.

Normal Rotation
Right now, to rotate normals you just need auto smooth to be active, Press R to initiate rotation and then press N to initiate normal rotation. Works in the exact same way as standard rotation.
I’m thinking on working on a way to rotate a custom normal (single loop not for whole vertex) but have yet to figure out the workflow, as currently rotation occurs by vertex selection.

In GSoC, we submit our weekly reports each friday. So be sure to checkout my user page on the wiki to stay updated.
I’d suggest anyone to join the soc-2017 mailing list if you haven’t yet. I’ll be submitting period updates to the list as well.
Link to the mailing list:

If you find any bugs please report it on my branch or send me a message.
Looking forward for some good feedback! :slight_smile:

Thank you,
Rohan Rathi

1 Like

Yes! we totally need a good normals editor. Especially for splitting edges.

Thank you for working on this. I’m looking forward to this.

really hopeful about this project

Great I really hope this project will succeed we need this badly :slight_smile: Thanks for developing this feature for blender.

I have talked about custom normals sometimes and like other times I will told my experience making game assets with Blender and the tools that I think that we need.

Keep custom normals. Some tools like mirror don’t keep the custom normals and the user loses all work. YAVNE is a great addon and a great way to work, with different weights in the faces by user decision and that weights are keeped after edit the mesh, this idea is PERFECT. Not all data is keeped, but you can reuse the 90%. This point is essential in the workflow because in other software you lose all your work when you touch the mesh and you need to redo all the work all the fucking time. In video games is normal to have feedback, problems… And you maybe need to edit the same mesh a lot of times. In Blender right now happens the same thing but like I told thanks to YAVNE you can work without fear to waste your time. This point is really important, we need tools that keep custom normals or keep a data the allow us recompute normals, not only the way to edit normals, because we can to lose all the work in a moment. And like game artist is really great edit one time the custom normals, not ten times.

Sharpness detection inside weighter vertex normals. In other software like houdini when you use a weighted vertex normals they detect sharpness edges and split the vertex normals in that edges, normally with 66º. This is really usefull, a properly way to detect sharp edges and sharp edges makes by user hand. Actually you need to make this by hand, is not hard, but could be better.

Weighted vertex normals MODIFIER, this tool could be ground breaking in a normal workflow, have a modifier like this, with other addons like hardops will change everything in the way to make low and high poly models. It’s ok to have this tool in edit mode, but please, make a modifier. Will be great to have weighted normals after other modifiers (bevel, deformation, array, mirror, edge split, boolean, solidify,…).

Thanks for the feedback. I’ll see to preserving custom normals when the mesh geometry is edited, perhaps like an option. Although it is very compute heavy and not obviously feasible with major changes.
As far as weighted normals is concerned, I’ll have to discuss more on that. Right now, I’m more focused on the much more prior goals.

This is fantastic. I don’t care at all about realism, all my work is NPR. Normal editing is an important part of that, but it’s really hard to get good results in Blender at the moment. This could be really very useful. I’ll be looking forward to this a lot.

Mirroring, face normal flipping, and negative scaling are very tedious under the current paradigm. Like DcVertice has said, incorporating direction and feedback into a game model often requires a silly amount of reworking or tedious usage of vertex groups, reference models, data transfer modifiers, and separating/re-joining mesh objects.

Anything which can help us avoid redoing work would be greatly appreciated. Good luck with the project!

Maybe adding an option somewhere (in auto-smooth settings?) to calculate face weighted vertex normals instead of the default vertex normal average method would be useful. For a lot of hard surface game assets, simply applying face weighted normals is sufficient a lot of the time, so something like this would be awesome.

For more stylised work (custom normals for toon shading, for example), actually being able to edit individual normals is important. So some way of selecting, rotating and blending between them is necessary.

As DcVertice mentioned, it’s very easy to lose work done on custom normals, so a way to prevent them getting lots while working is also an important feature.

Good luck with your GSoC - I look forward to seeing (and hopefully using) the results!

Hi, and welcome to BA.

Do you think the project can also include having normal manipulation as a part of some of the edit mode tools and modifiers (particularly the bevel tool and bevel modifier)? Basically an optional parameter (saving time and steps).

I’ll work on preserving custom normals when I get time. I see its importance, but have to think about how to set and tie it up with the tools.
Face Weighted normals are inherently in my proposal and I’ll begin work on it next month.

I can work on adding normal editing to tools but depends on the what sort of manipulation you’re looking for.

RohanRathi: The normal editing manipulator could be a simple screen space tool that rotates the normal. A tool for splitting and merging normals across edges and vertices would be pretty neat too. No real idea of how much work this would be, but 2.8 is getting lots of new manipulators, so maybe Campbell would be able to help you with that kind of stuff?

How do you see Face-weighted normals working, in your mind?
Personally, I’d like to see it work the way Auto-smooth currently does, with the user entering a number, and Blender responding to any mesh edits in realtime. On top of that, you could allow the user to mark certain faces as being more or less important (as the addon y.a.v.n.e does), for cases where the algorithm doesn’t entirely create the desired result.

+1 especially about Modifiers not breaking custom normals and Weighted normals modifier(something that sits last in the stack). I did read it is in todo :slight_smile:

I recompiled blender with a little hack to Normals Modifier which allows keeping Shape flat and close to surface while compensating by multiplying a normal axis to bring back illusion of full shape. It’s extremely useful for baking. Something like that would be very welcome!

Note the flat profile of the object

Yup, my personal favorite GSoC of this year! Been waiting for blender to get good normal editing tools for years. :slight_smile:

As a guy wanting to make a cel shaded game in the near future, this can’t be any more timely. I wish you the best of luck getting this all implemented into blender! May the code be with you!

Is it possible to make array patterns on face (radial, linear, maybe gradient) with normal tools? For example (excuse my poor drawing) :


Mighty Pea
I’m thinking of adding face weighting just as Y.A.V.N.E does, of course user input weights can be added and I’m open for more input.

I haven’t touched any code related to modifiers, so I believe this task will be dealt with later in or outside GSoC, though this is a task I greatly look forward to tackling.

As far as keeping clnors is concerned, I did add the ability to keep custom loop normals the same during transform ops. It doesn’t work always on mirror (it has some weird interaction with loop normals). Needs more work, will fix it till next week or so. After this I’ll add this ability to non-mesh-breaking bmesh ops as well.

how can i set custom normals for verts with a python api?
for particle system i need vertex normals ajusted in a certain way.
directly set normals seems do nothing. split_custom_set can change face normals but not verts. modifier seems can change verts normals, but is there a way to do it from code?