Page MenuHome

Hide 3D Cursor in Paint Modes (with exceptions)
ClosedPublic

Authored by Julian Eisel (Severin) on Feb 15 2015, 5:20 PM.

Details

Summary

Hide 3D Cursor in Paint Modes (with exceptions)

In paint modes, the 3D Cursor mostly is rather useless so it's more annoying than useful. This patch aims to hide the cursor in cases it's not used.

Included exceptions (cases where cursor is drawn in paint modes):

  • Active object is in weight paint mode and a selected bone in pose mode can be found
  • Clone brush (only if Clone from paint slot is disabled)

There might be more exceptions where the cursor should be shown in paint modes, but those are all I could find for now. Feel free to hint me for more.

Note: After D1110 was rejected, Campbell and me discussed this a bit more on IRC and agreed that this behaviour might be a good solution.

Diff Detail

Event Timeline

Julian Eisel (Severin) updated this revision to Diff 3539.
Julian Eisel (Severin) retitled this revision from to Hide 3D Cursor in Paint Modes (with exceptions).
Julian Eisel (Severin) updated this object.
Julian Eisel (Severin) set the repository for this revision to rB Blender.

Not sure if it's good to use NA_SELECTED for brush changes, but using NA_EDITED would mean we had to use ED_region_tag_redraw instead of ED_region_tag_redraw_overlay and I guess this would be much slower. I'm all ears for alternatives.

source/blender/editors/space_view3d/space_view3d.c
834

In instead of catching this notifier (which will fire on too many other cases), you can fire two different notifiers for the relevant property.

source/blender/editors/space_view3d/view3d_draw.c
3610

You must check the active paint mode as well, not only the tool. Probably should only be checked if there is an active object.

3616

Nope, we should draw by default.

Campbell Barton (campbellbarton) requested changes to this revision.Feb 15 2015, 9:21 PM
Campbell Barton (campbellbarton) edited edge metadata.
Campbell Barton (campbellbarton) added inline comments.
source/blender/editors/space_view3d/view3d_draw.c
3583

Could be called only when you know the objects in paint mode.

3595–3605

This should be a direct check. searching over all objects is overkill (If we _had_ to do this, then I'd rather just not have the functionality).

But theres no need for it Instead check (BKE_object_pose_armature_get(ob) != NULL)

This revision now requires changes to proceed.Feb 15 2015, 9:21 PM
Julian Eisel (Severin) edited edge metadata.
Julian Eisel (Severin) set the repository for this revision to rB Blender.
Julian Eisel (Severin) set the repository for this revision to rB Blender.
Campbell Barton (campbellbarton) edited edge metadata.

much better!, reads clearly and not doing any excessive checking.

This revision is now accepted and ready to land.Feb 16 2015, 1:08 AM

minor suggestion

source/blender/editors/space_view3d/space_view3d.c
910–913

Its not very obvious why the notifier is needed. Probably should include comment.

(relationship with 3dview cursor & clone brush)

Julian Eisel (Severin) edited edge metadata.

Add comment to 3D View brush listener