Bevel harden normals modifier, tool, and Python op all have bugs #58113

Closed
opened 2018-11-28 15:15:46 +01:00 by Howard Trickey · 5 comments
Member

System Information
Linux

Blender Version
Broken: 2.8, edbf15

Short description of error
Two separate bugs, each of which should be solved by refactoring and fixing the harden normal code in bevel.

  1. the Modifier has two problems:
    (a) one face (the last?) does not get hardened normals
    (b) the other other faces get normals that are totally aligned with the face normals, not the area-weighted normals that the spec specifies. And it pays no attention to Normal Strength. The behavior should be the same as the behavior with the Tool. (And, it is not clear that the tool is doing the proper area weighting either - need to check.)

  2. if you run the bmesh.ops.bevel operator from Python, it does not do anything to harden normals, if that is what the arguments specify.

Exact steps for others to reproduce the error

  1. With default startup file, enable Auto Smooth in the mesh properties. Then add a bevel modifier and change the Normal Mode to Face Area. If you use a shiny matcap, and/or enable vertex per-face normals in Overlay, you can see that the face with index 5 gets normals that are the original vertex normals, rather than the expected hardened normals that the other faces get. The other faces get normals that align exactly with the cube faces, not a face-area-weighted average.

  2. With default startup file, enable Auto Smooth in the mesh properties. The run this in the python console:

import bmesh
bpy.ops.object.mode_set(mode="EDIT")
bm = bmesh.from_edit_mesh(C.object.data)
geom = bm.edges[:]
bmesh.ops.bevel(bm,

                  geom=geom,
                  offset=0.1,
                  offset_type='OFFSET',
                  segments=1, 
                  profile=0.5,
                  vertex_only=False,
                  clamp_overlap=False,
                  material=-1,
                  hnmode='FACE',
                  strength=1.0)

bmesh.update_edit_mesh(C.object.data)

and notice that the per-face vertex normals remain split and are not all aligned (mostly) with the big faces.

**System Information** Linux **Blender Version** Broken: 2.8, edbf15 **Short description of error** Two separate bugs, each of which should be solved by refactoring and fixing the harden normal code in bevel. 1) the Modifier has two problems: (a) one face (the last?) does not get hardened normals (b) the other other faces get normals that are totally aligned with the face normals, not the area-weighted normals that the spec specifies. And it pays no attention to Normal Strength. The behavior should be the same as the behavior with the Tool. (And, it is not clear that the tool is doing the proper area weighting either - need to check.) 2) if you run the bmesh.ops.bevel operator from Python, it does not do anything to harden normals, if that is what the arguments specify. **Exact steps for others to reproduce the error** 1) With default startup file, enable Auto Smooth in the mesh properties. Then add a bevel modifier and change the Normal Mode to Face Area. If you use a shiny matcap, and/or enable vertex per-face normals in Overlay, you can see that the face with index 5 gets normals that are the original vertex normals, rather than the expected hardened normals that the other faces get. The other faces get normals that align exactly with the cube faces, not a face-area-weighted average. 2) With default startup file, enable Auto Smooth in the mesh properties. The run this in the python console: import bmesh bpy.ops.object.mode_set(mode="EDIT") bm = bmesh.from_edit_mesh(C.object.data) geom = bm.edges[:] bmesh.ops.bevel(bm, ``` geom=geom, offset=0.1, offset_type='OFFSET', segments=1, profile=0.5, vertex_only=False, clamp_overlap=False, material=-1, hnmode='FACE', strength=1.0) ``` bmesh.update_edit_mesh(C.object.data) and notice that the per-face vertex normals remain split and are not all aligned (mostly) with the big faces.
Author
Member

Added subscriber: @howardt

Added subscriber: @howardt
Howard Trickey self-assigned this 2018-11-28 15:18:00 +01:00
Author
Member

The proper thing to do is to share the normal hardening code by putting it in BM_mesh_bevel(), rather than the current strange mix of having some of the work done in that function but most of it done (separately implemented) in the modifier and in the editmesh code that runs after the BMOp bevel runs.

The proper thing to do is to share the normal hardening code by putting it in BM_mesh_bevel(), rather than the current strange mix of having some of the work done in that function but most of it done (separately implemented) in the modifier and in the editmesh code that runs after the BMOp bevel runs.
Author
Member

The main bug (#1) is fixed now, but still have to fix the problem where the bevel operator run from Python cannot harden normals,

The main bug (#1) is fixed now, but still have to fix the problem where the bevel operator run from Python cannot harden normals,

This issue was referenced by aef01c47e6

This issue was referenced by aef01c47e6334b214520f14c72b01de99387f122
Author
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#58113
No description provided.