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:
authorClément Foucault <foucault.clem@gmail.com>2018-07-11 17:54:10 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-07-11 17:54:20 +0300
commitad03a06d3c46f7a1ddb81e5d2c1406457b8f4507 (patch)
tree6e9c21d6da79016f15bd68e18582ccb60a0f3cf6 /source/blender/editors/space_view3d
parentb1c2f4d468c91a257fbc696700521509325aa6f4 (diff)
Eevee: LightCache: Fix autobake starting when it should not
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 5cff64218ec..43b6a1b0621 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -32,6 +32,7 @@
#include <string.h>
#include <stdio.h>
+#include "DNA_lightprobe_types.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
@@ -685,6 +686,13 @@ static void view3d_lightcache_update(bContext *C)
{
PointerRNA op_ptr;
+ Scene *scene = CTX_data_scene(C);
+
+ if (strcmp(scene->r.engine, RE_engine_id_BLENDER_EEVEE) != 0) {
+ /* Only do auto bake if eevee is the active engine */
+ return;
+ }
+
WM_operator_properties_create(&op_ptr, "SCENE_OT_light_cache_bake");
RNA_int_set(&op_ptr, "delay", 200);
RNA_enum_set_identifier(C, &op_ptr, "subset", "DIRTY");
@@ -1424,9 +1432,13 @@ static void space_view3d_listener(
static void space_view3d_refresh(const bContext *C, ScrArea *UNUSED(sa))
{
- /* This is only used by the auto lightprobe refresh for the moment.
- * So we don't need to check anything to know what to do. */
- view3d_lightcache_update((bContext *)C);
+ Scene *scene = CTX_data_scene(C);
+ LightCache *lcache = scene->eevee.light_cache;
+
+ if (lcache && (lcache->flag & LIGHTCACHE_UPDATE_AUTO) != 0) {
+ lcache->flag &= ~LIGHTCACHE_UPDATE_AUTO;
+ view3d_lightcache_update((bContext *)C);
+ }
}
const char *view3d_context_dir[] = {