[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18561] branches/blender2.5/blender/source /blender/makesrna: 2.5
Michael Fox
mfoxdogg at gmail.com
Sun Jan 18 12:05:56 CET 2009
Revision: 18561
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18561
Author: mfoxdogg
Date: 2009-01-18 12:05:56 +0100 (Sun, 18 Jan 2009)
Log Message:
-----------
2.5
*******
added RNA for the Vpaint settings
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
Added Paths:
-----------
branches/blender2.5/blender/source/blender/makesrna/intern/rna_vpaint.c
Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h 2009-01-18 10:46:26 UTC (rev 18560)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h 2009-01-18 11:05:56 UTC (rev 18561)
@@ -260,6 +260,7 @@
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;
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c 2009-01-18 10:46:26 UTC (rev 18560)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c 2009-01-18 11:05:56 UTC (rev 18561)
@@ -977,6 +977,7 @@
{"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}};
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h 2009-01-18 10:46:26 UTC (rev 18560)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h 2009-01-18 11:05:56 UTC (rev 18561)
@@ -138,6 +138,7 @@
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);
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c 2009-01-18 10:46:26 UTC (rev 18560)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c 2009-01-18 11:05:56 UTC (rev 18561)
@@ -134,6 +134,10 @@
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);
}
Added: branches/blender2.5/blender/source/blender/makesrna/intern/rna_vpaint.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_vpaint.c (rev 0)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_vpaint.c 2009-01-18 11:05:56 UTC (rev 18561)
@@ -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 <stdlib.h>
+
+#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
+
More information about the Bf-blender-cvs
mailing list