RNA: added MeshVertex.normal.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 20 Jun 2009 15:06:18 +0000 (15:06 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 20 Jun 2009 15:06:18 +0000 (15:06 +0000)
source/blender/makesrna/intern/rna_mesh.c
source/blender/makesrna/intern/rna_object.c

index 5634740..da90b9f 100644 (file)
 
 #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)
 {
@@ -629,10 +632,11 @@ static void rna_def_mvert(BlenderRNA *brna)
        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);
index 435a9e0..9e8dbbb 100644 (file)
@@ -92,7 +92,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value)
                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);