Page MenuHome

GPencil: Remove ID from operators to fix T82597
ClosedPublic

Authored by Antonio Vazquez (antoniov) on Nov 11 2020, 12:18 PM.

Details

Summary

Instead to use the ID of the object, now the parameter is an Enum with Selected object or New.

If use selected mode, the first grease pencil object selected is used. If none of the selected objects is a grease pencil object, a new object is created.

Diff Detail

Repository
rB Blender

Event Timeline

Antonio Vazquez (antoniov) requested review of this revision.Nov 11 2020, 12:18 PM
Antonio Vazquez (antoniov) created this revision.

Cleanup commit included by error

Generally fine, some details noted inline.

source/blender/editors/gpencil/gpencil_utils.c
3027–3040 ↗(On Diff #30960)

This could be made into a generic function, that takes the object type as an argument.

3030 ↗(On Diff #30960)

Prefer ob_found or ob_result.

source/blender/editors/gpencil/gpencil_mesh.c
230–232

There aren't any checks for the object data being editable (library data for example). This can be handled in a separate patch though.

  • Move the get selected object to shared module.
  • Rename variables.
Campbell Barton (campbellbarton) added inline comments.
source/blender/blenkernel/intern/layer_utils.c
195

bytype is not used anywhere by_type is, eg: UI_panel_find_by_type

This revision is now accepted and ready to land.Nov 13 2020, 10:46 AM