diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-22 07:11:11 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-22 07:11:11 +0400 |
commit | 043e1536e5876f194923f1f6ab957c3396195210 (patch) | |
tree | 931c44986f372c40df1ec66fe3a4e37a37abd233 /source/blender/makesrna | |
parent | 2cd25f4cf528fe7911b45da609e34d46757ff57e (diff) |
add rna paths to toolsettings and its substructs, useful for python scripting.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 37 |
2 files changed, 49 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 663e09e5688..0b3fa569d4a 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1420,6 +1420,11 @@ static void rna_UnifiedPaintSettings_unprojected_radius_set(PointerRNA *ptr, flo ups->unprojected_radius = value; } +static char *rna_UnifiedPaintSettings_path(PointerRNA *ptr) +{ + return BLI_strdup("tool_settings.unified_paint_settings"); +} + /* note: without this, when Multi-Paint is activated/deactivated, the colors * will not change right away when multiple bones are selected, this function * is not for general use and only for the few cases where changing scene @@ -1449,6 +1454,11 @@ static void rna_SceneSequencer_update(Main *UNUSED(bmain), Scene *UNUSED(scene), BKE_sequencer_preprocessed_cache_cleanup(); } +static char *rna_ToolSettings_path(PointerRNA *ptr) +{ + return BLI_strdup("tool_settings"); +} + #else static void rna_def_transform_orientation(BlenderRNA *brna) @@ -1520,6 +1530,7 @@ static void rna_def_tool_settings(BlenderRNA *brna) }; srna = RNA_def_struct(brna, "ToolSettings", NULL); + RNA_def_struct_path_func(srna, "rna_ToolSettings_path"); RNA_def_struct_ui_text(srna, "Tool Settings", ""); prop = RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE); @@ -1836,6 +1847,7 @@ static void rna_def_unified_paint_settings(BlenderRNA *brna) PropertyRNA *prop; srna = RNA_def_struct(brna, "UnifiedPaintSettings", NULL); + RNA_def_struct_path_func(srna, "rna_UnifiedPaintSettings_path"); RNA_def_struct_ui_text(srna, "Unified Paint Settings", "Overrides for some of the active brush's settings"); /* high-level flags to enable or disable unified paint settings */ diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index cc1895541df..b12f7ff2414 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -190,6 +190,11 @@ static int rna_ParticleEdit_hair_get(PointerRNA *ptr) return 0; } +static char *rna_ParticleEdit_path(PointerRNA *ptr) +{ + return BLI_strdup("tool_settings.particle_edit"); +} + static int rna_Brush_mode_poll(PointerRNA *ptr, PointerRNA value) { Scene *scene = (Scene *)ptr->id.data; @@ -242,6 +247,33 @@ static void rna_Sculpt_ShowDiffuseColor_update(Main *UNUSED(bmain), Scene *scene } } +static char *rna_Sculpt_path(PointerRNA *ptr) +{ + return BLI_strdup("tool_settings.sculpt"); +} + +static char *rna_VertexPaint_path(PointerRNA *ptr) +{ + Scene *scene = (Scene *)ptr->id.data; + ToolSettings *ts = scene->toolsettings; + if (ptr->data == ts->vpaint) { + return BLI_strdup("tool_settings.vertex_paint"); + } + else { + return BLI_strdup("tool_settings.weight_paint"); + } +} + +static char *rna_ImagePaintSettings_path(PointerRNA *ptr) +{ + return BLI_strdup("tool_settings.image_paint"); +} + +static char *rna_UvSculpt_path(PointerRNA *ptr) +{ + return BLI_strdup("tool_settings.uv_sculpt"); +} + #else static void rna_def_paint(BlenderRNA *brna) @@ -283,6 +315,7 @@ static void rna_def_sculpt(BlenderRNA *brna) PropertyRNA *prop; srna = RNA_def_struct(brna, "Sculpt", "Paint"); + RNA_def_struct_path_func(srna, "rna_Sculpt_path"); RNA_def_struct_ui_text(srna, "Sculpt", ""); prop = RNA_def_property(srna, "radial_symmetry", PROP_INT, PROP_XYZ); @@ -368,6 +401,7 @@ static void rna_def_uv_sculpt(BlenderRNA *brna) StructRNA *srna; srna = RNA_def_struct(brna, "UvSculpt", "Paint"); + RNA_def_struct_path_func(srna, "rna_UvSculpt_path"); RNA_def_struct_ui_text(srna, "UV Sculpting", ""); } @@ -380,6 +414,7 @@ static void rna_def_vertex_paint(BlenderRNA *brna) srna = RNA_def_struct(brna, "VertexPaint", "Paint"); RNA_def_struct_sdna(srna, "VPaint"); + 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 */ @@ -408,6 +443,7 @@ static void rna_def_image_paint(BlenderRNA *brna) srna = RNA_def_struct(brna, "ImagePaint", "Paint"); RNA_def_struct_sdna(srna, "ImagePaintSettings"); + RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path"); RNA_def_struct_ui_text(srna, "Image Paint", "Properties of image and texture painting mode"); /* booleans */ @@ -492,6 +528,7 @@ static void rna_def_particle_edit(BlenderRNA *brna) srna = RNA_def_struct(brna, "ParticleEdit", NULL); RNA_def_struct_sdna(srna, "ParticleEditSettings"); + RNA_def_struct_path_func(srna, "rna_ParticleEdit_path"); RNA_def_struct_ui_text(srna, "Particle Edit", "Properties of particle editing mode"); prop = RNA_def_property(srna, "tool", PROP_ENUM, PROP_NONE); |