Fix #112331: Add update tags directly in bNodeTreeInterface API methods #111741
No reviewers
Labels
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111741
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "LukasTonne/blender:tree-interface-update-tags"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Calling an API function after the node panels patch does not internally
tag the node tree with
NTREE_CHANGED_INTERFACE
any more, because thenode tree is not directly accessible from
bNodeTreeInterface
. Beforenode panels the API functions for interfaces could tag the tree directly
for later update consideration, which now requires explicit tagging
calls.
The fix is to add a flag and mutex directly to
bNodeTreeInterface
, soAPI methods can tag after updates. This mostly copies runtime data
concepts from
bNodeTree
. Theensure_interface_cache
method isequivalent to
ensure_topology_cache
and should be called beforeaccessing
interface_inputs
and similar cache data.@blender-bot build
Generally looks nice! My one large comment is that it probably makes more sense for
bNodeTreeInterfaceRuntime
to just be a storage of runtime data. It shouldn't need any methods of its own. That's howMeshRuntime
andCurvesGeometryRuntime
are handled, and I think it makes sense, because the only reason we have a separate runtime struct is because DNA doesn't handle storing the data directly in the struct.@ -1109,2 +1131,4 @@
parent->insert_item(new_socket->item, position);
}
tag_items_changed();
Functions in the class should be prefixed with
this->
to make that clear (same reason we use thethis->
prefix for non-private class variables).@ -1270,27 +1312,70 @@ void bNodeTreeInterface::foreach_id(LibraryForeachIDData *cb)
item_types::item_foreach_id(cb, root_panel.item);
}
This indirection doesn't seem necessary IMO. It would probably be simpler to just put the contents of
bNodeTreeInterfaceRuntime::ensure_items_cache
in here. That's also how it works for the geometry caches. The runtime struct just serves as storage for the cached data, it doesn't contain any functionality.EDIT: I wrote more about this in the top-level review comment.
@ -396,0 +414,4 @@
*/
void tag_items_changed();
protected:
Maybe
private
instead ofprotected
? Not sure this will be used as a base class ever.Seems to still say
protected
hereAdd update tags directly to bNodeTreeInterface to enable tagging by APIto Fix #111741: Add update tags directly in bNodeTreeInterface API methodsFix #111741: Add update tags directly in bNodeTreeInterface API methodsto Fix #112331: Add update tags directly in bNodeTreeInterface API methodsI moved almost all methods out of the runtime into the
bNodeTreeInterface
itself now. I've kept theitems
/inputs
/outputs
span accessors because of theinterface_items
/interface_inputs
/interface_outputs
methods inbNodeTree
. This way i can keep the runtime private with friend access only for thebNodeTreeInterface
.@ -27,0 +27,4 @@
/**
* Keeps track of what changed in the node tree until the next update.
* Should not be changed directly, instead use the functions in `BKE_node_tree_update.h`.
* #eNodeTreeChangedFlag.
NodeTreeInterfaceChangedFlag
@ -27,0 +44,4 @@
Vector<bNodeTreeInterfaceSocket *> outputs_;
public:
blender::Span<bNodeTreeInterfaceItem *> items() const
Are the public methods still necessary with
friend bNodeTreeInterface
? I'd think they could just be accessed directly there.They are accessed from
bNodeTree::interface_inputs
etc. Of course i can also make bNodeTree a friend too ...Ah I see, I think that makes sense
@ -1049,1 +1066,4 @@
item_types::item_read_data(reader, this->root_panel.item);
this->runtime = MEM_new<blender::bke::bNodeTreeInterfaceRuntime>(__func__);
tag_missing_runtime_data();
Missing
this->
for member function calls.@blender-bot build
@blender-bot build