Geometry Nodes: Extend add modifier menu with node group assets #111717

Merged
Hans Goudey merged 30 commits from HooglyBoogly/blender:geometry-nodes-is-modifier-trait into main 2023-09-05 14:47:25 +02:00
Member

Implements part of #111538.

Change the modifier add button to create a menu with submenus.
Extend the submenus dynamically with geometry node group assets.
This makes it much simpler to share and use custom modifiers.

Node groups get a new "Is Modifier" property, which is controllable
in a popover in the node editor header when the group is an asset.

The built in modifier can be rearranged in different categories in
a next step. For now the existing organization is used, except for
the geometry nodes modifier, which is called "Empty Modifier" and
put in the root menu.

The changes in !110855 and !110828 will be important to improve
interaction speed with the new UI. Those are planned for 4.0 as well.


image

Implements part of #111538. Change the modifier add button to create a menu with submenus. Extend the submenus dynamically with geometry node group assets. This makes it much simpler to share and use custom modifiers. Node groups get a new "Is Modifier" property, which is controllable in a popover in the node editor header when the group is an asset. The built in modifier can be rearranged in different categories in a next step. For now the existing organization is used, except for the geometry nodes modifier, which is called "Empty Modifier" and put in the root menu. The changes in !110855 and !110828 will be important to improve interaction speed with the new UI. Those are planned for 4.0 as well. --- ![image](/attachments/8eea746d-376c-41f3-b499-5f22f3b687d5)
Hans Goudey added 13 commits 2023-08-30 23:21:09 +02:00
Hans Goudey added this to the 4.0 milestone 2023-08-30 23:33:48 +02:00
Hans Goudey added this to the User Interface project 2023-08-30 23:33:56 +02:00
Hans Goudey reviewed 2023-08-31 04:30:59 +02:00
@ -29,0 +32,4 @@
def draw(self, context):
layout = self.layout
ob_type = context.object.type
if ob_type in {'MESH', 'CURVE', 'FONT', 'SURFACE', 'VOLUME', 'POINTCLOUD'}:
Author
Member

All these if statements are pretty ugly, but since we're not going to be adding more of them in the future, I think it's better to keep things simple and not abstract it.

All these if statements are pretty ugly, but since we're not going to be adding more of them in the future, I think it's better to keep things simple and not abstract it.
Contributor

Quick Feedback:

I'm all for consistency, but in this case the UX is not as optimal...

Proposed UX:

  1. Click on Add Modifier
  2. Move mouse to sub menu
  3. Open Submenu
  4. Move mouse to operator
  5. Click on operator.

Previous UX:

  1. Click on Add Modifier
  2. Move mouse to modifier
  3. Click on operator.

We have slowed things down by +60% for every day use of modifiers.

