I want to add the functionality of editing vertex normals to Blender. Before I tackle this my way or the highway, I would like to find out what features the community would want to see from such development?
Personally, I would like the following:
- Manually edit vertex normals using the rotate tool (DONE)
- Transferring normals from one mesh onto another (projecting)
- Differentiating between user-edited and calculated normals (DONE)
- Keep using edge-split modifier to make hard edges (DONE)
- Misc complimentary features, e.g. "Set to face"
I already put a bit of thought into each of those points,
1. Manually editing normals
Requirements:
- Operate on single Vertex (DONE)
- Operate on multiple Vertices (DONE)
How to do it:
Here some pseudo-code to convey the idea,
If only one vertex is selected:if normal for vertex is locked and if pivot_point is set to active element or individual origins:
Rotate vertex’s normal
else If several vertices are selected:if pivot point is set to “individual origins”:
Rotate each vertex’s normal
2. Projecting normals
Requirements:
- Project from one or more meshes onto a single mesh (Object mode, Meshes only)
3. Hard Edges (DONE)Hard edges will handled as they are handled now. It enforces people to understand that a hard edge implies 2 vertices, even if most other 3D software (that I have used) abstracts this away.
Requirements:
- Match Derived Mesh normal calculation, to preserve locked normals after modifiers
4. Differentiation between user-edited and calculated normals
The user should have the option of having his normals re-calculated or not. I already started coding and added a "normal lock", so the normals stay put no matter what you do (on a per vertex basis) . While this works in most trivial cases, a bit more sophisticated solution should be thought of. E.g. when selecting a set of faces and rotating it, the normals should probably rotate along, even if locked - or maybe a switch for this behaviour? One way I can think of is to not store the absolute vector of the normal, but rather an offset - this however implies that when you mess neighbouring edges, the normals do not stay put completely. (SOLVED: When rotating vertices, faces etc. the normals now rotate along)
Bookmarks