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

Andrea Weikert elubie at gmx.net
Wed Dec 3 22:18:11 CET 2008


Revision: 17705
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17705
Author:   elubie
Date:     2008-12-03 22:18:10 +0100 (Wed, 03 Dec 2008)

Log Message:
-----------
RNA
* rna for DNA_key_types.h, also linked to key member of Lattice, others need to be checked.

Modified Paths:
--------------
    branches/blender2.5/blender/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
    branches/blender2.5/blender/source/blender/editors/interface/view2d.c
    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_internal.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_lattice.c

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

Modified: branches/blender2.5/blender/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
===================================================================
--- branches/blender2.5/blender/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj	2008-12-03 21:13:47 UTC (rev 17704)
+++ branches/blender2.5/blender/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj	2008-12-03 21:18:10 UTC (rev 17705)
@@ -637,6 +637,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\..\..\source\blender\makesrna\intern\rna_key.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\..\source\blender\makesrna\intern\rna_lamp.c"
 				>
 			</File>

Modified: branches/blender2.5/blender/source/blender/editors/interface/view2d.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/view2d.c	2008-12-03 21:13:47 UTC (rev 17704)
+++ branches/blender2.5/blender/source/blender/editors/interface/view2d.c	2008-12-03 21:18:10 UTC (rev 17705)
@@ -42,8 +42,6 @@
 #include "BIF_gl.h"
 #include "BIF_glutil.h"
 
-#include "ED_screen.h"
-
 #include "UI_resources.h"
 #include "UI_view2d.h"
 
@@ -365,7 +363,17 @@
 /* Restore view matrices after drawing */
 void UI_view2d_view_restore(const bContext *C)
 {
-	ED_region_pixelspace(C, C->region);
+	ARegion *region= C->region;
+	int winx, winy;
+	
+	/* calculate extents of region */
+	winx= region->winrct.xmax - region->winrct.xmin;
+	winy= region->winrct.ymax - region->winrct.ymin;
+	
+	/* set default region matrix - pixel offsets (0.375) for 1:1 correspondance are not applied, 
+	 * as they were causing some unwanted offsets when drawing 
+	 */
+	wmOrtho2(C->window, 0, winx, 0, winy);
 }
 
 /* *********************************************************************** */

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2008-12-03 21:13:47 UTC (rev 17704)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h	2008-12-03 21:18:10 UTC (rev 17705)
@@ -72,6 +72,8 @@
 extern StructRNA RNA_IpoCurve;
 extern StructRNA RNA_IpoDriver;
 extern StructRNA RNA_JoystickSensor;
+extern StructRNA RNA_Key;
+extern StructRNA RNA_KeyBlock;
 extern StructRNA RNA_KeyboardSensor;
 extern StructRNA RNA_Lamp;
 extern StructRNA RNA_Lattice;

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2008-12-03 21:13:47 UTC (rev 17704)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c	2008-12-03 21:18:10 UTC (rev 17705)
@@ -902,6 +902,7 @@
 	{"rna_group.c", RNA_def_group},
 	{"rna_image.c", RNA_def_image},
 	{"rna_ipo.c", RNA_def_ipo},
