GPencil: Remove ID from operators to fix T82597

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.

Small cleanup changes to the original patch.

Differential Revision: https://developer.blender.org/D9529
This commit is contained in:
2020-11-13 13:17:17 +01:00
parent 50ccf346f0
commit e9b955b99c
5 changed files with 70 additions and 30 deletions

View File

@@ -79,6 +79,12 @@ typedef enum eGP_ReprojectModes {
GP_REPROJECT_KEEP,
} eGP_ReprojectModes;
/* Target object modes. */
typedef enum eGP_TargetObjectMode {
GP_TARGET_OB_NEW = 0,
GP_TARGET_OB_SELECTED = 1,
} eGP_TargetObjectMode;
/* ------------- Grease-Pencil Runtime Data ---------------- */
/* Temporary 'Stroke Point' data (2D / screen-space)