Geometry Nodes: Is Edit Mode Node #106970

Open
DorianB wants to merge 5 commits from dodododorian/blender:main into main

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

This patch adds a new "Is Edit Mode" node for evaluating if the self_object() is in edit mode. This is useful for GeometryNode creators to optimize their node tree when the node-group user is editing the base mesh.

This idea was requested by my collaborator Baga, his generator is heavy, and he would like to turn down some settings when his users are editing their base mesh.Example.

Status: Finished, Awaiting Design Approval

Two alternative design have been proposed:

  • Add new string output in the already existing object info node (mockup below)
  • replace "IsEditMode" with "IsObjectMode"

This patch adds a new "_Is Edit Mode_" node for evaluating if the `self_object()` is in edit mode. This is useful for GeometryNode creators to optimize their node tree when the node-group user is editing the base mesh. This idea was requested by my collaborator [Baga](https://twitter.com/BagattiniAntoi1/status/1646554445306556416), his generator is heavy, and he would like to turn down some settings when his users are editing their base mesh.[Example.](https://twitter.com/BagattiniAntoi1/status/1649413332988837888?s=20) ### <u>Status:</u> Finished, Awaiting Design Approval Two alternative design have been proposed: - Add new string output in the already existing object info node (mockup below) - replace "IsEditMode" with "IsObjectMode" <br>
DorianB added 3 commits 2023-04-14 21:20:35 +02:00
DorianB requested review from Hans Goudey 2023-04-14 21:22:36 +02:00
DorianB reviewed 2023-04-14 21:23:46 +02:00
README.md Outdated
@ -35,4 +35,4 @@ License
Blender as a whole is licensed under the GNU General Public License, Version 3.
Individual files may have a different, but compatible license.
See [blender.org/about/license](https://www.blender.org/about/license) for details.

This was not intentional. Don't understand why it was picked up by gitea as a change

This was not intentional. Don't understand why it was picked up by gitea as a change

In that case update your PR please :)

In that case update your PR please :)

Thanks, I used to submit .diff files, everything was much simpler back then.
How can i tell gitea to ignore the "changes" of README.md ?

Thanks, I used to submit .diff files, everything was **_much_** simpler back then. How can i tell gitea to ignore the "_changes_" of README.md ?

Check out your branch, make the change, commit and push again to the same PR.

Instructions are here

