The patch exposes the 2D cursor drawing as a distinguished option in the overlays panel of the Image Editor.
Details
Diff Detail
- Repository
- rB Blender
- Branch
- temp-sima2dcursor (branched from master)
- Build Status
Buildable 19322 Build 19322: arc lint + arc unit
Event Timeline
Personally I think this is a reasonable option to have, esp now that it exists for the 3D View as well.
In the past, Campbell had some reservations about introducing such options to the 3D View. So I'd like his opinion on this.
To complete this, a secondary patch I wanted to work on would be about blocking the cursor position while it is not drawn. I initially though to include it here for the image editor, but I think that should affect all the editors that have a cursor.
I honestly still haven't checked if there are already design tasks about this, but IMO being able to move the cursor while you don't see is a big problem, especially since there is no Undo for its position.
| source/blender/draw/intern/draw_view.c | ||
|---|---|---|
| 232–233 | G_TRANSFORM_CURSOR should be checked here. | |
| source/blender/makesdna/DNA_space_types.h | ||
| 1325 | This is off by default, you can follow 3D view V3D_OVERLAY_HIDE_CURSOR and flip the flag so it's visible by default (without the need for version patching). Also, reuse one of the existing SI_FLAG_UNUSED_* flags. | |
| source/blender/makesrna/intern/rna_space.c | ||
| 3519 | This should be added to the overlay struct. Name show_cursor following 3D view and sequencer. | |
- check for G_TRANSFORM_CURSOR in the drawing poll function
- renamed the new cursor flag to SI_OVERLAY_HIDE_CURSOR and move it in the eSpaceImageOverlay_Flag enum
- moved the rna definition in rna_def_space_image_overlay() and renamed the flag "show_cursor"
| source/blender/makesdna/DNA_space_types.h | ||
|---|---|---|
| 1325 |
Ok, I wasn't sure about the versioning aspect of using those.
The flag is already a boolean_negative in rna, I don't think I have to change something there, unless I'm missing something. | |
The overlay part of this patch seems fine, please remove other changes that rename/relocate the panel as they don't seem so relevant, adding an unresolved question in the patch text meaning it can't be committed as-is.
Re-arranging may be fine but can be done separately.
Reminder that patch submission text should be usable for the commit log:
- removed the ui reordering part, and placed the property inside the existing IMAGE_PT_overlay_image panel
Noticed some additional issues, suggest fewer changes P2782.
@Alessio Monti di Sopra (a.monti) do you see any issues with this change? If not, I'll update the patch and commit this.
| release/scripts/startup/bl_ui/space_image.py | ||
|---|---|---|
| 1627–1628 | Checking cursor drawing logic, if sima.mode not in {'VIEW', 'PAINT'}: matches the check in drawing code. | |
| source/blender/makesrna/intern/rna_space.c | ||
| 5445–5448 | This doesn't seem to be needed, other properties are only included because the checks involve more than a single value - where this is the same as checking mode == 'VIEW' | |
Yes it makes total sense, thank you!
Sorry about that, I was following the other checks done in the panels.