Nodes: Add bNodeInstanceKey to DerivedNodeTree #108900
No reviewers
Labels
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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#108900
Loading…
Reference in New Issue
No description provided.
Delete Branch "OmarEmaraDev/blender:derived-node-tree-instance-key"
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?
This patch adds support for bNodeInstanceKey to DerivedNodeTree. The
keys are computed and cached in the DContext at construction time, and
various utilities are added to return the instance keys of contexts,
nodes, as well as find the active context in the tree.
@ -194,0 +201,4 @@
* a representation of the node tree of that node group. Note that the context also stores the
* group node that the user selected to edit the node tree, so the context fully represents a
* particular instance of the node group. */
const DTreeContext &active_context() const;
active_context
sounds a bit like a wrong abstraction to me, mainly because you can have multiple node editors open at the same time.@JacquesLucke But there is still a concept of an active context even in that case, right?
Otherwise, what do you propose?
It might just be a matter of naming or improving the comment. The comment makes it sounds like the active context is the one that the user is currently editing, but that definition doesn't really work when there are multiple node editors. Instead, it seems like you derive the active context from the active viewer, which is probably only indirectly related to the context that the user is editing right now.
@JacquesLucke Your former definition which the comment implies is actually the more correct one as far as I can see. It is not actually derived from the active viewer, the name is probably misleading in that case. If you have multiple editors open with different context, the active one will be the one that the user is editing or is interacting with. You can try that by selecting a node in of the editors, which will make that context active.
Code seems ok. I wouldn't have done this mainly because it adds additional responsibilities to the
DerivedNodeTree
structure which was only concerned with providing an inlined view of thebNodeTree
before. But since the data structure is only used in one place, it should be fine to specialize it for that use case a bit.