Page MenuHome

Proposed fix for T71497 - Split annotation operators and pointer functions
ClosedPublic

Authored by Antonio Vazquez (antoniov) on Dec 22 2019, 11:06 AM.

Details

Summary

This allows to have annotation panels and grease pencil object panel at the same time.

The patch fix main issues:

  1. The get pointer functions were shared between GPencil object and Annotations. Now, these functions are different and the grease pencil version has been simplified.
  1. Some operators were shared and it was impossible detect what mode was running. Now the operators are different, and this allows to use different poll functions, but the exec code is shared using an internal parameter.
  1. The Annotation Tool was not available in GPencil Paint, Sculpt and Weignt Paint modes.

As result of this split, now both panels are visible and the tooltips are different.

Related to T71497 and T72717

Diff Detail

Repository
rB Blender

Event Timeline

Antonio Vazquez (antoniov) retitled this revision from Annotations: Split annotation operators and pointer functions to Proposed fix for T71497 - Split annotation operators and pointer functions.Dec 22 2019, 11:11 AM
Antonio Vazquez (antoniov) edited the summary of this revision. (Show Details)
Antonio Vazquez (antoniov) edited the summary of this revision. (Show Details)
  • Make Annotation Tool visible in GPencil modes
  • Fix problems in Dopesheet in Edit mode (T72717)
This revision is now accepted and ready to land.Jan 6 2020, 12:21 PM

All the "XXX: see comment for gpencil_data case" should be removed, right?

I haven't tested the patch yet, but anything is better than the current situation ;)

Wondering if we should rename GPENCIL_OT_data_add to what it is. It shows in bpy.ops...

source/blender/editors/gpencil/gpencil_utils.c
103–105

Why is this part of the patch?

source/blender/editors/gpencil/gpencil_utils.c
103–105

Because it fix a bug related.

@Dalai Felinto (dfelinto) What name do you propose for GPENCIL_OT_data_add?

Maybe GPENCIL_OT_annotation_add?

  • Remove old comments
  • Rename add datablock operator
Dalai Felinto (dfelinto) requested changes to this revision.Jan 7 2020, 11:04 AM
Dalai Felinto (dfelinto) added inline comments.
source/blender/editors/gpencil/gpencil_data.c
268

See my comment about is_annotation elsewhere

365

This makes no sense. When would this operator be called for something that is not an annotation?

For the users (Python developers anyways) it shows as:

bpy.ops.gpencil.layer_annotation_remove(is_annotation=True)

Confusing, right? I know what you mean to do, but you need to either have its own dedicated _exec function that then calls gp_layer_remove_exec or to get the operator name (see collection_objects_select_exec).

2227–2229

See other comments re: comments code-style

source/blender/editors/gpencil/gpencil_utils.c
103–105
- case SPACE_TOPBAR:     /* Topbar (needed after topbar merge) */
+ case SPACE_TOPBAR:

Or explain WHY it is needed, that is needed it is obvious given the code itself.

138

See other comments regarding comment code-style

source/blender/editors/screen/screen_context.c
520

Remove the XXX bit

542

Keep the comment in a single line?

547

Use first capital letter with full stop for comments.

- /* get pointer to Grease Pencil Data */
+ /* Get pointer to Grease Pencil Data. */
554–555

Remove this.

This revision now requires changes to proceed.Jan 7 2020, 11:04 AM
  • Fix comments and remove is_annotation parm
This revision is now accepted and ready to land.Jan 7 2020, 11:28 AM