From c91cee2bb9fd3a8ddef3355534971782e8e6f519 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 5 May 2012 21:28:12 +0000 Subject: code cleanup: naming - BKE_mesh_* --- source/blender/makesrna/intern/rna_mesh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_mesh.c') diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 0ecfa311913..436b6938e05 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -222,7 +222,7 @@ static float rna_MeshPolygon_area_get(PointerRNA *ptr) Mesh *me = (Mesh*)ptr->id.data; MPoly *mp = (MPoly*)ptr->data; - return mesh_calc_poly_area(mp, me->mloop+mp->loopstart, me->mvert, NULL); + return BKE_mesh_calc_poly_area(mp, me->mloop+mp->loopstart, me->mvert, NULL); } static void rna_MeshTessFace_normal_get(PointerRNA *ptr, float *values) -- cgit v1.2.3 From c8cbe63947f6ba05584b5dc6d298dd7301e5dbc0 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 8 May 2012 23:39:31 +0000 Subject: Cycles: fix issues with texture coordinates and object scale. Auto texture space size and location were outdated often, and already computed on demand by blender internal, now do that through RNA as well. --- source/blender/makesrna/intern/rna_mesh.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source/blender/makesrna/intern/rna_mesh.c') diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 436b6938e05..733e14857fd 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -452,6 +452,26 @@ static int rna_Mesh_texspace_editable(PointerRNA *ptr) return (me->texflag & ME_AUTOSPACE)? 0: PROP_EDITABLE; } +static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float values[3]) +{ + Mesh *me= (Mesh*)ptr->data; + + if(!me->bb) + BKE_mesh_texspace_calc(me); + + copy_v3_v3(values, me->size); +} + +static void rna_Mesh_texspace_loc_get(PointerRNA *ptr, float values[3]) +{ + Mesh *me= (Mesh*)ptr->data; + + if(!me->bb) + BKE_mesh_texspace_calc(me); + + copy_v3_v3(values, me->loc); +} + static void rna_MeshVertex_groups_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { Mesh *me = rna_mesh(ptr); @@ -2066,12 +2086,14 @@ void rna_def_texmat_common(StructRNA *srna, const char *texspace_editable) prop = RNA_def_property(srna, "texspace_location", PROP_FLOAT, PROP_TRANSLATION); RNA_def_property_float_sdna(prop, NULL, "loc"); RNA_def_property_ui_text(prop, "Texure Space Location", "Texture space location"); + RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_loc_get", NULL, NULL); RNA_def_property_editable_func(prop, texspace_editable); RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); prop = RNA_def_property(srna, "texspace_size", PROP_FLOAT, PROP_XYZ); RNA_def_property_float_sdna(prop, NULL, "size"); RNA_def_property_ui_text(prop, "Texture Space Size", "Texture space size"); + RNA_def_property_float_funcs(prop, "rna_Mesh_texspace_size_get", NULL, NULL); RNA_def_property_editable_func(prop, texspace_editable); RNA_def_property_update(prop, 0, "rna_Mesh_update_draw"); -- cgit v1.2.3