Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonioya <blendergit@gmail.com>2019-02-23 13:34:23 +0300
committerAntonioya <blendergit@gmail.com>2019-02-23 13:46:24 +0300
commit8214a1ae34ad7a08585813fc9234f927ea89a3dc (patch)
tree2e486fd18ec5b37c68118cc929fd88a653db59bb /source/blender/makesrna
parent702a2ba0ef93f2f5a8544565b15c04dba73206c3 (diff)
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)
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 2409f12daf2..b60409225ce 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -51,6 +51,12 @@ static const EnumPropertyItem parent_type_items[] = {
};
#ifndef RNA_RUNTIME
+static EnumPropertyItem rna_enum_gpencil_drawmodes_items[] = {
+ {GP_DRAWMODE_2D, "2D", 0, "2D Layers", "Draw strokes using grease pencil layers to define order"},
+ {GP_DRAWMODE_3D, "3D", 0, "3D Location", "Draw strokes using real 3D position in 3D space"},
+ {0, NULL, 0, NULL, NULL},
+};
+
static EnumPropertyItem rna_enum_gpencil_xraymodes_items[] = {
{GP_XRAY_FRONT, "FRONT", 0, "Front", "Draw all strokes in front"},
{GP_XRAY_3DSPACE, "3DSPACE", 0, "3D Space", "Draw strokes relative to other objects in 3D space"},
@@ -1490,6 +1496,14 @@ static void rna_def_gpencil_data(BlenderRNA *brna)
RNA_def_property_srna(prop, "IDMaterials"); /* see rna_ID.c */
RNA_def_property_collection_funcs(prop, NULL, NULL, NULL, NULL, NULL, NULL, NULL, "rna_IDMaterials_assign_int");
+ /* draw modes */
+ prop = RNA_def_property(srna, "draw_mode", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "draw_mode");
+ RNA_def_property_enum_items(prop, rna_enum_gpencil_drawmodes_items);
+ RNA_def_property_ui_text(prop, "Mode",
+ "Defines how the strokes are ordered in 3D space");
+ RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
+
/* xray modes */
prop = RNA_def_property(srna, "xray_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "xray_mode");