diff options
-rw-r--r-- | source/blender/blenkernel/BKE_curve.h | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_mesh.h | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 80 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 112 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_convert.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 4 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager_data.c | 4 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_curve_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_curve.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 8 |
14 files changed, 88 insertions, 169 deletions
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h index aeff6007292..98712af82e9 100644 --- a/source/blender/blenkernel/BKE_curve.h +++ b/source/blender/blenkernel/BKE_curve.h @@ -86,11 +86,10 @@ void BKE_curve_curve_dimension_update(struct Curve *cu); void BKE_curve_boundbox_calc(struct Curve *cu, float r_loc[3], float r_size[3]); struct BoundBox *BKE_curve_boundbox_get(struct Object *ob); + void BKE_curve_texspace_calc(struct Curve *cu); -struct BoundBox *BKE_curve_texspace_get(struct Curve *cu, - float r_loc[3], - float r_rot[3], - float r_size[3]); +void BKE_curve_texspace_ensure(struct Curve *cu); +void BKE_curve_texspace_get(struct Curve *cu, float r_loc[3], float r_rot[3], float r_size[3]); bool BKE_curve_minmax(struct Curve *cu, bool use_radius, float min[3], float max[3]); bool BKE_curve_center_median(struct Curve *cu, float cent[3]); diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index af40eef6ab5..fe45530e01e 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -141,8 +141,6 @@ bool BKE_mesh_ensure_facemap_customdata(struct Mesh *me); bool BKE_mesh_clear_facemap_customdata(struct Mesh *me); void BKE_mesh_make_local(struct Main *bmain, struct Mesh *me, const bool lib_local); -void BKE_mesh_boundbox_calc(struct Mesh *me, float r_loc[3], float r_size[3]); -void BKE_mesh_texspace_calc(struct Mesh *me); float (*BKE_mesh_orco_verts_get(struct Object *ob))[3]; void BKE_mesh_orco_verts_transform(struct Mesh *me, float (*orco)[3], int totvert, int invert); int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr); @@ -192,10 +190,10 @@ void BKE_mesh_smooth_flag_set(struct Mesh *me, const bool use_smooth); const char *BKE_mesh_cmp(struct Mesh *me1, struct Mesh *me2, float thresh); struct BoundBox *BKE_mesh_boundbox_get(struct Object *ob); -struct BoundBox *BKE_mesh_texspace_get(struct Mesh *me, - float r_loc[3], - float r_rot[3], - float r_size[3]); + +void BKE_mesh_texspace_calc(struct Mesh *me); +void BKE_mesh_texspace_ensure(struct Mesh *me); +void BKE_mesh_texspace_get(struct Mesh *me, float r_loc[3], float r_rot[3], float r_size[3]); void BKE_mesh_texspace_get_reference( struct Mesh *me, short **r_texflag, float **r_loc, float **r_rot, float **r_size); void BKE_mesh_texspace_copy_from_object(struct Mesh *me, struct Object *ob); diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 67b0aaffc4a..a9d98c726c9 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -142,7 +142,6 @@ void BKE_curve_free(Curve *cu) MEM_SAFE_FREE(cu->mat); MEM_SAFE_FREE(cu->str); MEM_SAFE_FREE(cu->strinfo); - MEM_SAFE_FREE(cu->bb); MEM_SAFE_FREE(cu->tb); } @@ -154,8 +153,6 @@ void BKE_curve_init(Curve *cu, const short curve_type) cu->type = curve_type; - cu->bb = BKE_boundbox_alloc_unit(); - if (cu->type == OB_FONT) { cu->flag |= CU_FRONT | CU_BACK; cu->vfont = cu->vfontb = cu->vfonti = cu->vfontbi = BKE_vfont_builtin_get(); @@ -204,7 +201,6 @@ void BKE_curve_copy_data(Main *bmain, Curve *cu_dst, const Curve *cu_src, const cu_dst->str = MEM_dupallocN(cu_src->str); cu_dst->strinfo = MEM_dupallocN(cu_src->strinfo); cu_dst->tb = MEM_dupallocN(cu_src->tb); - cu_dst->bb = MEM_dupallocN(cu_src->bb); cu_dst->batch_cache = NULL; if (cu_src->key && (flag & LIB_ID_COPY_SHAPEKEY)) { @@ -291,41 +287,6 @@ void BKE_curve_type_test(Object *ob) } } -void BKE_curve_boundbox_calc(Curve *cu, float r_loc[3], float r_size[3]) -{ - BoundBox *bb; - float min[3], max[3]; - float mloc[3], msize[3]; - - if (cu->bb == NULL) { - cu->bb = MEM_callocN(sizeof(BoundBox), "boundbox"); - } - bb = cu->bb; - - if (!r_loc) { - r_loc = mloc; - } - if (!r_size) { - r_size = msize; - } - - INIT_MINMAX(min, max); - if (!BKE_curve_minmax(cu, true, min, max)) { - min[0] = min[1] = min[2] = -1.0f; - max[0] = max[1] = max[2] = 1.0f; - } - - mid_v3_v3v3(r_loc, min, max); - - r_size[0] = (max[0] - min[0]) / 2.0f; - r_size[1] = (max[1] - min[1]) / 2.0f; - r_size[2] = (max[2] - min[2]) / 2.0f; - - BKE_boundbox_init_from_minmax(bb, min, max); - - bb->flag &= ~BOUNDBOX_DIRTY; -} - BoundBox *BKE_curve_boundbox_get(Object *ob) { /* This is Object-level data access, @@ -349,13 +310,23 @@ BoundBox *BKE_curve_boundbox_get(Object *ob) void BKE_curve_texspace_calc(Curve *cu) { - float loc[3], size[3]; - int a; + if (cu->texflag & CU_AUTOSPACE) { + float min[3], max[3]; - BKE_curve_boundbox_calc(cu, loc, size); + INIT_MINMAX(min, max); + if (!BKE_curve_minmax(cu, true, min, max)) { + min[0] = min[1] = min[2] = -1.0f; + max[0] = max[1] = max[2] = 1.0f; + } - if (cu->texflag & CU_AUTOSPACE) { - for (a = 0; a < 3; a++) { + float loc[3], size[3]; + mid_v3_v3v3(loc, min, max); + + size[0] = (max[0] - min[0]) / 2.0f; + size[1] = (max[1] - min[1]) / 2.0f; + size[2] = (max[2] - min[2]) / 2.0f; + + for (int a = 0; a < 3; a++) { if (size[a] == 0.0f) { size[a] = 1.0f; } @@ -370,14 +341,21 @@ void BKE_curve_texspace_calc(Curve *cu) copy_v3_v3(cu->loc, loc); copy_v3_v3(cu->size, size); zero_v3(cu->rot); + + cu->texflag |= CU_AUTOSPACE_EVALUATED; } } -BoundBox *BKE_curve_texspace_get(Curve *cu, float r_loc[3], float r_rot[3], float r_size[3]) +void BKE_curve_texspace_ensure(Curve *cu) { - if (cu->bb == NULL || (cu->bb->flag & BOUNDBOX_DIRTY)) { + if ((cu->texflag & CU_AUTOSPACE) && !(cu->texflag & CU_AUTOSPACE_EVALUATED)) { BKE_curve_texspace_calc(cu); } +} + +void BKE_curve_texspace_get(Curve *cu, float r_loc[3], float r_rot[3], float r_size[3]) +{ + BKE_curve_texspace_ensure(cu); if (r_loc) { copy_v3_v3(r_loc, cu->loc); @@ -388,8 +366,6 @@ BoundBox *BKE_curve_texspace_get(Curve *cu, float r_loc[3], float r_rot[3], floa if (r_size) { copy_v3_v3(r_size, cu->size); } - - return cu->bb; } bool BKE_nurbList_index_get_co(ListBase *nurb, const int index, float r_co[3]) @@ -5501,12 +5477,8 @@ void BKE_curve_eval_geometry(Depsgraph *depsgraph, Curve *curve) BKE_curve_texspace_calc(curve); if (DEG_is_active(depsgraph)) { Curve *curve_orig = (Curve *)DEG_get_original_id(&curve->id); - BoundBox *bb = curve->bb; - if (bb != NULL) { - if (curve_orig->bb == NULL) { - curve_orig->bb = MEM_mallocN(sizeof(*curve_orig->bb), __func__); - } - *curve_orig->bb = *bb; + if (curve->texflag & CU_AUTOSPACE_EVALUATED) { + curve_orig->texflag |= CU_AUTOSPACE_EVALUATED; copy_v3_v3(curve_orig->loc, curve->loc); copy_v3_v3(curve_orig->size, curve->size); copy_v3_v3(curve_orig->rot, curve->rot); diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index c108ff90850..e451ca06cba 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -496,7 +496,6 @@ void BKE_mesh_clear_geometry(Mesh *mesh) CustomData_free(&mesh->ldata, mesh->totloop); CustomData_free(&mesh->pdata, mesh->totpoly); - MEM_SAFE_FREE(mesh->bb); MEM_SAFE_FREE(mesh->mselect); MEM_SAFE_FREE(mesh->edit_mesh); @@ -605,7 +604,6 @@ void BKE_mesh_copy_data(Main *bmain, Mesh *me_dst, const Mesh *me_src, const int me_dst->edit_mesh = NULL; me_dst->mselect = MEM_dupallocN(me_dst->mselect); - me_dst->bb = MEM_dupallocN(me_dst->bb); /* TODO Do we want to add flag to prevent this? */ if (me_src->key && (flag & LIB_ID_COPY_SHAPEKEY)) { @@ -811,50 +809,49 @@ void BKE_mesh_make_local(Main *bmain, Mesh *me, const bool lib_local) BKE_id_make_local_generic(bmain, &me->id, true, lib_local); } -void BKE_mesh_boundbox_calc(Mesh *me, float r_loc[3], float r_size[3]) +BoundBox *BKE_mesh_boundbox_get(Object *ob) { - BoundBox *bb; - float min[3], max[3]; - float mloc[3], msize[3]; - - if (me->bb == NULL) { - me->bb = MEM_callocN(sizeof(BoundBox), "boundbox"); - } - bb = me->bb; + /* This is Object-level data access, + * DO NOT touch to Mesh's bb, would be totally thread-unsafe. */ + if (ob->runtime.bb == NULL || ob->runtime.bb->flag & BOUNDBOX_DIRTY) { + Mesh *me = ob->data; + float min[3], max[3]; - if (!r_loc) { - r_loc = mloc; - } - if (!r_size) { - r_size = msize; - } + INIT_MINMAX(min, max); + if (!BKE_mesh_minmax(me, min, max)) { + min[0] = min[1] = min[2] = -1.0f; + max[0] = max[1] = max[2] = 1.0f; + } - INIT_MINMAX(min, max); - if (!BKE_mesh_minmax(me, min, max)) { - min[0] = min[1] = min[2] = -1.0f; - max[0] = max[1] = max[2] = 1.0f; + if (ob->runtime.bb == NULL) { + ob->runtime.bb = MEM_mallocN(sizeof(*ob->runtime.bb), __func__); + } + BKE_boundbox_init_from_minmax(ob->runtime.bb, min, max); + ob->runtime.bb->flag &= ~BOUNDBOX_DIRTY; } - mid_v3_v3v3(r_loc, min, max); - - r_size[0] = (max[0] - min[0]) / 2.0f; - r_size[1] = (max[1] - min[1]) / 2.0f; - r_size[2] = (max[2] - min[2]) / 2.0f; - - BKE_boundbox_init_from_minmax(bb, min, max); - - bb->flag &= ~BOUNDBOX_DIRTY; + return ob->runtime.bb; } void BKE_mesh_texspace_calc(Mesh *me) { - float loc[3], size[3]; - int a; + if (me->texflag & ME_AUTOSPACE) { + float min[3], max[3]; + + INIT_MINMAX(min, max); + if (!BKE_mesh_minmax(me, min, max)) { + min[0] = min[1] = min[2] = -1.0f; + max[0] = max[1] = max[2] = 1.0f; + } - BKE_mesh_boundbox_calc(me, loc, size); + float loc[3], size[3]; + mid_v3_v3v3(loc, min, max); - if (me->texflag & ME_AUTOSPACE) { - for (a = 0; a < 3; a++) { + size[0] = (max[0] - min[0]) / 2.0f; + size[1] = (max[1] - min[1]) / 2.0f; + size[2] = (max[2] - min[2]) / 2.0f; + + for (int a = 0; a < 3; a++) { if (size[a] == 0.0f) { size[a] = 1.0f; } @@ -869,38 +866,21 @@ void BKE_mesh_texspace_calc(Mesh *me) copy_v3_v3(me->loc, loc); copy_v3_v3(me->size, size); zero_v3(me->rot); + + me->texflag |= ME_AUTOSPACE_EVALUATED; } } -BoundBox *BKE_mesh_boundbox_get(Object *ob) +void BKE_mesh_texspace_ensure(Mesh *me) { - /* This is Object-level data access, - * DO NOT touch to Mesh's bb, would be totally thread-unsafe. */ - if (ob->runtime.bb == NULL || ob->runtime.bb->flag & BOUNDBOX_DIRTY) { - Mesh *me = ob->data; - float min[3], max[3]; - - INIT_MINMAX(min, max); - if (!BKE_mesh_minmax(me, min, max)) { - min[0] = min[1] = min[2] = -1.0f; - max[0] = max[1] = max[2] = 1.0f; - } - - if (ob->runtime.bb == NULL) { - ob->runtime.bb = MEM_mallocN(sizeof(*ob->runtime.bb), __func__); - } - BKE_boundbox_init_from_minmax(ob->runtime.bb, min, max); - ob->runtime.bb->flag &= ~BOUNDBOX_DIRTY; + if ((me->texflag & ME_AUTOSPACE) && !(me->texflag & ME_AUTOSPACE_EVALUATED)) { + BKE_mesh_texspace_calc(me); } - - return ob->runtime.bb; } -BoundBox *BKE_mesh_texspace_get(Mesh *me, float r_loc[3], float r_rot[3], float r_size[3]) +void BKE_mesh_texspace_get(Mesh *me, float r_loc[3], float r_rot[3], float r_size[3]) { - if (me->bb == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) { - BKE_mesh_texspace_calc(me); - } + BKE_mesh_texspace_ensure(me); if (r_loc) { copy_v3_v3(r_loc, me->loc); @@ -911,16 +891,12 @@ BoundBox *BKE_mesh_texspace_get(Mesh *me, float r_loc[3], float r_rot[3], float if (r_size) { copy_v3_v3(r_size, me->size); } - - return me->bb; } void BKE_mesh_texspace_get_reference( Mesh *me, short **r_texflag, float **r_loc, float **r_rot, float **r_size) { - if (me->bb == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) { - BKE_mesh_texspace_calc(me); - } + BKE_mesh_texspace_ensure(me); if (r_texflag != NULL) { *r_texflag = &me->texflag; @@ -1962,12 +1938,8 @@ void BKE_mesh_eval_geometry(Depsgraph *depsgraph, Mesh *mesh) } if (DEG_is_active(depsgraph)) { Mesh *mesh_orig = (Mesh *)DEG_get_original_id(&mesh->id); - BoundBox *bb = mesh->bb; - if (bb != NULL) { - if (mesh_orig->bb == NULL) { - mesh_orig->bb = MEM_mallocN(sizeof(*mesh_orig->bb), __func__); - } - *mesh_orig->bb = *bb; + if (mesh->texflag & ME_AUTOSPACE_EVALUATED) { + mesh_orig->texflag |= ME_AUTOSPACE_EVALUATED; copy_v3_v3(mesh_orig->loc, mesh->loc); copy_v3_v3(mesh_orig->size, mesh->size); copy_v3_v3(mesh_orig->rot, mesh->rot); diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c index 021fd615f44..e1b1fddc730 100644 --- a/source/blender/blenkernel/intern/mesh_convert.c +++ b/source/blender/blenkernel/intern/mesh_convert.c @@ -1576,11 +1576,7 @@ void BKE_mesh_nomain_to_mesh(Mesh *mesh_src, /* Clear selection history */ MEM_SAFE_FREE(tmp.mselect); tmp.totselect = 0; - BLI_assert(ELEM(tmp.bb, NULL, mesh_dst->bb)); - if (mesh_dst->bb) { - MEM_freeN(mesh_dst->bb); - tmp.bb = NULL; - } + tmp.texflag &= ~ME_AUTOSPACE_EVALUATED; /* skip the listbase */ MEMCPY_STRUCT_AFTER(mesh_dst, &tmp, id.prev); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 7b43f281c73..de712173e8f 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -3284,9 +3284,7 @@ int BKE_object_obdata_texspace_get( } case ID_CU: { Curve *cu = ob->data; - if (cu->bb == NULL || (cu->bb->flag & BOUNDBOX_DIRTY)) { - BKE_curve_texspace_calc(cu); - } + BKE_curve_texspace_ensure(cu); if (r_texflag) { *r_texflag = &cu->texflag; } diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 312b8f883df..74fbfc318a8 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -4068,9 +4068,7 @@ void psys_get_texture( 0, texvec); - if (me->bb == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) { - BKE_mesh_texspace_calc(me); - } + BKE_mesh_texspace_ensure(me); sub_v3_v3(texvec, me->loc); if (me->size[0] != 0.0f) { texvec[0] /= me->size[0]; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 15203461ef4..6a495e61c9b 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4373,7 +4373,7 @@ static void direct_link_curve(FileData *fd, Curve *cu) switch_endian_knots(nu); } } - cu->bb = NULL; + cu->texflag &= ~CU_AUTOSPACE_EVALUATED; } /** \} */ @@ -5040,7 +5040,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) direct_link_customdata(fd, &mesh->ldata, mesh->totloop); direct_link_customdata(fd, &mesh->pdata, mesh->totpoly); - mesh->bb = NULL; + mesh->texflag &= ~ME_AUTOSPACE_EVALUATED; mesh->edit_mesh = NULL; BKE_mesh_runtime_reset(mesh); diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c index 48dad57d3ba..d73f8fd5165 100644 --- a/source/blender/draw/intern/draw_manager_data.c +++ b/source/blender/draw/intern/draw_manager_data.c @@ -451,9 +451,7 @@ static void drw_call_calc_orco(Object *ob, float (*r_orcofacs)[4]) break; case ID_CU: { Curve *cu = (Curve *)ob_data; - if (cu->bb == NULL || (cu->bb->flag & BOUNDBOX_DIRTY)) { - BKE_curve_texspace_calc(cu); - } + BKE_curve_texspace_ensure(cu); texcoloc = cu->loc; texcosize = cu->size; break; diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 97e6c2dd6f1..654393cfc60 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -3023,9 +3023,7 @@ static void DRW_shgroup_texture_space(OBJECT_ShadingGroupList *sgl, Object *ob, break; case ID_CU: { Curve *cu = (Curve *)ob_data; - if (cu->bb == NULL || (cu->bb->flag & BOUNDBOX_DIRTY)) { - BKE_curve_texspace_calc(cu); - } + BKE_curve_texspace_ensure(cu); texcoloc = cu->loc; texcosize = cu->size; break; diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index bdb3db94c89..1c8365f7b72 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -212,8 +212,6 @@ typedef struct Curve { /** Animation data (must be immediately after id for utilities to use it). */ struct AnimData *adt; - struct BoundBox *bb; - /** Actual data, called splines in rna. */ ListBase nurb; @@ -308,6 +306,7 @@ typedef struct Curve { /* Curve.texflag */ enum { CU_AUTOSPACE = 1, + CU_AUTOSPACE_EVALUATED = 2, }; #if 0 /* Moved to overlay options in 2.8 */ diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 070180d0a24..30acfa68971 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -116,8 +116,6 @@ typedef struct Mesh { /** Animation data (must be immediately after id for utilities to use it). */ struct AnimData *adt; - struct BoundBox *bb; - /** Old animation system, deprecated for 2.5. */ struct Ipo *ipo DNA_DEPRECATED; struct Key *key; @@ -218,6 +216,7 @@ typedef struct TFace { /* texflag */ enum { ME_AUTOSPACE = 1, + ME_AUTOSPACE_EVALUATED = 2, }; /* me->editflag */ diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index a7dac4100db..aab78c269e6 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -291,9 +291,7 @@ static void rna_Curve_texspace_loc_get(PointerRNA *ptr, float *values) { Curve *cu = (Curve *)ptr->data; - if (!cu->bb) { - BKE_curve_texspace_calc(cu); - } + BKE_curve_texspace_ensure(cu); copy_v3_v3(values, cu->loc); } @@ -309,9 +307,7 @@ static void rna_Curve_texspace_size_get(PointerRNA *ptr, float *values) { Curve *cu = (Curve *)ptr->data; - if (!cu->bb) { - BKE_curve_texspace_calc(cu); - } + BKE_curve_texspace_ensure(cu); copy_v3_v3(values, cu->size); } diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index af9d3d7cf1b..ed605376f0c 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -503,9 +503,7 @@ static void rna_Mesh_texspace_size_get(PointerRNA *ptr, float values[3]) { Mesh *me = (Mesh *)ptr->data; - if (me->bb == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) { - BKE_mesh_texspace_calc(me); - } + BKE_mesh_texspace_ensure(me); copy_v3_v3(values, me->size); } @@ -514,9 +512,7 @@ static void rna_Mesh_texspace_loc_get(PointerRNA *ptr, float values[3]) { Mesh *me = (Mesh *)ptr->data; - if (me->bb == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) { - BKE_mesh_texspace_calc(me); - } + BKE_mesh_texspace_ensure(me); copy_v3_v3(values, me->loc); } |