diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 0fb6b8005d4..5945fa4bf33 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -54,7 +54,6 @@ #include "BKE_material.h" #include "DEG_depsgraph.h" -#include "DEG_depsgraph_query.h" #include "CLG_log.h" @@ -5432,18 +5431,8 @@ void BKE_curve_rect_from_textbox(const struct Curve *cu, void BKE_curve_eval_geometry(Depsgraph *depsgraph, Curve *curve) { DEG_debug_print_eval(depsgraph, __func__, curve->id.name, 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; - copy_v3_v3(curve_orig->loc, curve->loc); - copy_v3_v3(curve_orig->size, curve->size); - } + if (curve->bb == NULL || (curve->bb->flag & BOUNDBOX_DIRTY)) { + BKE_curve_texspace_calc(curve); } } diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 35f96e50e3a..755a8036e8e 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -50,7 +50,6 @@ #include "BKE_editmesh.h" #include "DEG_depsgraph.h" -#include "DEG_depsgraph_query.h" enum { MESHCMP_DVERT_WEIGHTMISMATCH = 1, @@ -1996,7 +1995,9 @@ void BKE_mesh_split_faces(Mesh *mesh, bool free_loop_normals) void BKE_mesh_eval_geometry(Depsgraph *depsgraph, Mesh *mesh) { DEG_debug_print_eval(depsgraph, __func__, mesh->id.name, mesh); - BKE_mesh_texspace_calc(mesh); + if (mesh->bb == NULL || (mesh->bb->flag & BOUNDBOX_DIRTY)) { + BKE_mesh_texspace_calc(mesh); + } /* Clear autospace flag in evaluated mesh, so that texspace does not get recomputed when bbox is * (e.g. after modifiers, etc.) */ mesh->texflag &= ~ME_AUTOSPACE; @@ -2008,16 +2009,4 @@ void BKE_mesh_eval_geometry(Depsgraph *depsgraph, Mesh *mesh) BKE_id_free(NULL, mesh->runtime.mesh_eval); mesh->runtime.mesh_eval = NULL; } - 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; - copy_v3_v3(mesh_orig->loc, mesh->loc); - copy_v3_v3(mesh_orig->size, mesh->size); - } - } } diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index ba4f3c53692..c51097fc8c3 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -496,12 +496,22 @@ static int rna_Mesh_texspace_editable(PointerRNA *ptr, const char **UNUSED(r_inf 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); + } + 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 == NULL || (me->bb->flag & BOUNDBOX_DIRTY)) { + BKE_mesh_texspace_calc(me); + } + copy_v3_v3(values, me->loc); }