diff options
author | Antonioya <blendergit@gmail.com> | 2018-10-05 00:27:34 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2018-10-05 00:27:34 +0300 |
commit | 3a1e9b9997e33c059d08138da707ac16490fddf7 (patch) | |
tree | 770b8bf9c30d10ee4a0866e7f62b5e4cf23f79bc /source/blender/makesdna | |
parent | 65f77ccea1645f8c66fc171377641b08b62010e0 (diff) |
GP: Move grid parameters to GP object data level
The grid now can be configured by object because this helps to identify objects and allows to define diferent grid parameters for each objects.
Also added a color option.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_gpencil_types.h | 20 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_view3d_types.h | 11 |
2 files changed, 19 insertions, 12 deletions
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h index b533cb48886..d991bb34a0a 100644 --- a/source/blender/makesdna/DNA_gpencil_types.h +++ b/source/blender/makesdna/DNA_gpencil_types.h @@ -39,7 +39,6 @@ struct CurveMapping; struct GHash; struct MDeformVert; -/* TODO: add size as userprefs parameter */ #define GP_OBGPENCIL_DEFAULT_SIZE 0.2f #define GP_DEFAULT_PIX_FACTOR 1.0f #define GP_DEFAULT_GRID_LINES 4 @@ -325,6 +324,16 @@ typedef struct bGPdata_runtime { char pad_[6]; } bGPdata_runtime; +/* grid configuration */ +typedef struct bGPgrid { + float color[3]; + float scale[2]; + char _pad1[4]; + + int lines; + int axis; +} bGPgrid; + /* Grease-Pencil Annotations - 'DataBlock' */ typedef struct bGPdata { ID id; /* Grease Pencil data is a datablock */ @@ -366,6 +375,7 @@ typedef struct bGPdata { int totpoint; char pad_3[4]; bGPdata_runtime runtime; + bGPgrid grid; } bGPdata; /* bGPdata->flag */ @@ -461,6 +471,14 @@ typedef enum eGP_DepthOrdering { GP_XRAY_BACK = 2 } eGP_DepthOrdering; +/* gpencil_grid_axis */ +enum { + V3D_GP_GRID_AXIS_LOCK = (1 << 0), + V3D_GP_GRID_AXIS_X = (1 << 1), + V3D_GP_GRID_AXIS_Y = (1 << 2), + V3D_GP_GRID_AXIS_Z = (1 << 3), +}; + /* ***************************************** */ /* Mode Checking Macros */ diff --git a/source/blender/makesdna/DNA_view3d_types.h b/source/blender/makesdna/DNA_view3d_types.h index 7876153cbce..1b8846df4bc 100644 --- a/source/blender/makesdna/DNA_view3d_types.h +++ b/source/blender/makesdna/DNA_view3d_types.h @@ -190,10 +190,7 @@ typedef struct View3DOverlay { float wireframe_threshold; /* grease pencil settings */ - float gpencil_grid_scale[2]; float gpencil_paper_opacity; - int gpencil_grid_lines; - int gpencil_grid_axis; float gpencil_grid_opacity; char _pad1[4]; @@ -518,12 +515,4 @@ enum { #define RV3D_CAMZOOM_MIN_FACTOR 0.1657359312880714853f #define RV3D_CAMZOOM_MAX_FACTOR 44.9852813742385702928f -/* View3d.gpencil_grid_axis */ -enum { - V3D_GP_GRID_AXIS_LOCK = (1 << 0), - V3D_GP_GRID_AXIS_X = (1 << 1), - V3D_GP_GRID_AXIS_Y = (1 << 2), - V3D_GP_GRID_AXIS_Z = (1 << 3), -}; - #endif |