Geometry Nodes: Expose sharp edge status with builtin nodes #112029

Merged
Hans Goudey merged 5 commits from HooglyBoogly/blender:geometry-nodes-face-edge-smooth into main 2023-09-06 17:12:34 +02:00
Member

Change the existing "Is Shade Smooth" node to be named "Is Face Smooth"
and add a new "Is Edge Smooth" node. Also give the "Set Shade Smooth"
node the ability to set face or edge smoothness.

The fact that the nodes process "smooth" data reversed from the builtin
"sharp" attributes can be reversed with versioning in a separate commit.

While it's tempting to abstract the sharpness status into a single node,
face and edge smoothness are accessed separately in edit mode, and the
subtlety of interacting with data on different domains would make that
confusing. Instead, a separate "Is Shade Smooth" node group asset will
give all the sharp elements taking into account both builtin attributes.

The fact that sharpness is stored separately on two domains makes the
best design for simple operations non-obvious. For example, you should be
able to remove all sharpness or make everything flat with a single node.
The behavior depends on whether the two attributes exist and the
combination of values between the domains.


image

image

Change the existing "Is Shade Smooth" node to be named "Is Face Smooth" and add a new "Is Edge Smooth" node. Also give the "Set Shade Smooth" node the ability to set face or edge smoothness. The fact that the nodes process "smooth" data reversed from the builtin "sharp" attributes can be reversed with versioning in a separate commit. While it's tempting to abstract the sharpness status into a single node, face and edge smoothness are accessed separately in edit mode, and the subtlety of interacting with data on different domains would make that confusing. Instead, a separate "Is Shade Smooth" node group asset will give all the sharp elements taking into account both builtin attributes. The fact that sharpness is stored separately on two domains makes the best design for simple operations non-obvious. For example, you should be able to remove all sharpness or make everything flat with a single node. The behavior depends on whether the two attributes exist and the combination of values between the domains. --- ![image](/attachments/c3f053c4-2b0f-44ac-9227-62071065fe56) ![image](/attachments/fd489fb3-314b-42ff-a5a9-e79578cbdfe7)
Hans Goudey added 1 commit 2023-09-06 14:33:09 +02:00
87cdfcac61 Geometry Nodes: Expose sharp edge status with builtin nodes
Change the existing "Is Shade Smooth" node to be named "Is Face Smooth"
and add a new "Is Edge Smooth" node. Also give the "Set Shade Smooth"
node the ability to set face smoothness, edge smoothness, or both.

The face that sharpness is stored separately on two domains makes the
best design for simple operations non-obvious. Fr example, you should be
able to remove all sharpness or make everything flat with a single node.
The behavior depends on whether the two attributes exist and the
combination of values between the domains. That leads to the mode
toggle on the "Set Shade Smooth" node, which gives complete control
but helps to keep things simple as well.

The fact that the nodes process "smooth" data reversed from the builtin
"sharp" attributes can be reversed with versioning in a separate commit.

While it's tempting to abstract the sharpness status into a single node,
face and edge smoothness are accessed separately in edit mode, and the
sublety of interacting with data on different domains would make that
confusing. Instead, a separate "Is Shade Smooth" node group asset will
give all the sharp elements taking into account both builtin attributes.
Hans Goudey added this to the 4.0 milestone 2023-09-06 14:37:39 +02:00
Hans Goudey added this to the Nodes & Physics project 2023-09-06 14:37:45 +02:00
Hans Goudey requested review from Jacques Lucke 2023-09-06 14:37:51 +02:00
Hans Goudey added 2 commits 2023-09-06 15:53:04 +02:00
d0c833071d Remove "Both" option for simplicity
It can be added in the future if it's really necessary.
But for now it seems more complex than necessary.
Hans Goudey added 1 commit 2023-09-06 15:57:37 +02:00
Jacques Lucke requested changes 2023-09-06 15:58:27 +02:00
Jacques Lucke left a comment
Member

The enum has to be initialized when the node is created.

The enum has to be initialized when the node is created.
@ -1034,0 +1036,4 @@
LISTBASE_FOREACH (bNodeTree *, ntree, &bmain->nodetrees) {
if (ntree->type == NTREE_GEOMETRY) {
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
if (STREQ(node->idname, "GeometryNodeSetShadeSmooth")) {
Member

It's ok to compare with the node type int here. Don't think we will ever change that we have this int. We might just not have to create them manually anymore in the future.

It's ok to compare with the node type int here. Don't think we will ever change that we have this int. We might just not have to create them manually anymore in the future.
HooglyBoogly marked this conversation as resolved
Jacques Lucke approved these changes 2023-09-06 15:59:27 +02:00
Hans Goudey added 1 commit 2023-09-06 16:14:49 +02:00
buildbot/vexp-code-patch-coordinator Build done. Details
0d3db5b545
Use node type integer
Author
Member

@blender-bot build

@blender-bot build
Hans Goudey merged commit 4e97def8a3 into main 2023-09-06 17:12:34 +02:00
Hans Goudey deleted branch geometry-nodes-face-edge-smooth 2023-09-06 17:12:35 +02:00
Sign in to join this conversation.
No reviewers
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 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#112029
No description provided.