[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17666] branches/blender2.5/blender/source /blender/makesrna: RNA: Curves and VFont
Juho Vepsalainen
bebraw at gmail.com
Mon Dec 1 20:02:28 CET 2008
Revision: 17666
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17666
Author: bebraw
Date: 2008-12-01 20:02:27 +0100 (Mon, 01 Dec 2008)
Log Message:
-----------
RNA: Curves and VFont
Implemented RNA wrappers for curves and VFont. Only issue I could
not yet solve is related to struct CharInfo curinfo; . This particular
line proved to be hard to wrap and I therefore marked it as a TODO
should someone want to fix this issue.
I also cleaned up makesrna.c a bit by unifying brush/meta parts
under one call just the way it is done in the case of other
wrappers.
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_ID.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_meta.c
Added Paths:
-----------
branches/blender2.5/blender/source/blender/makesrna/intern/rna_curve.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_vfont.c
Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h 2008-12-01 16:59:18 UTC (rev 17665)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h 2008-12-01 19:02:27 UTC (rev 17666)
@@ -41,8 +41,10 @@
extern StructRNA RNA_Brush;
extern StructRNA RNA_BrushClone;
extern StructRNA RNA_Camera;
+extern StructRNA RNA_CharInfo;
extern StructRNA RNA_CollectionProperty;
extern StructRNA RNA_CollisionSensor;
+extern StructRNA RNA_Curve;
extern StructRNA RNA_CurveMap;
extern StructRNA RNA_CurveMapPoint;
extern StructRNA RNA_CurveMapping;
@@ -112,8 +114,10 @@
extern StructRNA RNA_Sensor;
extern StructRNA RNA_StringProperty;
extern StructRNA RNA_Struct;
+extern StructRNA RNA_TextBox;
extern StructRNA RNA_TouchSensor;
extern StructRNA RNA_UnknownType;
+extern StructRNA RNA_VFont;
extern StructRNA RNA_WindowManager;
extern StructRNA RNA_World;
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c 2008-12-01 16:59:18 UTC (rev 17665)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c 2008-12-01 19:02:27 UTC (rev 17666)
@@ -878,11 +878,10 @@
{"rna_ID.c", RNA_def_ID},
{"rna_actuator.c", RNA_def_actuator},
{"rna_brush.c", RNA_def_brush},
- {"rna_brush.c", RNA_def_brushclone},
{"rna_camera.c", RNA_def_camera},
{"rna_color.c", RNA_def_color},
{"rna_controller.c", RNA_def_controller},
- {"rna_property.c", RNA_def_gameproperty},
+ {"rna_curve.c", RNA_def_curve},
{"rna_group.c", RNA_def_group},
{"rna_image.c", RNA_def_image},
{"rna_ipo.c", RNA_def_ipo},
@@ -891,16 +890,17 @@
{"rna_main.c", RNA_def_main},
{"rna_material.c", RNA_def_material},
{"rna_mesh.c", RNA_def_mesh},
- {"rna_meta.c", RNA_def_metaball},
- {"rna_meta.c", RNA_def_metaelem},
+ {"rna_meta.c", RNA_def_meta},
{"rna_modifier.c", RNA_def_modifier},
{"rna_nodetree.c", RNA_def_nodetree},
{"rna_object.c", RNA_def_object},
+ {"rna_property.c", RNA_def_gameproperty},
{"rna_radio.c", RNA_def_radio},
{"rna_rna.c", RNA_def_rna},
{"rna_scene.c", RNA_def_scene},
{"rna_screen.c", RNA_def_screen},
{"rna_sensor.c", RNA_def_sensor},
+ {"rna_vfont.c", RNA_def_vfont},
{"rna_wm.c", RNA_def_wm},
{"rna_world.c", RNA_def_world},
{NULL, NULL}};
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c 2008-12-01 16:59:18 UTC (rev 17665)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c 2008-12-01 19:02:27 UTC (rev 17666)
@@ -60,6 +60,7 @@
switch(GS(id->name)) {
case ID_BR: return &RNA_Brush;
case ID_CA: return &RNA_Camera;
+ case ID_CU: return &RNA_Curve;
case ID_GR: return &RNA_Group;
case ID_IM: return &RNA_Image;
case ID_IP: return &RNA_Ipo;
@@ -73,6 +74,7 @@
case ID_OB: return &RNA_Object;
case ID_SCE: return &RNA_Scene;
case ID_SCR: return &RNA_Screen;
+ case ID_VF: return &RNA_VFont;
case ID_WO: return &RNA_World;
case ID_WM: return &RNA_WindowManager;
default: return &RNA_ID;
Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c 2008-12-01 16:59:18 UTC (rev 17665)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c 2008-12-01 19:02:27 UTC (rev 17666)
@@ -35,7 +35,7 @@
#else
-void RNA_def_brushclone(BlenderRNA *brna)
+void rna_def_brushclone(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -64,7 +64,7 @@
RNA_def_property_ui_text(prop, "Opacity", "The amount of opacity of the clone image.");
}
-void RNA_def_brush(BlenderRNA *brna)
+void rna_def_brush(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -158,4 +158,10 @@
RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position.");
}
+void RNA_def_brush(BlenderRNA *brna)
+{
+ rna_def_brush(brna);
+ rna_def_brushclone(brna);
+}
+
#endif
Added: branches/blender2.5/blender/source/blender/makesrna/intern/rna_curve.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_curve.c (rev 0)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_curve.c 2008-12-01 19:02:27 UTC (rev 17666)
@@ -0,0 +1,358 @@
+/**
+ * $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): Blender Foundation (2008), Juho Veps\xE4l\xE4inen
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_curve_types.h"
+
+#ifdef RNA_RUNTIME
+
+#else
+
+static void rna_def_path(BlenderRNA *brna);
+static void rna_def_nurbs(BlenderRNA *brna);
+static void rna_def_font(BlenderRNA *brna);
+
+void rna_def_curve(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ srna= RNA_def_struct(brna, "Curve", "ID", "Curve");
+
+ rna_def_path(brna);
+ rna_def_nurbs(brna);
+ rna_def_font(brna);
+
+ /* Number values */
+ prop= RNA_def_property(srna, "bevel_resolution", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "bevresol");
+ RNA_def_property_range(prop, 0, 32);
+ RNA_def_property_ui_text(prop, "Bevel Resolution", "Bevel resolution when depth is non-zero and no specific bevel object has been defined.");
+
+ prop= RNA_def_property(srna, "width", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "width");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Width", "Scale the original width (1.0) based on given factor.");
+
+ prop= RNA_def_property(srna, "extrude", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ext1");
+ RNA_def_property_range(prop, 0.0f, 100.0f);
+ RNA_def_property_ui_text(prop, "Extrude", "Amount of curve extrusion when not using a bevel object.");
+
+ prop= RNA_def_property(srna, "bevel_depth", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "ext2");
+ RNA_def_property_range(prop, 0.0f, 2.0f);
+ RNA_def_property_ui_text(prop, "Bevel Depth", "Bevel depth when not using a bevel object.");
+
+ prop= RNA_def_property(srna, "resolution_u", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resolu");
+ RNA_def_property_range(prop, 1, 1024);
+ RNA_def_property_ui_text(prop, "U Resolution", "Surface resolution in U direction.");
+
+ prop= RNA_def_property(srna, "resolution_v", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resolv");
+ RNA_def_property_range(prop, 1, 1024);
+ RNA_def_property_ui_text(prop, "V Resolution", "Surface resolution in V direction.");
+
+ prop= RNA_def_property(srna, "resolution_u_rendering", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resolu_ren");
+ RNA_def_property_range(prop, 0, 1024);
+ RNA_def_property_ui_text(prop, "U Resolution (Rendering)", "Surface resolution in U direction used while rendering. Zero skips this property.");
+
+ prop= RNA_def_property(srna, "resolution_v_rendering", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "resolv_ren");
+ RNA_def_property_range(prop, 0, 1024);
+ RNA_def_property_ui_text(prop, "V Resolution (Rendering)", "Surface resolution in V direction used while rendering. Zero skips this property.");
+
+ /* pointers */
+ prop= RNA_def_property(srna, "bevel_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_pointer_sdna(prop, NULL, "bevobj");
+ RNA_def_property_ui_text(prop, "Bevel Object", "Curve object name that defines the bevel shape.");
+
+ prop= RNA_def_property(srna, "taper_object", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Object");
+ RNA_def_property_pointer_sdna(prop, NULL, "taperobj");
+ RNA_def_property_ui_text(prop, "Taper Object", "Curve object name that defines the taper (width).");
+
+ prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
+ RNA_def_property_struct_type(prop, "Ipo");
+ RNA_def_property_ui_text(prop, "Ipo Curve", "");
+
+ /* Flags */
+ prop= RNA_def_property(srna, "3d", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_3D);
+ RNA_def_property_ui_text(prop, "3D Curve", "Define curve in three dimensions. Note that in this case fill won't work.");
+
+ prop= RNA_def_property(srna, "front", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_FRONT);
+ RNA_def_property_ui_text(prop, "Front", "Draw filled front for extruded/beveled curves.");
+
+ prop= RNA_def_property(srna, "back", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_BACK);
+ RNA_def_property_ui_text(prop, "Back", "Draw filled back for extruded/beveled curves.");
+
+ prop= RNA_def_property(srna, "retopo", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", CU_RETOPO);
+ RNA_def_property_ui_text(prop, "Retopo", "Turn on the re-topology tool.");
+}
+
+static void rna_def_path(BlenderRNA *brna)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+
+ /* number values */
+ prop= RNA_def_property(srna, "path_length", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "pathlen");
+ RNA_def_property_range(prop, 1, 32767);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list