diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-02 17:48:28 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-07-02 17:51:17 +0300 |
commit | 87c39f11231b165ce913673676f57d6a013c23c4 (patch) | |
tree | d733a5905886bbf706e6fa26a1b0a25b23928192 /source/blender/blenkernel/intern/curve.c | |
parent | 65bc59a56d0b5c2e012daf84de834fac2909cfc2 (diff) |
Fix T65798: Incorrect auto-tex space for Curves
There are several aspects to the fix:
- Always calculate bounding box for meshes and curves from dependency
graph evaluation function.
There is a reason why mesh was tagged for geometry update, so can not
be spare here in attempts to avoid calculation.
- Copy bounding box and texture space to original object for active
dependency graph.
This matches object-level bounding box and allows to remove bounding
box evaluation from RNA.
Diffstat (limited to 'source/blender/blenkernel/intern/curve.c')
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 5945fa4bf33..8a2450efa55 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -54,6 +54,7 @@ #include "BKE_material.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "CLG_log.h" @@ -5431,8 +5432,19 @@ 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); - if (curve->bb == NULL || (curve->bb->flag & BOUNDBOX_DIRTY)) { - BKE_curve_texspace_calc(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); + copy_v3_v3(curve_orig->rot, curve->rot); + } } } |