From 8214a1ae34ad7a08585813fc9234f927ea89a3dc Mon Sep 17 00:00:00 2001 From: Antonioya Date: Sat, 23 Feb 2019 11:34:23 +0100 Subject: GP: Define new Draw Mode Add a new Draw Mode to display panel in order to define the z-.depth order of the strokes using the real 3D position and not the 2D layer position. This change makes possible to use VR with grease pencil drawings because the depth of the strokes change with camera position. Also, provide an alternative solution to tasks: T57859, T60325, The parameter only works with 3D space depth ordering. The Back and Front depths are incompatible with 3D Space mode. Options are: - Back - Front - 3D Space->2D Layers (default) -3D Space->3D Location (new mode) --- source/blender/makesdna/DNA_gpencil_types.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna/DNA_gpencil_types.h') diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index 4f9de5e6fd8..3c5b90acd60 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -510,7 +510,11 @@ typedef struct bGPdata { char _pad2[6]; int totstroke; int totpoint; - char _pad3[4]; + + /** Draw mode for strokes (eGP_DrawMode). */ + short draw_mode; + char _pad3[2]; + bGPgrid grid; bGPdata_Runtime runtime; @@ -616,6 +620,12 @@ typedef enum eGP_DepthOrdering { GP_XRAY_BACK = 2, } eGP_DepthOrdering; +/* draw modes (Use 2D or 3D position) */ +typedef enum eGP_DrawMode { + GP_DRAWMODE_2D = 0, + GP_DRAWMODE_3D = 1 +} eGP_DrawMode; + /* ***************************************** */ /* Mode Checking Macros */ -- cgit v1.2.3