GPv3: Sample Index node #114486

Closed
Dalai Felinto wants to merge 1 commits from dfelinto/blender:grease-nodes-sample-index into main

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

For this node to work for grease pencil, we force it to use the layer
zero. In the future we can add a Layer Index option, but for now this
will do.

This helps node-trees that were built for curves to also work for grease
pencil.

Part of #113602.

For this node to work for grease pencil, we force it to use the layer zero. In the future we can add a Layer Index option, but for now this will do. This helps node-trees that were built for curves to also work for grease pencil. Part of #113602.
Dalai Felinto added 1 commit 2023-11-04 16:52:14 +01:00
80ad14f2bc GPv3: Sample Index node
For this node to work for grease pencil, we force it to use the layer
zero. In the future we can add a Layer Index option, but for now this
will do.

This helps node-trees that were built for curves to also work for grease
pencil.

Part of #113602.
Author
Owner

My test file: greasepencil-nodes.blend

My test file: [greasepencil-nodes.blend](/attachments/4511a4f3-13fe-4387-803c-6da40dc09b82)
Dalai Felinto requested review from Falk David 2023-11-04 16:52:48 +01:00
Dalai Felinto requested review from Hans Goudey 2023-11-04 16:52:48 +01:00
Dalai Felinto added this to the Grease Pencil project 2023-11-04 16:52:57 +01:00
Dalai Felinto removed this from the Grease Pencil project 2023-11-04 16:53:04 +01:00
Dalai Felinto added the
Interest
Geometry Nodes
Interest
Grease Pencil
labels 2023-11-04 16:53:19 +01:00
Iliya Katushenock added this to the Nodes & Physics project 2023-11-04 16:59:31 +01:00
Falk David requested changes 2023-11-06 11:43:05 +01:00
Falk David left a comment
Member

I don't think sampling from a grease pencil geometry by index will work in general.
Choosing the first layer is too arbitrary (and breaks when reordering layers). Allowing an index that spans across all layers is also too arbitrary imo. It also means that we don't represent the geometry well. The index essentailly looses all meaning. And combining all the layers into one big curves geometry has a big perforamance cost that we shouldn't do implicitly (users can still go for this approach if they merge all the layers manually into a curves geometry).

The only exception I can see is that we allow to sample by index if (and only if) the grease pencil geometry has a single layer. In this case, the sample by index is well defined.
The downside is that users might experience their setup breaking, just because they added a new layer.

I don't think sampling from a grease pencil geometry by index will work in general. Choosing the first layer is too arbitrary (and breaks when reordering layers). Allowing an index that spans across all layers is also too arbitrary imo. It also means that we don't represent the geometry well. The index essentailly looses all meaning. And combining all the layers into one big curves geometry has a big perforamance cost that we shouldn't do implicitly (users can still go for this approach if they merge all the layers manually into a curves geometry). The only exception I can see is that we allow to sample by index if (and only if) the grease pencil geometry has a single layer. In this case, the sample by index is well defined. The downside is that users might experience their setup breaking, just because they added a new layer.
Author
Owner

@filedescriptor or we could implement the Layer (index) field input and use that to pick the layer? It is a bit strange to have a grease pencil only setting available when you working with meshes, but not sure how to solve that

@filedescriptor or we could implement the Layer (index) field input and use that to pick the layer? It is a bit strange to have a grease pencil only setting available when you working with meshes, but not sure how to solve that
Member

@dfelinto Yes, a layer index input could work. Maybe that means the node needs a "mode" to hide/unhide this input.

@dfelinto Yes, a layer index input could work. Maybe that means the node needs a "mode" to hide/unhide this input.

Better to have separate node to sample layer by index from arbitrary geometry

Better to have separate node to sample layer by index from arbitrary geometry
Member

Closing this PR for now, since we'll need more feedback to settle on a design here and setting that topic isn't a priority at the moment.

Closing this PR for now, since we'll need more feedback to settle on a design here and setting that topic isn't a priority at the moment.
Hans Goudey closed this pull request 2024-01-30 04:49:15 +01:00

Pull request closed

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
4 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#114486
No description provided.