diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-04 18:37:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-04 18:37:22 +0300 |
commit | 589b2b4ca8af8a3b260c0dd33ddfdb0cc8ee8376 (patch) | |
tree | b4dd33f0e15d4e0e5d47e6f667ebe9d81f1b456f /source/blender/makesrna | |
parent | 61a8f370f547e9b39ada252b285b09a3aa92b42d (diff) |
object.group_users, object.scene_users
utility functions to find the groups and scenes this object is used in.
button to set the group location from the cursor (UI is horrible but not any nice place to add?)
smarp project would fail if there were linked meshes in the scene, made ID.tag ignore the library, so you can tag linked data since its only for tools to use.
normalize the vertex normal before setting and use inline vector functions.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 14 |
2 files changed, 7 insertions, 8 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index a250f0a49b4..e931f08c3a3 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -380,6 +380,7 @@ static void rna_def_ID(BlenderRNA *brna) prop= RNA_def_property(srna, "tag", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", LIB_DOIT); + RNA_def_property_flag(prop, PROP_LIB_EXCEPTION); RNA_def_property_ui_text(prop, "Tag", "Tools can use this to tag data, (initial state is undefined)."); prop= RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index f8bfa105c12..56a1b170979 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -75,19 +75,17 @@ void rna_Mesh_update_draw(Main *bmain, Scene *scene, PointerRNA *ptr) static void rna_MeshVertex_normal_get(PointerRNA *ptr, float *value) { MVert *mvert= (MVert*)ptr->data; - - value[0]= mvert->no[0]/32767.0f; - value[1]= mvert->no[1]/32767.0f; - value[2]= mvert->no[2]/32767.0f; + normal_short_to_float_v3(value, mvert->no); } -static void rna_MeshVertex_normal_set(PointerRNA *ptr, float *value) +static void rna_MeshVertex_normal_set(PointerRNA *ptr, const float *value) { MVert *mvert= (MVert*)ptr->data; + float no[3]; - mvert->no[0] = (short) (value[0] * 32767.0f); - mvert->no[1] = (short) (value[1] * 32767.0f); - mvert->no[2] = (short) (value[2] * 32767.0f); + copy_v3_v3(no, value); + normalize_v3(no); + normal_float_to_short_v3(mvert->no, no); } static float rna_MeshVertex_bevel_weight_get(PointerRNA *ptr) |