diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index fa8871ff378..dc7c69d020a 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -260,6 +260,7 @@ extern StructRNA RNA_UserPreferences; extern StructRNA RNA_UserSolidLight; extern StructRNA RNA_VectorFont; extern StructRNA RNA_VertexGroup; +extern StructRNA RNA_VPaint; extern StructRNA RNA_VertexGroupElement; extern StructRNA RNA_WaveModifier; extern StructRNA RNA_WindowManager; diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index d61bd5a8fba..29c3ee36758 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -977,6 +977,7 @@ RNAProcessItem PROCESS_ITEMS[]= { {"rna_sound.c", RNA_def_sound}, {"rna_userdef.c", RNA_def_userdef}, {"rna_vfont.c", RNA_def_vfont}, + {"rna_vpaint.c", RNA_def_vpaint}, {"rna_wm.c", RNA_def_wm}, {"rna_world.c", RNA_def_world}, {NULL, NULL}}; diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 55610266312..c4a44a5a8d5 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -138,6 +138,7 @@ void RNA_def_texture(struct BlenderRNA *brna); void RNA_def_sound(struct BlenderRNA *brna); void RNA_def_userdef(struct BlenderRNA *brna); void RNA_def_vfont(struct BlenderRNA *brna); +void RNA_def_vpaint(struct BlenderRNA *brna); void RNA_def_wm(struct BlenderRNA *brna); void RNA_def_world(struct BlenderRNA *brna); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index f1b13780439..2b88a539572 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -134,6 +134,10 @@ void rna_def_tool_settings(BlenderRNA *brna) prop= RNA_def_property(srna, "sculpt", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "Sculpt"); RNA_def_property_ui_text(prop, "Sculpt", ""); + + prop= RNA_def_property(srna, "vpaint", PROP_POINTER, PROP_NONE); + RNA_def_property_struct_type(prop, "VPaint"); + RNA_def_property_ui_text(prop, "Vertex Paint", ""); rna_def_sculpt(brna); } diff --git a/source/blender/makesrna/intern/rna_vpaint.c b/source/blender/makesrna/intern/rna_vpaint.c new file mode 100644 index 00000000000..ae3491e857e --- /dev/null +++ b/source/blender/makesrna/intern/rna_vpaint.c @@ -0,0 +1,100 @@ +/** + * $Id$ + * + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * Contributor(s): Campbell Barton + * + * ***** END GPL LICENSE BLOCK ***** + */ + +#include + +#include "RNA_define.h" +#include "RNA_types.h" + +#include "rna_internal.h" + +#include "DNA_scene_types.h" + +#ifdef RNA_RUNTIME + +#else + +void RNA_def_vpaint(BlenderRNA *brna) +{ + StructRNA *srna; + PropertyRNA *prop; + static EnumPropertyItem prop_mode_items[] = { + {0, "MIX", "Mix", "Use mix blending mode while painting."}, + {1, "ADD", "Add", "Use add blending mode while painting."}, + {2, "SUB", "Subtract", "Use subtract blending mode while painting."}, + {3, "MUL", "Multiply", "Use multiply blending mode while painting."}, + {4, "BLUR", "Blur", "Blur the color with surrounding values"}, + {5, "LIGHTEN", "Lighten", "Use lighten blending mode while painting."}, + {6, "DARKEN", "Darken", "Use darken blending mode while painting."}, + {0, NULL, NULL, NULL}}; + + srna= RNA_def_struct(brna, "VPaint", NULL); + RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of the Vpaint tool."); + + prop= RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_items(prop, prop_mode_items); + RNA_def_property_ui_text(prop, "Brush Mode", "The Mode in which color is painted."); + + 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."); + + 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, "color", PROP_FLOAT, PROP_COLOR); + RNA_def_property_float_sdna(prop, NULL, "r"); + RNA_def_property_array(prop, 3); + RNA_def_property_ui_text(prop, "Color", "Brush color."); + + prop= RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_NONE); + RNA_def_property_float_sdna(prop, NULL, "a"); + RNA_def_property_range(prop, 0.0f, 1.0f); + RNA_def_property_ui_text(prop, "Opacity", "Brush Opacity."); + + prop= RNA_def_property(srna, "size", PROP_FLOAT, PROP_NONE); + RNA_def_property_range(prop, 2.0f, 64.0f); + RNA_def_property_ui_text(prop, "Size", "Brush Size."); + + 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", "Vpaint 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", "Vpaint Mul."); + +} + +#endif +