diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_geom.c | 13 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image_gpu.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 4 |
3 files changed, 23 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c index a9b0eede055..66a7ae757a2 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.c +++ b/source/blender/blenkernel/intern/gpencil_geom.c @@ -185,6 +185,19 @@ BoundBox *BKE_gpencil_boundbox_get(Object *ob) boundbox_gpencil(ob); + Object *ob_orig = (Object *)DEG_get_original_id(&ob->id); + /* Update orig object's boundbox with re-computed evaluated values. This function can be + * called with the evaluated object and need update the original object bound box data + * to keep both values synchronized. */ + if ((ob_orig != NULL) && (ob != ob_orig)) { + if (ob_orig->runtime.bb == NULL) { + ob_orig->runtime.bb = MEM_callocN(sizeof(BoundBox), "GPencil boundbox"); + } + for (int i = 0; i < 8; i++) { + copy_v3_v3(ob_orig->runtime.bb->vec[i], ob->runtime.bb->vec[i]); + } + } + return ob->runtime.bb; } diff --git a/source/blender/blenkernel/intern/image_gpu.c b/source/blender/blenkernel/intern/image_gpu.c index f37e038e69e..8e2e3fd621c 100644 --- a/source/blender/blenkernel/intern/image_gpu.c +++ b/source/blender/blenkernel/intern/image_gpu.c @@ -272,10 +272,14 @@ static GPUTexture *image_get_gpu_texture(Image *ima, * context and might as well ensure we have as much space free as possible. */ gpu_free_unused_buffers(); - /* Free GPU textures when requesting a different render pass/layer. */ - if (ima->gpu_pass != iuser->pass || ima->gpu_layer != iuser->layer) { - ima->gpu_pass = iuser->pass; - ima->gpu_layer = iuser->layer; + /* Free GPU textures when requesting a different render pass/layer. + * When `iuser` isn't set (texture painting single image mode) we assume that + * the current `pass` and `layer` should be 0. */ + short requested_pass = iuser ? iuser->pass : 0; + short requested_layer = iuser ? iuser->layer : 0; + if (ima->gpu_pass != requested_pass || ima->gpu_layer != requested_layer) { + ima->gpu_pass = requested_pass; + ima->gpu_layer = requested_layer; ima->gpuflag |= IMA_GPU_REFRESH; } diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index 1ad34fde0fa..dd8a22e10da 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -1111,8 +1111,8 @@ bool BKE_object_is_visible_in_viewport(const View3D *v3d, const struct Object *o return false; } - /* If not using local view or local collection the object may still be in a hidden collection. */ - if (((v3d->localvd) == NULL) && ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0)) { + /* If not using local collection the object may still be in a hidden collection. */ + if ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0) { return (ob->base_flag & BASE_VISIBLE_VIEWLAYER) != 0; } |