Page MenuHome

Cleanup: Simplify node editor link dragging storage
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Nov 17 2021, 12:26 AM.

Details

Summary

Now that node_intern.hh is a C++ header, we can use C++ types
there. This patch replaces the linked list of dragged links with a
vector. Also, the list of drag operator custom data, nldrag, doesn't
seem to need to be a list at all, so I just made it a unique pointer.

Diff Detail

Repository
rB Blender
Branch
cleanup-nldrag-types (branched from master)
Build Status
Buildable 18765
Build 18765: arc lint + arc unit

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Nov 17 2021, 12:26 AM
Hans Goudey (HooglyBoogly) created this revision.
Hans Goudey (HooglyBoogly) planned changes to this revision.Nov 17 2021, 12:26 AM

Actually, I honestly don't know why bNodeLinkDrag::links has to be a vector rather than just a single item either. Can you even drag multiple links at the same time? Or maybe I'm missing something.

It is possible to drag multiple links. E.g. by holding ctrl.

Wow, cool! Thanks, I'll keep the vector.

  • Merge branch 'master' into cleanup-nldrag-types
Jacques Lucke (JacquesLucke) requested changes to this revision.Nov 19 2021, 8:48 AM
Jacques Lucke (JacquesLucke) added inline comments.
source/blender/editors/space_node/space_node.cc
537

That change looks wrong. Now both spaces may point to the same runtime data I think. I think it's good to copy the runtime data, and ignore some elements explicitly. Long-term it's unlikely that we never want to copy any runtime data over.

This revision now requires changes to proceed.Nov 19 2021, 8:48 AM
  • null new region's runtime struct when copying

Unless there is a good reason to copy anything now, I don't think it's necessary
actually.

This revision is now accepted and ready to land.Nov 19 2021, 5:50 PM