Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano Cavalcante <mano-wii>2022-01-04 17:29:15 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2022-01-07 16:42:13 +0300
commit5560f3244717221600506866bf1c79d370e0045e (patch)
tree630e1f7e4f7ea495a471c9a61ac1d6c0adccc606 /source/blender/draw/intern/draw_manager.c
parent5085c622ea883c77c723f6f6e2ca656f88d1999e (diff)
Fix T94078: Wrong Bound Box calculated for curves
`DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN` creates temporary objects that correspond to duplicates or instances. These temporary objects can share same pointers with the original object as in the case of Bounding Box. Bound Box of temporary objects is marked dirty in `BKE_object_replace_data_on_shallow_copy` since `ob->data` is different. This causes the original Bounding Box, calculated for the evaluated geometry, to be lost. The solution in this commit is to change the boundbox reference of the temporary objects, so the boundbox of the non-temporary object (with the data curve) is not marked dirty. Differential Revision: https://developer.blender.org/D13581
Diffstat (limited to 'source/blender/draw/intern/draw_manager.c')
-rw-r--r--source/blender/draw/intern/draw_manager.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 94950a1ff94..86ed08c5b0f 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -757,8 +757,11 @@ static void duplidata_key_free(void *key)
}
else {
Object temp_object = *dupli_key->ob;
+ /* Do not modify the original boundbox. */
+ temp_object.runtime.bb = NULL;
BKE_object_replace_data_on_shallow_copy(&temp_object, dupli_key->ob_data);
drw_batch_cache_generate_requested(&temp_object);
+ MEM_SAFE_FREE(temp_object.runtime.bb);
}
MEM_freeN(key);
}