Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-20 19:06:18 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-20 19:06:18 +0400
commit823a7ce3d3b6cde3f99ed660f002c61502ba7736 (patch)
tree54c825ac6f7f9aad2992bd05a72c8f097cddeb95
parentad07fc19c0fb97540bfe8d259c0b39098b9d7b9b (diff)
RNA: added MeshVertex.normal.
-rw-r--r--source/blender/makesrna/intern/rna_mesh.c16
-rw-r--r--source/blender/makesrna/intern/rna_object.c2
2 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 5634740a4e6..da90b9f4c76 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -38,11 +38,14 @@
#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);
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 435a9e0f0a4..9e8dbbb12b3 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -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);