Check out your branch, make the change, commit and push again to the same PR. Instructions are [here](https://wiki.blender.org/wiki/Tools/Pull_Requests)
dodododorian marked this conversation as resolved
DorianB changed title from WIP: GeometryNode IsEditMode Node to GeometryNode IsEditMode Node 2023-04-14 21:30:45 +02:00
DorianB changed title from GeometryNode IsEditMode Node to GeometryNode IsEditMode Node 2023-04-14 21:30:46 +02:00
DorianB changed title from GeometryNode IsEditMode Node to GeometryNode IsEditMode Node 2023-04-14 21:30:46 +02:00
Hans Goudey changed title from GeometryNode IsEditMode Node to Geometry Nodes: Is Edit Mode Node 2023-04-14 21:34:41 +02:00
DorianB added 1 commit 2023-04-15 01:13:46 +02:00
DorianB added 1 commit 2023-04-15 01:32:24 +02:00

Hi, I hope this gets through. I have one concern though. Some Geometry Node systems depend on different objects. With this node you can only check for the object, where the modifier is on. For example the new hair system could not take advantage of this. Maybe add an Object as Input? Though this would make it similar to my approach, which was rejected #106305

Hi, I hope this gets through. I have one concern though. Some Geometry Node systems depend on different objects. With this node you can only check for the object, where the modifier is on. For example the new hair system could not take advantage of this. Maybe add an Object as Input? Though this would make it similar to my approach, which was rejected #106305

Hi, I hope this gets through. I have one concern though. Some Geometry Node systems depend on different objects. With this node you can only check for the object, where the modifier is on. For example the new hair system could not take advantage of this. Maybe add an Object as Input? Though this would make it similar to my approach, which was rejected https://projects.blender.org/blender/blender/pulls/106305.

Hi, I agree it won't be able to cover standalone "empty" objects. Personally, I would much prefer to have a powerful flexible node that could access any data contained within the .blend the user could think of, such as 106989 or my Python Api node.

For example, here's a user optimizing his experience with some simple Python API call. users_optimizing_his_scene.mp4 Proposing flexibility is important, the users are not predictable.

But well, that's up to the design team.

PS: link is broken

> Hi, I hope this gets through. I have one concern though. Some Geometry Node systems depend on different objects. With this node you can only check for the object, where the modifier is on. For example the new hair system could not take advantage of this. Maybe add an Object as Input? Though this would make it similar to my approach, which was rejected [https://projects.blender.org/blender/blender/pulls/106305](url). Hi, I agree it won't be able to cover standalone "empty" objects. Personally, I would much prefer to have a powerful flexible node that could access any data contained within the .blend the user could think of, such as [106989](https://projects.blender.org/blender/blender/pulls/106989) or my [Python Api](https://devtalk.blender.org/t/extra-nodes-for-geometrynodes/20942) node. For example, here's a user optimizing his experience with some simple Python API call. ![users_optimizing_his_scene.mp4](https://projects.blender.org/blender/blender/issues/106970/attachments/6adb0d0a-30fc-4724-8470-26128695c865) Proposing flexibility is important, the users are <u>**not**</u> predictable. But well, that's up to the design team. PS: link is broken

Hi, I hope this gets through. I have one concern though. Some Geometry Node systems depend on different objects. With this node you can only check for the object, where the modifier is on. For example the new hair system could not take advantage of this. Maybe add an Object as Input? Though this would make it similar to my approach, which was rejected https://projects.blender.org/blender/blender/pulls/106305.

Hi, I agree it won't be able to cover standalone "empty" objects. Personally, I would much prefer to have a powerful flexible node that could access any data contained within the .blend the user could think of, such as 106989 or my Python Api node. But well, that's up to the design team.

By the way, what if your patch outputted a string and not an enum int? Maybe that could get a pass
PS: link is broken

I agree, this would be amazing. Link should be fixed. It would be an option, but sadly i think it wasn't rejected because of the output type:

It's honestly a bit unlikely that we'll allow accessing the mode like this, because it's not really something that the procedural setup should depend on. For the time being I'd recommend people to just expose a "Fast Mode" boolean as group input that can be controlled from the modifier or so.

Originally posted by @JacquesLucke in /blender/blender/pulls/106305#issuecomment-911946

> > Hi, I hope this gets through. I have one concern though. Some Geometry Node systems depend on different objects. With this node you can only check for the object, where the modifier is on. For example the new hair system could not take advantage of this. Maybe add an Object as Input? Though this would make it similar to my approach, which was rejected [https://projects.blender.org/blender/blender/pulls/106305](url). > > Hi, I agree it won't be able to cover standalone "empty" objects. Personally, I would much prefer to have a powerful flexible node that could access any data contained within the .blend the user could think of, such as [106989](https://projects.blender.org/blender/blender/pulls/106989) or my [Python Api](https://devtalk.blender.org/t/extra-nodes-for-geometrynodes/20942) node. But well, that's up to the design team. > > By the way, what if your patch outputted a string and not an enum int? Maybe that could get a pass > PS: link is broken I agree, this would be amazing. Link should be fixed. It would be an option, but sadly i think it wasn't rejected because of the output type: > It's honestly a bit unlikely that we'll allow accessing the mode like this, because it's not really something that the procedural setup should depend on. For the time being I'd recommend people to just expose a "Fast Mode" boolean as group input that can be controlled from the modifier or so. _Originally posted by @JacquesLucke in /blender/blender/pulls/106305#issuecomment-911946_
DorianB requested review from Simon Thommes 2023-04-18 20:30:31 +02:00

Alternative proposal:

Extending object info mode with additional information.
Similar to #106305 but with a few new string outputs instead of an non-user friendly integer

img

@Hans The "name" field has come up a bunch of times, but it doesn't work with the depsgraph (yet), unless we want to reevaluate all modifiers when changing the name of any object

Note that the name is not currently supported by geonode depsgraph, but i don't see why it's a big deal to re-evaluate node on rename, rename operations arent't that common

### **Alternative proposal**: Extending object info mode with additional information. Similar to https://projects.blender.org/blender/blender/pulls/106305 but with a few new string outputs instead of an non-user friendly integer ![img](https://projects.blender.org/blender/blender/issues/106970/attachments/48ebcc37-42f1-4a97-bc39-45ee1b58f358) > @Hans The "name" field has come up a bunch of times, but it doesn't work with the depsgraph (yet), unless we want to reevaluate all modifiers when changing the name of any object Note that the name is not currently supported by geonode depsgraph, but i don't see why it's a big deal to re-evaluate node on rename, rename operations arent't that common

@dodododorian thanks for the proposal !

It will help optimize performance and enhance the user experience when editing base meshes, especially in large node trees that can be laggy.
Most criticisms directed at this proposal can also be applied to the existing "Is Viewport" node.

The alternative proposal is interesting, but an "Is Edit Mode" node is more consistent with the existing "Is Viewport" node.
An "Is Object Mode" node might be even more desirable, as it could take into account sculpt, edit mode, and other modes.

@dodododorian thanks for the proposal ! It will help optimize performance and enhance the user experience when editing base meshes, especially in large node trees that can be laggy. Most criticisms directed at this proposal can also be applied to the existing "Is Viewport" node. The alternative proposal is interesting, but an "Is Edit Mode" node is more consistent with the existing "Is Viewport" node. An "Is Object Mode" node might be even more desirable, as it could take into account sculpt, edit mode, and other modes.

@Antoine_Bagattini

Is it bad, when different nodes return similar things? Because then we could do a Is Object Mode Node. And maybe laiter add more properties to the object info node, like in the alternative proposial. This would keep it "beginner" friendly, but also give the option for more detailed settings. But I could also imagine, that this would make blender "bloated".

@Antoine_Bagattini Is it bad, when different nodes return similar things? Because then we could do a Is Object Mode Node. And maybe laiter add more properties to the object info node, like in the alternative proposial. This would keep it "beginner" friendly, but also give the option for more detailed settings. But I could also imagine, that this would make blender "bloated".

but also give the option for more detailed settings

The object-mode information as a string output in the object-info node proposal is more flexible & elegant than a simple boolean input IMO

Advantages:

  • Added behavior control on other modes
  • Added behavior control on the object source, where the initial proposal is only compatible with self object.
  • More compact solution ( there's already a lot of nodes )
  • The mode state is an object information, it makes sense to be shown in the object info node
  • Gives us the opportunity to propose more string information about the object, such as the name and object type

Inconvenience:

  • Users will need to conntect an extra self object node and an extra string compare node
> but also give the option for more detailed settings The object-mode information as a string output in the object-info node proposal is more flexible & elegant than a simple boolean input IMO Advantages: - Added behavior control on other modes - Added behavior control on the object source, where the initial proposal is only compatible with self object. - More compact solution ( there's already a lot of nodes ) - The mode state is an object information, it makes sense to be shown in the object info node - Gives us the opportunity to propose more string information about the object, such as the name and object type Inconvenience: - Users will need to conntect an extra self object node and an extra string compare node

Is it bad, when different nodes return similar things?

Not really. I believe that the 'Is Object Mode' node is the best solution.

Alternative proposal:

Extending object info mode with additional information.
Similar to #106305 but with a few new string outputs instead of an non-user friendly integer

img

It's really nice, but the 'Is Object Mode' is more consistent and easier to use.

> Is it bad, when different nodes return similar things? Not really. I believe that the 'Is Object Mode' node is the best solution. > ### **Alternative proposal**: > > Extending object info mode with additional information. > Similar to https://projects.blender.org/blender/blender/pulls/106305 but with a few new string outputs instead of an non-user friendly integer > > ![img](https://projects.blender.org/blender/blender/issues/106970/attachments/48ebcc37-42f1-4a97-bc39-45ee1b58f358) It's really nice, but the 'Is Object Mode' is more consistent and easier to use.

Reviewers

Hans Goudey was requested for review 2023-04-14 21:22:36 +02:00
Simon Thommes was requested for review 2023-04-18 20:30:31 +02:00
This pull request has changes conflicting with the target branch.
  • source/blender/blenkernel/BKE_node.h
  • source/blender/nodes/NOD_static_types.h
  • source/blender/nodes/geometry/node_geometry_register.cc
  • source/blender/nodes/geometry/node_geometry_register.hh
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 & 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
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
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
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#106970
There is no content yet.