+	{"rna_key.c", RNA_def_key},
 	{"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-12-03 21:13:47 UTC (rev 17704)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_ID.c	2008-12-03 21:18:10 UTC (rev 17705)
@@ -64,6 +64,7 @@
 		case ID_GR: return &RNA_Group;
 		case ID_IM: return &RNA_Image;
 		case ID_IP: return &RNA_Ipo;
+		case ID_KE: return &RNA_Key;
 		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_internal.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2008-12-03 21:13:47 UTC (rev 17704)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h	2008-12-03 21:18:10 UTC (rev 17705)
@@ -105,6 +105,7 @@
 void RNA_def_group(struct BlenderRNA *brna);
 void RNA_def_image(struct BlenderRNA *brna);
 void RNA_def_ipo(struct BlenderRNA *brna);
+void RNA_def_key(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_key.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_key.c	                        (rev 0)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_key.c	2008-12-03 21:18:10 UTC (rev 17705)
@@ -0,0 +1,135 @@
+/**
+ * $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_key_types.h"
+
+#ifdef RNA_RUNTIME
+#else
+
+void RNA_def_keyblock(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+
+	static EnumPropertyItem prop_keyblock_type_items[] = {
+		{KEY_LINEAR, "KEY_LINEAR", "Linear", ""},
+		{KEY_CARDINAL, "KEY_CARDINAL", "Cardinal", ""},
+		{KEY_BSPLINE, "KEY_BSPLINE", "BSpline", ""},
+		{0, NULL, NULL, NULL}};
+
+	srna= RNA_def_struct(brna, "KeyBlock", NULL, "KeyBlock");
+
+	prop= RNA_def_property(srna, "current_pos", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "pos");
+	RNA_def_property_ui_text(prop, "CurrentPosition", "Current Position.");
+
+	prop= RNA_def_property(srna, "current_val", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "curval");
+	RNA_def_property_ui_text(prop, "CurrentValue", "Current Value.");
+
+	prop= RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE);
+	RNA_def_property_enum_sdna(prop, NULL, "type", 0);
+	RNA_def_property_enum_items(prop, prop_keyblock_type_items);
+	RNA_def_property_ui_text(prop, "Type", "");
+
+	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", "Current Shape Key name.");
+	RNA_def_property_string_maxlength(prop, 32);
+
+	prop= RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
+	RNA_def_property_string_sdna(prop, NULL, "vgroup");
+	RNA_def_property_ui_text(prop, "Vertex Group", "");
+	RNA_def_property_string_maxlength(prop, 32);
+
+	/* XXX couldn't quite figure this one out: shape key number, channel code? */
+	prop= RNA_def_property(srna, "channel", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "adrcode");
+	RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
+	RNA_def_property_ui_text(prop, "Channel", "");
+
+	prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "relative", 1);
+	RNA_def_property_ui_text(prop, "Relative", "Makes Shape Keys relative.");
+
+	prop= RNA_def_property(srna, "slidermin", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "slidermin");
+	RNA_def_property_ui_text(prop, "SliderMin", "Minimum for Slider.");
+
+	prop= RNA_def_property(srna, "slidermax", PROP_FLOAT, PROP_NONE);
+	RNA_def_property_float_sdna(prop, NULL, "slidermax");
+	RNA_def_property_ui_text(prop, "SliderMax", "Maximum for Slider.");
+
+}
+
+void RNA_def_key(BlenderRNA *brna)
+{
+	StructRNA *srna;
+	PropertyRNA *prop;
+
+	RNA_def_keyblock(brna);
+
+	srna= RNA_def_struct(brna, "Key", "ID", "Key");
+
+	prop= RNA_def_property(srna, "refkey", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "KeyBlock");
+	RNA_def_property_ui_text(prop, "Reference Key", "");
+
+	prop= RNA_def_property(srna, "keyblocks", PROP_COLLECTION, PROP_NONE);
+	RNA_def_property_collection_sdna(prop, NULL, "block", NULL);
+	RNA_def_property_struct_type(prop, "KeyBlock");
+	RNA_def_property_ui_text(prop, "KeyBlocks", "Key Blocks.");
+
+	prop= RNA_def_property(srna, "num_keyblocks", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "totkey");
+	RNA_def_property_ui_text(prop, "NumKeyBlocks", "Number of KeyBlocks.");
+	
+	prop= RNA_def_property(srna, "ipo", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "Ipo");
+	RNA_def_property_ui_text(prop, "Ipo", "");
+
+	prop= RNA_def_property(srna, "from", PROP_POINTER, PROP_NONE);
+	RNA_def_property_struct_type(prop, "ID");
+	RNA_def_property_ui_text(prop, "From", "");
+
+	prop= RNA_def_property(srna, "relative", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_sdna(prop, NULL, "type", 1);
+	RNA_def_property_ui_text(prop, "Relative", "");
+
+	prop= RNA_def_property(srna, "slurph", PROP_INT, PROP_NONE);
+	RNA_def_property_int_sdna(prop, NULL, "slurph");
+	RNA_def_property_ui_text(prop, "Slurph", "");
+
+
+}
+
+#endif
+


Property changes on: branches/blender2.5/blender/source/blender/makesrna/intern/rna_key.c
___________________________________________________________________
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_lattice.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_lattice.c	2008-12-03 21:13:47 UTC (rev 17704)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_lattice.c	2008-12-03 21:18:10 UTC (rev 17705)
@@ -81,6 +81,14 @@
 	prop= RNA_def_property(srna, "outside", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", LT_OUTSIDE);
 	RNA_def_property_ui_text(prop, "Outside", "Only draw, and take into account, the outer vertices.");
+

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list