Navigation Gizmo for Node Editors

After watching the “Beginning developer workshop” at bcon22, I thought working on adding the navigation gizmo from other 2D editors to the Node Editors would be a task I could tackle. Disclaimer, I am not a programmer and know next to nothing about C/C++, and go on primarily by a lot of grep’ing and extrapolation. Big ups to @Fweeb and @gfxcoder for helping me get past some initial hurdles after their presentation, and for being amazing people in general!

I’ve come as far as adding the “Show Gizmo” toggle button to the Node Editors headers, but I am having trouble adding the actual Pan and Zoom buttons and functionality to the editors. Going by the other editors, fx. the Image Editor, I’m guessing this is in ‘source/blender/editors/space_image/image_ops.c’? What I am stuck at now, is that the code under ‘source/blender/editors/space_node/’ is C++ I think, so I can’t just take and adapt the code from the other editors unfortunately. Can you recommend me to look somewhere I can extrapolate from, or does this require deeper knowledge of C++ to code it from scratch?

To feel not like a total failed attempt, I’ve added the “Show Gizmo” toggle to the Movie Clip Editor where it was missing even though the pan/zoom controls are there. The patch is here:
https://developer.blender.org/D16437

I’d just really like to finish what I had set out to do, and add this functionality to the Node Editors. Any guidance would be much appreciated! I can post the diff of what I’ve done so far if that helps?

1 Like

Maybe this similar patch might help you…
https://developer.blender.org/D14532

LOL serves me right for not searching for this beforehand, of course someone else thought of this. Should be obvious since this functionality really does seem like “low hanging fruit” for consistency. Thanks for pointing it out to me.

The difference I can see compared to where I hit the wall, is a lot more files are touched with lines of ‘WM_GIZMOGROUPTYPE_DRAWSTEP_3D’ which I’ll see if I can wrap my head around. His patch also adds more toggles such as for the node backdrop. Sad that this has gone unreviewed for 8 months.

At least I finished a, much simpler, patch for the gizmo toggle for the Movie Clip Editor, but maybe that will also die on the vine?

You can definitely improve your chances of that not happening! Check the Ingredients of a Patch and Finding Reviewers sections of the wiki.

Some things that may help your patch:

  • Even with small UI changes it’s always nice to have a screenshot showing a before and after. It makes it much easier to see what’s going on and allows reviewers to give you feedback without having to apply your patch. (For easily repeatable screenshots you can even use Blender’s built in screenshot functionality “Window” > “Save Screenshot (Editor)”)
  • For reviewers it’s helpful to have context in your patch. Adding -U1000 when creating the diff will usually include enough.

Thanks for the pointers, added an image to D16437 now. Will try and find a developer who will hopefully assign a reviewer to it.

2 Likes