Adding selection input to Subdivide Mesh geometry node #116485

Open
Eugene-Kuznetsov wants to merge 1 commits from Eugene-Kuznetsov/blender:ek_selective_subdiv into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Contributor

It is sometimes useful to subdivide some part of a mesh using Geometry Nodes (perhaps to increase detail level in the area that is to be modified, without incurring performance penalties due to global subdivision).

At present, there's no good way to do it. The obvious approach is to "separate geometry" followed by "join geometry" and "merge by distance", but it does not work as intended, because it leaves zero-area holes along the weld, which manifest as shading discontinuities. It takes a lot of work to fix the gaps (https://blender.stackexchange.com/questions/274918/how-to-subdivide-a-selection-of-faces-in-geometry-nodes) and even that does not work 100% correctly.

This PR adds a Selection input to the Subdivide Mesh geometry node. I had to switch to a different subdivision algorithm, because I can't see any way of passing selection data to the original algorithm, and I'm not sure if I got all the allocation and deallocation logic correctly. It does seem to work, though.

Original:
image

With the new Subdivide Mesh node:
image

It is sometimes useful to subdivide some part of a mesh using Geometry Nodes (perhaps to increase detail level in the area that is to be modified, without incurring performance penalties due to global subdivision). At present, there's no good way to do it. The obvious approach is to "separate geometry" followed by "join geometry" and "merge by distance", but it does not work as intended, because it leaves zero-area holes along the weld, which manifest as shading discontinuities. It takes a lot of work to fix the gaps (https://blender.stackexchange.com/questions/274918/how-to-subdivide-a-selection-of-faces-in-geometry-nodes) and even that does not work 100% correctly. This PR adds a Selection input to the Subdivide Mesh geometry node. I had to switch to a different subdivision algorithm, because I can't see any way of passing selection data to the original algorithm, and I'm not sure if I got all the allocation and deallocation logic correctly. It does seem to work, though. Original: ![image](/attachments/a4aa0ef8-3678-474b-98e8-b98a6c7c12ca) With the new Subdivide Mesh node: ![image](/attachments/5cf00c20-f5de-44ec-9896-fe25708c0167)
2.4 MiB
2.5 MiB
Eugene-Kuznetsov changed title from WIP Adding selection input to Subdivide Mesh geometry node to WIP: Adding selection input to Subdivide Mesh geometry node 2023-12-23 07:57:55 +01:00

The main problems here:

  • Using bmesh.
  • Selecting not polygons, but edges.
  • Not the subdivide level, but the selection of subdivide.
The main problems here: - Using bmesh. - Selecting not polygons, but edges. - Not the subdivide level, but the selection of subdivide.
Iliya Katushenock added this to the Nodes & Physics project 2023-12-23 09:02:52 +01:00
Iliya Katushenock added the
Interest
Geometry Nodes
Interest
Modeling
labels 2023-12-23 09:03:01 +01:00
Author
Contributor

The main problems here:

  • Using bmesh.

What can I use instead of bmesh? The only other algorithm is BKE_subdiv_to_mesh. I looked at it and I couldn't see any way to make it subdivide only part of the mesh. Is there such a way?

  • Selecting not polygons, but edges.

that's because the subdivision algorithm needs selection of edges. It is the same function that's called for "Edge->Subdivide" in edit mode.

> The main problems here: > - Using bmesh. What can I use instead of bmesh? The only other algorithm is BKE_subdiv_to_mesh. I looked at it and I couldn't see any way to make it subdivide only part of the mesh. Is there such a way? > - Selecting not polygons, but edges. that's because the subdivision algorithm needs selection of edges. It is the same function that's called for "Edge->Subdivide" in edit mode.
Eugene-Kuznetsov force-pushed ek_selective_subdiv from 4edcd0f218 to 34344f200e 2024-03-04 06:20:14 +01:00 Compare
Eugene-Kuznetsov changed title from WIP: Adding selection input to Subdivide Mesh geometry node to Adding selection input to Subdivide Mesh geometry node 2024-03-04 06:37:40 +01:00

What can I use instead of bmesh? The only other algorithm is BKE_subdiv_to_mesh. I looked at it and I couldn't see any way to make it subdivide only part of the mesh. Is there such a way?

Well, you can write this from scratch? BMesh is the not a thing what can be used in geometry nodes, someone at some point have to rewrite this in future in any case.

I don't want to say what you actually have to spend your time on such feature at least before this like project will not be accepted by geometry nodes team.

