[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21036] branches/blender2.5/blender/source /blender/makesrna/intern: RNA: added MeshVertex.normal.

Brecht Van Lommel brecht at blender.org
Sat Jun 20 17:06:18 CEST 2009


Revision: 21036
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21036
Author:   blendix
Date:     2009-06-20 17:06:18 +0200 (Sat, 20 Jun 2009)

Log Message:
-----------
RNA: added MeshVertex.normal.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c	2009-06-20 14:55:28 UTC (rev 21035)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c	2009-06-20 15:06:18 UTC (rev 21036)
@@ -38,12 +38,15 @@
 
 #ifdef RNA_RUNTIME
 
-/*static float rna_MeshVertex_no_get(PointerRNA *ptr, int index)
+static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value)
 {
 	MVert *mvert= (MVert*)ptr->data;
-	return mvert->no[index]/32767.0f;
-}*/
 
+	value[0]= mvert->no[0]/32767.0f;
+	value[1]= mvert->no[1]/32767.0f;
+	value[2]= mvert->no[2]/32767.0f;
+}
+
 static float rna_MeshVertex_bevel_weight_get(PointerRNA *ptr)
 {
 	MVert *mvert= (MVert*)ptr->data;
@@ -629,10 +632,11 @@
 	prop= RNA_def_property(srna, "co", PROP_FLOAT, PROP_VECTOR);
 	RNA_def_property_ui_text(prop, "Location", "");
 
-	/*prop= RNA_def_property(srna, "no", PROP_FLOAT, PROP_VECTOR);
-	RNA_def_property_float_funcs(prop, "rna_MeshVertex_no_get", NULL, NULL);
+	prop= RNA_def_property(srna, "normal", PROP_FLOAT, PROP_VECTOR);
+	RNA_def_property_float_sdna(prop, NULL, "no");
+	RNA_def_property_float_funcs(prop, "rna_MeshVertex_normal_get", NULL, NULL);
 	RNA_def_property_ui_text(prop, "Normal", "Vertex Normal");
-	RNA_def_property_clear_flag(prop, PROP_EDITABLE);*/
+	RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 
 	prop= RNA_def_property(srna, "selected", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", SELECT);

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c	2009-06-20 14:55:28 UTC (rev 21035)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c	2009-06-20 15:06:18 UTC (rev 21036)
@@ -92,7 +92,7 @@
 		ob->data= id;
 		test_object_materials(id);
 
-		if(GS(id->name)==ID_CU )
+		if(GS(id->name)==ID_CU)
 			test_curve_type(ob);
 		else if(ob->type==OB_ARMATURE)
 			armature_rebuild_pose(ob, ob->data);





More information about the Bf-blender-cvs mailing list