[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17655] branches/blender2.5/blender/source /blender/makesrna: RNA

Willian Padovani Germano wpgermano at gmail.com
Mon Dec 1 00:27:10 CET 2008


Revision: 17655
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17655
Author:   ianwill
Date:     2008-12-01 00:27:10 +0100 (Mon, 01 Dec 2008)

Log Message:
-----------
RNA

- Minor updates to Camera and start of Ipo (+ IpoDriver and IpoCurve) wrappings.

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_camera.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h

Added Paths:
-----------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_ipo.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2008-11-30 22:48:43 UTC (rev 17654)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2008-11-30 23:27:10 UTC (rev 17655)
@@ -56,6 +56,9 @@
 extern StructRNA RNA_Image;
 extern StructRNA RNA_ImageUser;
 extern StructRNA RNA_IntProperty;
+extern StructRNA RNA_Ipo;
+extern StructRNA RNA_IpoDriver;
+extern StructRNA RNA_IpoCurve;
 extern StructRNA RNA_JoystickSensor;
 extern StructRNA RNA_KeyboardSensor;
 extern StructRNA RNA_Lamp;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2008-11-30 22:48:43 UTC (rev 17654)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2008-11-30 23:27:10 UTC (rev 17655)
@@ -883,6 +883,7 @@
 	{"rna_property.c", RNA_def_gameproperty},
 	{"rna_group.c", RNA_def_group},
 	{"rna_image.c", RNA_def_image},
+	{"rna_ipo.c", RNA_def_ipo},
 	{"rna_lamp.c", RNA_def_lamp},
 	{"rna_lattice.c", RNA_def_lattice},
 	{"rna_main.c", RNA_def_main},

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c	2008-11-30 22:48:43 UTC (rev 17654)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c	2008-11-30 23:27:10 UTC (rev 17655)
@@ -61,6 +61,7 @@
 		case ID_CA: return &RNA_Camera;
 		case ID_GR: return &RNA_Group;
 		case ID_IM: return &RNA_Image;
+		case ID_IP: return &RNA_Ipo;
 		case ID_LA: return &RNA_Lamp;
 		case ID_LI: return &RNA_Library;
 		case ID_LT: return &RNA_Lattice;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_camera.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_camera.c	2008-11-30 22:48:43 UTC (rev 17654)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_camera.c	2008-11-30 23:27:10 UTC (rev 17655)
@@ -61,7 +61,7 @@
 	prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "angle");
 	RNA_def_property_range(prop, 0.0f, 100.0f);
-	RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lens in degrees.");
+	RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lens value in degrees.");
 
 	prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "clipsta");
@@ -76,7 +76,7 @@
 	prop= RNA_def_property(srna, "lens", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "lens");
 	RNA_def_property_range(prop, 1.0f, 250.0f);
-	RNA_def_property_ui_text(prop, "Lens", "Perspective Camera lens in mm.");
+	RNA_def_property_ui_text(prop, "Lens", "Perspective Camera lens value in mm.");
 
 	prop= RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
@@ -124,9 +124,20 @@
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWNAME);
 	RNA_def_property_ui_text(prop, "Show Name", "Draw the active Camera's name in Camera view.");
 
-	prop= RNA_def_property(srna, "angle_toggle", PROP_BOOLEAN, PROP_NONE);
+	prop= RNA_def_property(srna, "use_degrees", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_ANGLETOGGLE);
-	RNA_def_property_ui_text(prop, "Angle Toggle", "Use degrees instead of mm as the unit of the Camera lens.");
+	RNA_def_property_ui_text(prop, "Use Degrees", "Use degrees instead of mm as the unit of the Camera lens.");
+
+	/* Pointers */
+
+	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", "");
+
+	prop= RNA_def_property(srna, "dof_object", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "Object");
+	RNA_def_property_pointer_sdna(prop, NULL, "dof_ob");
+	RNA_def_property_ui_text(prop, "DOF Object", "Use this object to define depth of field focal point.");
 }
 
 #endif

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2008-11-30 22:48:43 UTC (rev 17654)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2008-11-30 23:27:10 UTC (rev 17655)
@@ -88,6 +88,7 @@
 void RNA_def_gameproperty(struct BlenderRNA *brna);
 void RNA_def_group(struct BlenderRNA *brna);
 void RNA_def_image(struct BlenderRNA *brna);