> What can I use instead of bmesh? The only other algorithm is BKE_subdiv_to_mesh. I looked at it and I couldn't see any way to make it subdivide only part of the mesh. Is there such a way? Well, you can write this from scratch? BMesh is the not a thing what can be used in geometry nodes, someone at some point have to rewrite this in future in any case. I don't want to say what you actually have to spend your time on such feature at least before this like project will not be accepted by geometry nodes team.
Author
Contributor

It's not like it''s going to be accepted in either case (I have 8 open PRs counting this one, and no activity on any of them.)

It's not like it''s going to be accepted in either case (I have 8 open PRs counting this one, and no activity on any of them.)
Eugene-Kuznetsov force-pushed ek_selective_subdiv from 34344f200e to 5af59752e1 2024-04-02 07:25:40 +02:00 Compare
First-time contributor

I don't think this really makes sense for subdivision; subdivision is suppose to output only quad topology. and your example only shows how the triangulated result looks, how about not triangulated?
maybe a seperate slicing node, I saw I think iliya making a resample edge node #113427 .

we really need more topology editing nodes, it could be done now with complex setups adding new faces, but that is not idea, and the interpolation of attribute are all messed up. you have to interpolate each attribute individually.

(it would be nice to have a attribute interpolation node, that you could set the interpolation for all attribute in a given domain and pass it to other geographic or the same geometry if you want a different interpolation, I think that would be very useful what to you this @mod_moder ?)

I don't think this really makes sense for subdivision; subdivision is suppose to output only quad topology. and your example only shows how the triangulated result looks, how about not triangulated? maybe a seperate slicing node, I saw I think iliya making a resample edge node #113427 . we really need more topology editing nodes, it could be done now with complex setups adding new faces, but that is not idea, and the interpolation of attribute are all messed up. you have to interpolate each attribute individually. (it would be nice to have a attribute interpolation node, that you could set the interpolation for all attribute in a given domain and pass it to other geographic or the same geometry if you want a different interpolation, I think that would be very useful what to you this @mod_moder ?)

we really need more topology editing nodes, it could be done now with complex setups adding new faces, but that is not idea, and the interpolation of attribute are all messed up. you have to interpolate each attribute individually.

In general, only thing that we waiting for - array attributes.

(it would be nice to have a attribute interpolation node, that you could set the interpolation for all attribute in a given domain and pass it to other geographic or the same geometry if you want a different interpolation, I think that would be very useful what to you this @mod_moder ?)

This quet unrelated, but limited by lists of strings (attribute names).

Case of this node can be done in a general manner by: https://devtalk.blender.org/t/replacement-based-procedural-modelling-proposal/31851

> we really need more topology editing nodes, it could be done now with complex setups adding new faces, but that is not idea, and the interpolation of attribute are all messed up. you have to interpolate each attribute individually. In general, only thing that we waiting for - array attributes. > (it would be nice to have a attribute interpolation node, that you could set the interpolation for all attribute in a given domain and pass it to other geographic or the same geometry if you want a different interpolation, I think that would be very useful what to you this @mod_moder ?) This quet unrelated, but limited by lists of strings (attribute names). Case of this node can be done in a general manner by: https://devtalk.blender.org/t/replacement-based-procedural-modelling-proposal/31851
First-time contributor

@mod_moder

This quet unrelated, but limited by lists of strings (attribute names).

what I had in mind was something that would interpolate captured attributes aswell, not just named attribute.

is there a better place for a discussion like this? I do want a node like this (interpolation attribute), would be nice to have a proper place to discuss it.

I do topology manipulation and it messes up attribute, which I could fix manual by remapping and mixing, but I have to do it for every attribute individually and specify them. (example https://x.com/shmuel_Israel_/status/1756838484524863811 30s in)

@mod_moder > This quet unrelated, but limited by lists of strings (attribute names). what I had in mind was something that would interpolate captured attributes aswell, not just named attribute. is there a better place for a discussion like this? I do want a node like this (interpolation attribute), would be nice to have a proper place to discuss it. I do topology manipulation and it messes up attribute, which I could fix manual by remapping and mixing, but I have to do it for every attribute individually and specify them. (example https://x.com/shmuel_Israel_/status/1756838484524863811 30s in)
Merge conflict checking is in progress. Try again in few moments.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u ek_selective_subdiv:Eugene-Kuznetsov-ek_selective_subdiv
git checkout Eugene-Kuznetsov-ek_selective_subdiv
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
Asset Browser Project
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
3 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#116485
No description provided.