diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_300.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/annotate_paint.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_defaults.h | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 32 |
6 files changed, 23 insertions, 28 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 776f6c54363..1d46c0d5790 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -1115,8 +1115,6 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "gpencil_v3d_align")) { ts->gpencil_v3d_align = GP_PROJECT_VIEWSPACE; ts->gpencil_v2d_align = GP_PROJECT_VIEWSPACE; - ts->gpencil_seq_align = GP_PROJECT_VIEWSPACE; - ts->gpencil_ima_align = GP_PROJECT_VIEWSPACE; } } diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c index 4dcb7414bb4..e46073ba0de 100644 --- a/source/blender/blenloader/intern/versioning_300.c +++ b/source/blender/blenloader/intern/versioning_300.c @@ -663,6 +663,12 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + /* Set default 2D annotation placement. */ + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + ToolSettings *ts = scene->toolsettings; + ts->gpencil_v2d_align = GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR; + } } /** diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index 4b0c5ccd285..9bf44370c80 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -1320,7 +1320,7 @@ static bool annotation_session_initdata(bContext *C, tGPsdata *p) p->area = curarea; p->region = region; p->v2d = ®ion->v2d; - p->align_flag = &ts->gpencil_seq_align; + p->align_flag = &ts->gpencil_v2d_align; /* check that gpencil data is allowed to be drawn */ if (sseq->mainb == SEQ_DRAW_SEQUENCE) { @@ -1339,7 +1339,7 @@ static bool annotation_session_initdata(bContext *C, tGPsdata *p) p->area = curarea; p->region = region; p->v2d = ®ion->v2d; - p->align_flag = &ts->gpencil_ima_align; + p->align_flag = &ts->gpencil_v2d_align; break; } case SPACE_CLIP: { diff --git a/source/blender/makesdna/DNA_scene_defaults.h b/source/blender/makesdna/DNA_scene_defaults.h index 1a2a8892e64..61707964191 100644 --- a/source/blender/makesdna/DNA_scene_defaults.h +++ b/source/blender/makesdna/DNA_scene_defaults.h @@ -374,8 +374,6 @@ /* GP Stroke Placement */ \ .gpencil_v3d_align = GP_PROJECT_VIEWSPACE, \ .gpencil_v2d_align = GP_PROJECT_VIEWSPACE, \ - .gpencil_seq_align = GP_PROJECT_VIEWSPACE, \ - .gpencil_ima_align = GP_PROJECT_VIEWSPACE, \ } /* clang-format off */ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index 31352b2c8f4..000db5bf5b1 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1409,10 +1409,7 @@ typedef struct ToolSettings { char gpencil_v3d_align; /** General 2D Editor. */ char gpencil_v2d_align; - /** Sequencer Preview. */ - char gpencil_seq_align; - /** Image Editor. */ - char gpencil_ima_align; + char _pad0[2]; /* Annotations */ /** Stroke placement settings - 3D View. */ diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5c9c7b50339..6a28cf34965 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2834,7 +2834,18 @@ static void rna_def_tool_settings(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; - static const EnumPropertyItem annotation_stroke_placement_items[] = { + static const EnumPropertyItem annotation_stroke_placement_view2d_items[] = { + {GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR, + "IMAGE", + ICON_IMAGE_DATA, + "Image", + "Strick stroke to the image"}, + /* Weird, GP_PROJECT_VIEWALIGN is inverted. */ + {0, "VIEW", ICON_RESTRICT_VIEW_ON, "View", "Stick stroke to the view"}, + {0, NULL, 0, NULL, NULL}, + }; + + static const EnumPropertyItem annotation_stroke_placement_view3d_items[] = { {GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR, "CURSOR", ICON_PIVOT_CURSOR, @@ -3338,30 +3349,15 @@ static void rna_def_tool_settings(BlenderRNA *brna) /* Annotations - 2D Views Stroke Placement */ prop = RNA_def_property(srna, "annotation_stroke_placement_view2d", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_v2d_align"); - RNA_def_property_enum_items(prop, annotation_stroke_placement_items); + RNA_def_property_enum_items(prop, annotation_stroke_placement_view2d_items); RNA_def_property_ui_text(prop, "Stroke Placement (2D View)", ""); RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - /* Annotations - Sequencer Preview Stroke Placement */ - prop = RNA_def_property( - srna, "annotation_stroke_placement_sequencer_preview", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_seq_align"); - RNA_def_property_enum_items(prop, annotation_stroke_placement_items); - RNA_def_property_ui_text(prop, "Stroke Placement (Sequencer Preview)", ""); - RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - - /* Annotations - Image Editor Stroke Placement */ - prop = RNA_def_property(srna, "annotation_stroke_placement_image_editor", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_bitflag_sdna(prop, NULL, "gpencil_ima_align"); - RNA_def_property_enum_items(prop, annotation_stroke_placement_items); - RNA_def_property_ui_text(prop, "Stroke Placement (Image Editor)", ""); - RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, NULL); - /* Annotations - 3D View Stroke Placement */ /* XXX: Do we need to decouple the stroke_endpoints setting too? */ prop = RNA_def_property(srna, "annotation_stroke_placement_view3d", PROP_ENUM, PROP_NONE); RNA_def_property_enum_bitflag_sdna(prop, NULL, "annotate_v3d_align"); - RNA_def_property_enum_items(prop, annotation_stroke_placement_items); + RNA_def_property_enum_items(prop, annotation_stroke_placement_view3d_items); RNA_def_property_enum_default(prop, GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR); RNA_def_property_ui_text(prop, "Annotation Stroke Placement (3D View)", |