diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index ec719d90ef6..cfe8670b0f5 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -28,6 +28,7 @@ #include <stdlib.h> #include "RNA_define.h" +#include "RNA_enum_types.h" #include "rna_internal.h" @@ -75,13 +76,15 @@ EnumPropertyItem rna_enum_gpencil_sculpt_brush_items[] = { { 0, NULL, 0, NULL, NULL } }; -EnumPropertyItem rna_enum_gpencil_lockaxis_items[] = { +#ifndef RNA_RUNTIME +static EnumPropertyItem rna_enum_gpencil_lockaxis_items[] = { { GP_LOCKAXIS_NONE, "GP_LOCKAXIS_NONE", 0, "None", "" }, { GP_LOCKAXIS_X, "GP_LOCKAXIS_X", 0, "X", "Project strokes to plane locked to X" }, { GP_LOCKAXIS_Y, "GP_LOCKAXIS_Y", 0, "Y", "Project strokes to plane locked to Y" }, { GP_LOCKAXIS_Z, "GP_LOCKAXIS_Z", 0, "Z", "Project strokes to plane locked to Z" }, { 0, NULL, 0, NULL, NULL } }; +#endif EnumPropertyItem rna_enum_symmetrize_direction_items[] = { {BMO_SYMMETRIZE_NEGATIVE_X, "NEGATIVE_X", 0, "-X to +X", ""}, @@ -153,7 +156,7 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); SceneLayer *sl = CTX_data_scene_layer(C); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); PTCacheEdit *edit = PE_get_current(scene, sl, ob); if (!edit) @@ -165,7 +168,7 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *UNUSED(ptr)) static void rna_ParticleEdit_update(Main *UNUSED(bmain), Scene *UNUSED(scene), bContext *C, PointerRNA *UNUSED(ptr)) { SceneLayer *sl = CTX_data_scene_layer(C); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); if (ob) DEG_id_tag_update(&ob->id, OB_RECALC_DATA); } @@ -189,7 +192,7 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UN PropertyRNA *UNUSED(prop), bool *UNUSED(r_free)) { SceneLayer *sl = CTX_data_scene_layer(C); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); #if 0 Scene *scene = CTX_data_scene(C); PTCacheEdit *edit = PE_get_current(scene, ob); @@ -263,7 +266,7 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); SceneLayer *sl = CTX_data_scene_layer(C); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); if (ob) { DEG_id_tag_update(&ob->id, OB_RECALC_DATA); @@ -279,7 +282,7 @@ static void rna_Sculpt_update(bContext *C, PointerRNA *UNUSED(ptr)) static void rna_Sculpt_ShowDiffuseColor_update(bContext *C, Scene *scene, PointerRNA *UNUSED(ptr)) { SceneLayer *sl = CTX_data_scene_layer(C); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); if (ob && ob->sculpt) { Sculpt *sd = scene->toolsettings->sculpt; @@ -342,7 +345,7 @@ static void rna_ImaPaint_mode_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C);\ SceneLayer *sl = CTX_data_scene_layer(C); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); if (ob && ob->type == OB_MESH) { /* of course we need to invalidate here */ @@ -359,7 +362,7 @@ static void rna_ImaPaint_stencil_update(bContext *C, PointerRNA *UNUSED(ptr)) { Scene *scene = CTX_data_scene(C); SceneLayer *sl = CTX_data_scene_layer(C); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); if (ob && ob->type == OB_MESH) { GPU_drawobject_free(ob->derivedFinal); @@ -373,7 +376,7 @@ static void rna_ImaPaint_canvas_update(bContext *C, PointerRNA *UNUSED(ptr)) Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); SceneLayer *sl = CTX_data_scene_layer(C); - Object *ob = OBACT_NEW; + Object *ob = OBACT_NEW(sl); bScreen *sc; Image *ima = scene->toolsettings->imapaint.canvas; @@ -687,22 +690,20 @@ static void rna_def_vertex_paint(BlenderRNA *brna) RNA_def_struct_path_func(srna, "rna_VertexPaint_path"); RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode"); - /* vertex paint only */ - prop = RNA_def_property(srna, "use_normal", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS); - RNA_def_property_ui_text(prop, "Normals", "Apply the vertex normal before painting"); - RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - - prop = RNA_def_property(srna, "use_spray", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SPRAY); - RNA_def_property_ui_text(prop, "Spray", "Keep applying paint effect while holding mouse"); - RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); - /* weight paint only */ prop = RNA_def_property(srna, "use_group_restrict", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_ONLYVGROUP); + RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_FLAG_VGROUP_RESTRICT); RNA_def_property_ui_text(prop, "Restrict", "Restrict painting to vertices in the group"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); + + /* Mirroring */ + prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ); + RNA_def_property_int_sdna(prop, NULL, "radial_symm"); + RNA_def_property_int_default(prop, 1); + RNA_def_property_range(prop, 1, 64); + RNA_def_property_ui_range(prop, 1, 32, 1, 1); + RNA_def_property_ui_text(prop, "Radial Symmetry Count X Axis", + "Number of times to copy strokes across the surface"); } static void rna_def_image_paint(BlenderRNA *brna) |