diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-11-25 20:51:16 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-11-25 20:51:16 +0300 |
commit | 55d2a56d6020a5d286d5d44f7d2d8a8d0bc9bf58 (patch) | |
tree | 959cb7abcf1ab92caa28fa5a5156520f08f9936d /source/blender/makesrna/intern/rna_sculpt_paint.c | |
parent | 077edbb384e3845f27cc06618046a08c7101cc4c (diff) | |
parent | f1fa79a59554cb36ebee0a569a7b0f442fef6646 (diff) |
Sculpt:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r24483:24889
Diffstat (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index f365f053e79..e2a8e9f2131 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -142,6 +142,21 @@ static int rna_ParticleEdit_hair_get(PointerRNA *ptr) return (edit && edit->psys); } + +static void rna_Paint_active_brush_index_set(PointerRNA *ptr, int value) +{ + Paint *p= ptr->data; + CLAMP(value, 0, p->brush_count-1); + p->active_brush_index= value; +} + +static void rna_Paint_active_brush_index_range(PointerRNA *ptr, int *min, int *max) +{ + Paint *p= ptr->data; + *min= 0; + *max= MAX2(p->brush_count-1, 0); +} + #else static void rna_def_paint(BlenderRNA *brna) @@ -158,11 +173,13 @@ static void rna_def_paint(BlenderRNA *brna) "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_dereference_get", - "rna_Paint_brushes_length", 0, 0, 0, 0); + "rna_Paint_brushes_length", 0, 0); RNA_def_property_ui_text(prop, "Brushes", "Brushes selected for this paint mode."); prop= RNA_def_property(srna, "active_brush_index", PROP_INT, PROP_NONE); - RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_int_funcs(prop, NULL, "rna_Paint_active_brush_index_set", "rna_Paint_active_brush_index_range"); + RNA_def_property_range(prop, 0, INT_MAX); + RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL); /* Fake property to get active brush directly, rather than integer index */ prop= RNA_def_property(srna, "brush", PROP_POINTER, PROP_NONE); @@ -170,6 +187,7 @@ static void rna_def_paint(BlenderRNA *brna) RNA_def_property_pointer_funcs(prop, "rna_Paint_active_brush_get", "rna_Paint_active_brush_set", NULL); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Brush", "Active paint brush."); + RNA_def_property_update(prop, NC_BRUSH|NA_EDITED, NULL); prop= RNA_def_property(srna, "show_brush", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flags", PAINT_SHOW_BRUSH); @@ -238,11 +256,7 @@ static void rna_def_vertex_paint(BlenderRNA *brna) prop= RNA_def_property(srna, "all_faces", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_AREA); RNA_def_property_ui_text(prop, "All Faces", "Paint on all faces inside brush."); - - prop= RNA_def_property(srna, "vertex_dist", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_SOFT); - RNA_def_property_ui_text(prop, "Vertex Dist", "Use distances to vertices (instead of paint entire faces)."); - + prop= RNA_def_property(srna, "normals", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", VP_NORMALS); RNA_def_property_ui_text(prop, "Normals", "Applies the vertex normal before painting."); @@ -250,14 +264,6 @@ static void rna_def_vertex_paint(BlenderRNA *brna) prop= RNA_def_property(srna, "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."); - - prop= RNA_def_property(srna, "gamma", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.1f, 5.0f); - RNA_def_property_ui_text(prop, "Gamma", "Vertex paint Gamma."); - - prop= RNA_def_property(srna, "mul", PROP_FLOAT, PROP_NONE); - RNA_def_property_range(prop, 0.1f, 50.0f); - RNA_def_property_ui_text(prop, "Mul", "Vertex paint Mul."); } static void rna_def_image_paint(BlenderRNA *brna) |