Create geometry nodes modifier when selecting an existing one in the editor #84927

Open
opened 2021-01-21 12:36:21 +01:00 by Simon Thommes · 19 comments
Member

Selecting an already existing geometry nodes tree in the editor on an object without a modifier should automatically create a nodes modifier. This is in parallel to the behaviour of selecting a material without a material slot.
image.png

Selecting an already existing geometry nodes tree in the editor on an object without a modifier should automatically create a nodes modifier. This is in parallel to the behaviour of selecting a material without a material slot. ![image.png](https://archive.blender.org/developer/F9590796/image.png)
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @SimonThommes

Added subscriber: @SimonThommes

#96741 was marked as duplicate of this issue

#96741 was marked as duplicate of this issue

Added subscriber: @Rgtemze

Added subscriber: @Rgtemze

Hi Simon, I am working on this and aiming to complete it in a couple of days. I can accelerate if it is urgent.

Hi Simon, I am working on this and aiming to complete it in a couple of days. I can accelerate if it is urgent.
Author
Member

Awesome! This is not urgent, it's more for convenience.

Awesome! This is not urgent, it's more for convenience.

Hi Simon, it is not fully ready yet but I want to make sure that the desired functionality is as the following:

geometry.gif

By the way, I am new to Blender development; so, I am communicating with the developers at this thread (https://devtalk.blender.org/t/finding-callback-function/17176/4) to learn more about the Blender and modify my code to make it comply with Blender standards.

Hi Simon, it is not fully ready yet but I want to make sure that the desired functionality is as the following: ![geometry.gif](https://archive.blender.org/developer/F9593649/geometry.gif) By the way, I am new to Blender development; so, I am communicating with the developers at this thread (https://devtalk.blender.org/t/finding-callback-function/17176/4) to learn more about the Blender and modify my code to make it comply with Blender standards.
Author
Member

@Rgtemze That looks great, congrats!
I am not a Blender developer myself, so it's great that you have the thread. Once you have the finished patch I'll also make sure that a developer from my work group can look over the code.

One thing I forgot to mention in terms of functionality:
This should copy exactly the functionality of the New button, if the active modifier is not a Geometry Nodes modifier. So it should add a new Geometry Nodes modifier at the end of the stack.

@Rgtemze That looks great, congrats! I am not a Blender developer myself, so it's great that you have the thread. Once you have the finished patch I'll also make sure that a developer from my work group can look over the code. One thing I forgot to mention in terms of functionality: This should copy exactly the functionality of the `New` button, if the active modifier is not a `Geometry Nodes` modifier. So it should add a new `Geometry Nodes` modifier at the end of the stack.

Added subscriber: @oweissbarth

Added subscriber: @oweissbarth

Added subscribers: @HooglyBoogly, @JacquesLucke

Added subscribers: @HooglyBoogly, @JacquesLucke

Hi @JacquesLucke, @HooglyBoogly,

I want to talk about my implementation approach with you regarding this task.

I will use ED_object_modifier_add function to add the new modifier. However, that automatically creates a new Node Tree although the intended functionality is to use the selected node tree, not the new one. One solution is to let it create this new node tree and then replace it with the selected Node Tree afterwards. What else would you suggest here?

I am also planning to call ED_object_modifier_add function inside ED_node_tree_update function which is executed when a node tree is selected but the Geometry Nodes modifier is not active.

What are your thoughts?

Hi @JacquesLucke, @HooglyBoogly, I want to talk about my implementation approach with you regarding this task. I will use ED_object_modifier_add function to add the new modifier. However, that automatically creates a new Node Tree although the intended functionality is to use the selected node tree, not the new one. One solution is to let it create this new node tree and then replace it with the selected Node Tree afterwards. What else would you suggest here? I am also planning to call ED_object_modifier_add function inside ED_node_tree_update function which is executed when a node tree is selected but the Geometry Nodes modifier is not active. What are your thoughts?
Member

Added subscriber: @JulianEisel

Added subscriber: @JulianEisel
Member

I'm not convinced the suggested solution of automatically adding a modifier is a good design idea.

There is nothing that tells the user how the node editor and the modifiers are linked together. On its own this could be an acceptable design limitation, but I see it getting worse:

  • How should the user know that they have to activate a geometry node modifier first? This isn't obvious at all.
  • Besides being not obvious, users who do know about this will often simply forget to activate the modifier first. It's cumbersome too.
  • Now apparently as a workaround for this design weakness, and to save the user one or two clicks, we suggest making Blender guess about user intentions by automatically creating a new modifier -- without being visible to the user if the modifier list doesn't happen to be visible on screen.
  • If the user didn't intend to create a new modifier and either forgot to activate a geometry nodes modifier, or just doesn't know this is needed, the user needs to manually undo Blender's attempt at being smart -- if the user notices it at all.
  • Unlinking the node-tree will not remove the modifier again. It's a one-way "smartness".
    Every time I played with the geometry nodes I was a bit confused about how the node tree selector works. I only realized what's going on after looking at the code.

I think there's an opportunity to help users learn about the design here.
We could display a message in the node editor when no geometry nodes modifier is active, similar to how the Asset Browser communicates that an invalid repository is selected:
Screenshot 2020-11-22 at 17.29.04.png
Again, point of such messages is to help users understand the design, what's wrong and how they can address it.
It could say something like: "No active geometry node modifier for the object. Activate or create one in the Properties."
The node-tree selector can be grayed out then.

Under the message there could still be a button to create the modifier as a shortcut. (We also consider having buttons to let blender create the asset repository/library or to open the preferences as shortcut below the asset browser message.)

I'm not convinced the suggested solution of automatically adding a modifier is a good design idea. There is nothing that tells the user how the node editor and the modifiers are linked together. On its own this could be an acceptable design limitation, but I see it getting worse: * How should the user know that they have to activate a geometry node modifier first? This isn't obvious at all. * Besides being not obvious, users who do know about this will often simply forget to activate the modifier first. It's cumbersome too. * Now apparently as a workaround for this design weakness, and to save the user one or two clicks, we suggest making Blender guess about user intentions by automatically creating a new modifier -- without being visible to the user if the modifier list doesn't happen to be visible on screen. * If the user didn't intend to create a new modifier and either forgot to activate a geometry nodes modifier, or just doesn't know this is needed, the user needs to manually undo Blender's attempt at being smart -- if the user notices it at all. * Unlinking the node-tree will not remove the modifier again. It's a one-way "smartness". Every time I played with the geometry nodes I was a bit confused about how the node tree selector works. I only realized what's going on after looking at the code. --- I think there's an opportunity to help users learn about the design here. We could display a message in the node editor when no geometry nodes modifier is active, similar to how the Asset Browser communicates that an invalid repository is selected: ![Screenshot 2020-11-22 at 17.29.04.png](https://archive.blender.org/developer/F9600742/Screenshot_2020-11-22_at_17.29.04.png) Again, point of such messages is to help users understand the design, what's wrong and how they can address it. It could say something like: "No active geometry node modifier for the object. Activate or create one in the Properties." The node-tree selector can be grayed out then. Under the message there could still be a button to create the modifier as a shortcut. (We also consider having buttons to let blender create the asset repository/library or to open the preferences as shortcut below the asset browser message.)

Added subscriber: @DAnkur-1

Added subscriber: @DAnkur-1
Author
Member

@JulianEisel I see your points. The current behaviour of the geometry node editor and node tree selector is based on the shader editor.
So the geometry node modifier is to the geometry node tree what the material slot is to the shader node tree.

When there is no material slot on an object and you select one in the shader editor a new slot is automatically created. I personally find that quite intuitive and convenient (in both cases)

Of course, opposed to materials, not every modifier, as of now, can be represented with a node tree. (For materials there is still the legacy Use Nodes option, we decided against adopting this option for node modifiers)
So the problem is that only specifically a Geometry Nodes modifier can act as a slot. Every other modifier does not give the option to modify a node tree currently.

In terms of convenience I would argue that it is much easier to just add a material slot, than to add a geometry nodes modifier. So I would like it if we can find a way that keeps the functionality for an empty modifier stack, but still address the points you are bringing up.

As a kind of compromise I would propose the following for the long run:

  • stronger binding of geometry nodes editor and active modifier by including a modifier selector in parallel to the material slot selector within the editor header
    image.png
  • adding a message that the current active modifier does not support a node representation (yet) instead of simply showing the same UI as if the modifier stack were empty
  • keep the behaviour of automatically adding a modifier when the active object's stack is empty and New button is pressed / node tree is selected
  • when a non-node modifier is active grey out the node tree selector
@JulianEisel I see your points. The current behaviour of the geometry node editor and node tree selector is based on the shader editor. So the geometry node modifier is to the geometry node tree what the material slot is to the shader node tree. When there is no material slot on an object and you select one in the shader editor a new slot is automatically created. I personally find that quite intuitive and convenient (in both cases) Of course, opposed to materials, not every modifier, as of now, can be represented with a node tree. (For materials there is still the legacy `Use Nodes` option, we decided against adopting this option for node modifiers) So the problem is that only specifically a `Geometry Nodes` modifier can act as a `slot`. Every other modifier does not give the option to modify a node tree currently. In terms of convenience I would argue that it is much easier to just add a material slot, than to add a geometry nodes modifier. So I would like it if we can find a way that keeps the functionality for an empty modifier stack, but still address the points you are bringing up. As a kind of compromise I would propose the following for the long run: - stronger binding of geometry nodes editor and active modifier by including a modifier selector in parallel to the material slot selector within the editor header ![image.png](https://archive.blender.org/developer/F9602458/image.png) - adding a message that the current active modifier does not support a node representation (yet) instead of simply showing the same UI as if the modifier stack were empty - keep the behaviour of automatically adding a modifier when the active object's stack is **empty** and `New` button is pressed / node tree is selected - when a non-node modifier is active grey out the node tree selector
Contributor

Added subscriber: @Rawalanche

Added subscriber: @Rawalanche
Contributor

As soon as the user adds new GN modifier, it creates new GN datablock. It always assumes that when user adds a new GN modifier, they want to also create new GN node network, while in many cases, user just wants to use existing GN node network on another object.

So every single addition of GN modifier burdens the user with a duty to clean up unintended datablock by going to the Outliner in blend view mode, finding it and deleting it.

GN modifier should not automatically assume that the user intention is to create new GN node network when it is mandatory for user to create a new GN modifier if they want to use existing GN network on another object.

As soon as the user adds new GN modifier, it creates new GN datablock. It always assumes that when user adds a new GN modifier, they want to also create new GN node network, while in many cases, user just wants to use existing GN node network on another object. So every single addition of GN modifier burdens the user with a duty to clean up unintended datablock by going to the Outliner in blend view mode, finding it and deleting it. GN modifier should not automatically assume that the user intention is to create new GN node network when it is mandatory for user to create a new GN modifier if they want to use existing GN network on another object.
Member

Added subscriber: @Vyach

Added subscriber: @Vyach
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
9 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#84927
No description provided.