diff options
author | Antonioya <blendergit@gmail.com> | 2019-05-14 12:57:32 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-05-14 12:59:19 +0300 |
commit | 254b1a4294d06ae44f45a68b6756787392ce1fc1 (patch) | |
tree | 8e60a89bc9965867483ba334cc63a7f31061d930 /source/blender/makesrna/intern/rna_material.c | |
parent | 21bfc469abb88c171bb04379644a8595c31b8e12 (diff) |
Fix T64441: GPencil textures weird rotation
New option to disable the follow drawing path. Before it had only a switch property, now there is a list of options.
Modes:
Path: Follows drawing stroke and rotate with object.
Object: Only follows object rotation.
None: Don't rotate.
Diffstat (limited to 'source/blender/makesrna/intern/rna_material.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_material.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index d66b4e5be44..a27ed00228e 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -440,6 +440,13 @@ static void rna_def_material_greasepencil(BlenderRNA *brna) {0, NULL, 0, NULL, NULL}, }; + static EnumPropertyItem follow_draw_items[] = { + {GP_STYLE_FOLLOW_PATH, "PATH", 0, "Path", "Follow stroke drawing path and object rotation"}, + {GP_STYLE_FOLLOW_OBJ, "OBJECT", 0, "Object", "Follow object rotation only"}, + {GP_STYLE_FOLLOW_NONE, "NONE", 0, "None", "Do not follow drawing path or object rotation"}, + {0, NULL, 0, NULL, NULL}, + }; + srna = RNA_def_struct(brna, "MaterialGPencilStyle", NULL); RNA_def_struct_sdna(srna, "MaterialGPencilStyle"); RNA_def_struct_ui_text(srna, "Grease Pencil Color", ""); @@ -611,10 +618,12 @@ static void rna_def_material_greasepencil(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Show Fill", "Show stroke fills of this material"); RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_update"); - /* keep Dots and Boxes aligned to screen and not to drawing path */ - prop = RNA_def_property(srna, "use_follow_path", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_STYLE_COLOR_LOCK_DOTS); - RNA_def_property_ui_text(prop, "Follow Path", "Keep Dots and Boxes aligned to drawing path"); + /* Mode to align Dots and Boxes to drawing path and object rotation */ + prop = RNA_def_property(srna, "use_follow_path", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "follow_mode"); + RNA_def_property_enum_items(prop, follow_draw_items); + RNA_def_property_ui_text( + prop, "Follow Path", "Rotate Dots and Boxes aligned to drawing path and object rotation"); RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, "rna_MaterialGpencil_nopreview_update"); /* pass index for future compositing and editing tools */ |