Fix #111174: dropped nodegroups from the asset browser show selector #111427

Merged
Philipp Oeser merged 3 commits from lichtwerk/blender:111174 into main 2023-08-24 15:12:08 +02:00
Member

There was a difference between drag&drop assets from the asset browser
vs. using the search menu (in that doing it from the menu would
correctly hide the data-block selector on the nodegroup).

Since drag&drop in the Node Editor uses NODE_OT_add_group (not
NODE_OT_add_group_asset as the menu does), we have to add the hiding
here too (for this, an operator property is added which is set in
node_group_drop_copy if we are dropping an asset.

Alternatively, we could use NODE_OT_add_group_asset, too, but that
would require somehow setting the "asset" context pointer from the
dropbox copy function [how to do this wasnt obvious for me]. In that
case, we would need to set up a separate dropbox with appropriate poll
functions (so there would be one for asset groups and for the the other
groups).

There was a difference between drag&drop assets from the asset browser vs. using the search menu (in that doing it from the menu would correctly hide the data-block selector on the nodegroup). Since drag&drop in the Node Editor uses `NODE_OT_add_group` (not `NODE_OT_add_group_asset` as the menu does), we have to add the hiding here too (for this, an operator property is added which is set in `node_group_drop_copy` if we are dropping an asset. Alternatively, we could use `NODE_OT_add_group_asset`, too, but that would require somehow setting the "asset" context pointer from the dropbox copy function [how to do this wasnt obvious for me]. In that case, we would need to set up a separate dropbox with appropriate poll functions (so there would be one for asset groups and for the the other groups).
Philipp Oeser added 1 commit 2023-08-23 13:32:05 +02:00
076bf4e55a Fix #111174: dropped nodegroups from the asset browser show selector
There was a difference between drag&drop assets from the asset browser
vs. using the search menu (in that doing it from the menu would
correctly hide the data-block selector on the nodegroup).

Since drag&drop in the Node Editor uses `NODE_OT_add_group` (not
`NODE_OT_add_group_asset` as the menu does), we have to add the hiding
here too (for this, an operator property is added which is set in
`node_group_drop_copy` if we are dropping an asset.

Alternatively, we could use `NODE_OT_add_group_asset`, too, but that
would require somehow setting the "asset" context pointer from the
dropbox copy function [how to do this wasnt obvious for me]. In that
case, we would need to set up a separate dropbox with appropriate poll
functions (so there would be one for asset groups and for the the other
groups).
Philipp Oeser requested review from Julian Eisel 2023-08-23 13:32:19 +02:00
Philipp Oeser requested review from Hans Goudey 2023-08-23 13:32:28 +02:00
Philipp Oeser added the
Interest
Asset Browser
label 2023-08-23 13:32:41 +02:00
Philipp Oeser added this to the Pipeline, Assets & IO project 2023-08-23 13:32:47 +02:00
Philipp Oeser added the
Interest
Nodes & Physics
Interest
User Interface
labels 2023-08-23 13:32:59 +02:00
Member

Something more obvious like show_datablock_in_node might work too, but I don't have a strong opinion. is_assset has one too many s though.

Something more obvious like `show_datablock_in_node` might work too, but I don't have a strong opinion. `is_assset` has one too many s though.
Pratik Borhade reviewed 2023-08-23 13:39:08 +02:00
@ -372,2 +377,4 @@
WM_operator_properties_id_lookup(ot, true);
PropertyRNA *prop = RNA_def_boolean(ot->srna, "is_assset", false, "Asset", "");
Member

typo? Should be "is_asset" :)

typo? Should be "is_asset" :)
lichtwerk marked this conversation as resolved
Philipp Oeser added 1 commit 2023-08-23 14:34:27 +02:00
Author
Member

changed the property name to be more descriptive

changed the property name to be more descriptive
Hans Goudey reviewed 2023-08-23 14:49:58 +02:00
@ -374,0 +380,4 @@
PropertyRNA *prop = RNA_def_boolean(ot->srna,
"show_datablock_in_node",
true,
"Show the datablock selector in the node (not for assets)",
Member

"not for assets" makes it sound like the property isn't used for assets, I think it's fine to just leave that out.

"not for assets" makes it sound like the property isn't used for assets, I think it's fine to just leave that out.
Philipp Oeser added 1 commit 2023-08-23 15:03:51 +02:00
Hans Goudey approved these changes 2023-08-23 15:31:57 +02:00
Author
Member

Hm, this might not be the best solution, would not hiding it at all be considered better?
#111174 (comment)

Hm, this might not be the best solution, would **not** hiding it **at all** be considered better? https://projects.blender.org/blender/blender/issues/111174#issuecomment-1004650
Julian Eisel refused to review 2023-08-23 17:15:17 +02:00
Member

"hiding" behavior is expected so I think can merge your PR: #111174 (comment)

(Though Dalai closed the report too early 😅 )


BTW, we should also backport it to other LTS versions.

"hiding" behavior is expected so I think can merge your PR: https://projects.blender.org/blender/blender/issues/111174#issuecomment-1005258 (Though Dalai closed the report too early 😅 ) - - - BTW, we should also backport it to other LTS versions.
Contributor

Just to be sure, if I now have Outliner open in Blender File mode and I drag a node group which is not an asset from it into a node editor, that node group will still have the datablock selector displayed, right?

Just to be sure, if I now have Outliner open in Blender File mode and I drag a node group which is not an asset from it into a node editor, that node group will still have the datablock selector displayed, right?
Author
Member

Just to be sure, if I now have Outliner open in Blender File mode and I drag a node group which is not an asset from it into a node editor, that node group will still have the datablock selector displayed, right?

yes (all nodegroups you see there are local, so should all not be assets afaict)

> Just to be sure, if I now have Outliner open in Blender File mode and I drag a node group which is not an asset from it into a node editor, that node group will still have the datablock selector displayed, right? yes (all nodegroups you see there are local, so should all not be assets afaict)
Philipp Oeser merged commit 686ffaaed9 into main 2023-08-24 15:12:08 +02:00
Philipp Oeser deleted branch 111174 2023-08-24 15:12:09 +02:00
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#111427
No description provided.