+void RNA_def_ipo(struct BlenderRNA *brna);
 void RNA_def_lamp(struct BlenderRNA *brna);
 void RNA_def_lattice(struct BlenderRNA *brna);
 void RNA_def_main(struct BlenderRNA *brna);

Added: branches/blender2.5/blender/source/blender/makesrna/intern/rna_ipo.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_ipo.c	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_ipo.c	2008-11-30 23:27:10 UTC (rev 17655)
@@ -0,0 +1,132 @@
+/**
+ * $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).
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdlib.h>
+
+#include "RNA_define.h"
+#include "RNA_types.h"
+
+#include "rna_internal.h"
+
+#include "DNA_ipo_types.h"
+
+#ifdef RNA_RUNTIME
+
+void *rna_Ipo_ipocurves_get(CollectionPropertyIterator *iter)
+{
+	ListBaseIterator *internal= iter->internal;
+
+	return ((Base*)internal->link)->object;
+}
+
+#else
+
+void rna_def_ipodriver(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+	static EnumPropertyItem prop_type_items[] = {
+		{IPO_DRIVER_TYPE_NORMAL, "NORMAL", "Normal", ""},
+		{IPO_DRIVER_TYPE_PYTHON, "SCRIPTED", "Scripted", ""},
+		{0, NULL, NULL, NULL}};
+
+	srna= RNA_def_struct(brna, "IpoDriver", NULL, "Ipo Driver");
+
+	/* Enums */
+	prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+	RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+	RNA_def_property_enum_items(prop, prop_type_items);
+	RNA_def_property_ui_text(prop, "Type", "Ipo Driver types.");
+
+	/* String values */
+	prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
+	RNA_def_property_string_sdna(prop, NULL, "name");
+	RNA_def_property_ui_text(prop, "Name", "Bone name or scripting expression.");
+
+	/* Pointers */
+
+	prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "Object");
+	RNA_def_property_pointer_sdna(prop, NULL, "ob");
+	RNA_def_property_ui_text(prop, "Driver Object", "Object that controls this Ipo Driver.");
+
+}
+
+void rna_def_ipocurve(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+
+	srna= RNA_def_struct(brna, "IpoCurve", NULL, "Ipo Curve");
+
+	/* Number values */
+
+	prop= RNA_def_property(srna, "value", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "curval");
+	RNA_def_property_ui_text(prop, "Value", "Value of this Ipo Curve at the current frame.");
+
+	/* Pointers */
+
+	prop= RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "IpoDriver");
+	RNA_def_property_pointer_sdna(prop, NULL, "driver");
+	RNA_def_property_ui_text(prop, "Ipo Driver", "");
+}
+
+void rna_def_ipo(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+
+	srna= RNA_def_struct(brna, "Ipo", "ID", "Ipo");
+
+	/* Boolean values */
+
+	prop= RNA_def_property(srna, "show_key", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "showkey", 0);
+	RNA_def_property_ui_text(prop, "Show Keys", "Show Ipo Keys.");
+
+	prop= RNA_def_property(srna, "mute", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "muteipo", 0);
+	RNA_def_property_ui_text(prop, "Mute", "Mute this Ipo block.");
+
+	/* Collection */
+
+	prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
+	RNA_def_property_collection_sdna(prop, NULL, "curve", NULL);
+	RNA_def_property_struct_type(prop, "IpoCurve");
+	RNA_def_property_ui_text(prop, "Curves", "");
+	RNA_def_property_collection_funcs(prop, 0, 0, 0, "rna_Ipo_ipocurves_get", 0, 0, 0, 0);
+
+}
+
+void RNA_def_ipo(BlenderRNA *brna)
+{
+	rna_def_ipo(brna);
+	rna_def_ipocurve(brna);
+	rna_def_ipodriver(brna);
+}
+
+#endif
+





More information about the Bf-blender-cvs mailing list