Alternative:

  • Add an additional drop down for custom operators (drop down arrow or plus sign by the "Add Modifier" button" or additional labeled button). Now it would be clear which are user operators and what are built in.
  • Previous method will still be a quick UX for built in operators, and not rock the boat with user base and documentation/tutorials.
  • Both custom and built in modifiers would be accessible in 3 movements via two doorways that aren't as deep.
  • New custom operators can work with user defined categories and sub-menus without affecting built-in modifier UX.
### Quick Feedback: I'm all for consistency, but in this case the UX is not as optimal... **Proposed UX:** 1. Click on Add Modifier 2. Move mouse to sub menu 3. Open Submenu 4. Move mouse to operator 5. Click on operator. **Previous UX:** 1. Click on Add Modifier 2. Move mouse to modifier 3. Click on operator. We have slowed things down by +60% for every day use of modifiers. **Alternative:** - Add an additional drop down for custom operators (drop down arrow or plus sign by the "Add Modifier" button" or additional labeled button). Now it would be clear which are user operators and what are built in. - Previous method will still be a quick UX for built in operators, and not rock the boat with user base and documentation/tutorials. - Both custom and built in modifiers would be accessible in 3 movements via two doorways that aren't as deep. - New custom operators can work with user defined categories and sub-menus without affecting built-in modifier UX.
Member

We have slowed things down by +60% for every day use of modifiers.

You missed the part that mentions two other patches related to this, that add search in menus and recent items to search.

Plus the re-organization of this menu so modifiers are easier to find. Much better than the current wall of options that are just as hard to scan.

> We have slowed things down by +60% for every day use of modifiers. You missed the part that mentions two other patches related to this, that add search in menus and recent items to search. Plus the re-organization of this menu so modifiers are easier to find. Much better than the current wall of options that are just as hard to scan.
Contributor

Yeh, saw the others. I am ok with this patch and will swallow that pill in the name of consistency, but thought to voice the feedback none-the-less. There was some knee-jerk kickback in discord from other users.

🟢 Green lit - for consistency sake

Yeh, saw the others. I am ok with this patch and will swallow that pill in the name of consistency, but thought to voice the feedback none-the-less. There was some knee-jerk kickback in discord from other users. 🟢 Green lit - for consistency sake
Hans Goudey added 7 commits 2023-08-31 20:43:43 +02:00
Hans Goudey requested review from Pablo Vazquez 2023-08-31 20:43:45 +02:00
Hans Goudey requested review from Julian Eisel 2023-08-31 20:43:45 +02:00
Member

Great! Works as expected.

The only small thing that bothers me is the name Empty, which can be confused with the object type.

How about:

  • Procedural
  • Procedural Modifier
  • Custom
  • Empty Modifier
Great! Works as expected. The only small thing that bothers me is the name `Empty`, which can be confused with the object type. How about: * `Procedural` * `Procedural Modifier` * `Custom` * `Empty Modifier`
Hans Goudey added 2 commits 2023-09-01 14:17:08 +02:00
Member

I'm not sure if it should be part of this patch but making Shift+A (with the mouse over the Modifier properties) bring up this menu would be great :D

I'm not sure if it should be part of this patch but making `Shift+A` (with the mouse over the Modifier properties) bring up this menu would be great :D
Julian Eisel reviewed 2023-09-01 16:04:42 +02:00
@ -225,4 +229,20 @@ PointerRNA persistent_catalog_path_rna_pointer(const bScreen &owner_screen,
const_cast<asset_system::AssetCatalogPath *>(&path)};
}
void draw_menu_for_catalog(const bScreen &owner_screen,
Member

This seems placed a bit arbitrarily here. The file provides high level catalog editing functions, while this is a UI layout utility. Could be a template even.

This seems placed a bit arbitrarily here. The file provides high level catalog editing functions, while this is a UI layout utility. Could be a template even.
HooglyBoogly marked this conversation as resolved
Julian Eisel requested changes 2023-09-01 16:17:18 +02:00
@ -44,0 +143,4 @@
}
/** \note Does not check asset type or meta data. */
const asset_system::AssetRepresentation *operator_asset_reference_props_get_asset(
Member

The function names should make it more clear that they trigger loading of all asset libraries. This is a rather significant operation.
Previously these were local scope functions, if they become generalized for reuse we need to be more thoughtful with naming.

The function names should make it more clear that they trigger loading of all asset libraries. This is a rather significant operation. Previously these were local scope functions, if they become generalized for reuse we need to be more thoughtful with naming.
Member

It also needs to be clear that this triggers loading in the background, so there may not be a result immediately.

It also needs to be clear that this triggers loading in the background, so there may not be a result immediately.
HooglyBoogly marked this conversation as resolved
@ -44,0 +152,4 @@
&ptr, "asset_library_identifier", nullptr, 0, nullptr);
weak_ref.relative_asset_identifier = RNA_string_get_alloc(
&ptr, "relative_asset_identifier", nullptr, 0, nullptr);
return find_asset_from_weak_ref(C, weak_ref, reports);
Member

Isn't this leaking memory? Where are the identifier strings freed?

Isn't this leaking memory? Where are the identifier strings freed?
Author
Member

No, because the struct has a destructor that frees the strings: ~AssetWeakReference();

No, because the struct has a destructor that frees the strings: `~AssetWeakReference();`
HooglyBoogly marked this conversation as resolved
Hans Goudey added 3 commits 2023-09-01 19:31:46 +02:00
Author
Member

Thanks for the review. I made a new include and cc file for the common code between the place we've extended menus. It may not be the perfect abstraction but it's definitely better than scattering this stuff around like it was.

Thanks for the review. I made a new include and cc file for the common code between the place we've extended menus. It may not be the perfect abstraction but it's definitely better than scattering this stuff around like it was.
Hans Goudey requested review from Julian Eisel 2023-09-01 19:41:35 +02:00
Hans Goudey added 2 commits 2023-09-02 04:54:07 +02:00
Hans Goudey added 1 commit 2023-09-02 05:09:51 +02:00
Julian Eisel approved these changes 2023-09-04 12:23:21 +02:00
Julian Eisel left a comment
Member

One copy & paste error to fix, otherwise looks good on a quick glance.

One copy & paste error to fix, otherwise looks good on a quick glance.
@ -0,0 +5,4 @@
/** \file
* \ingroup edasset
*
* UI/Editor level API for catalog operations, creating richer functionality than the asset system
Member

This comment should not be copied over.

This comment should not be copied over.
HooglyBoogly marked this conversation as resolved
Pablo Vazquez approved these changes 2023-09-04 15:12:33 +02:00
Hans Goudey added 2 commits 2023-09-05 14:44:22 +02:00
Hans Goudey merged commit 6da4b87661 into main 2023-09-05 14:47:25 +02:00
Hans Goudey deleted branch geometry-nodes-is-modifier-trait 2023-09-05 14:47:27 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#111717
No description provided.