Eevee: LightCache: Fix autobake starting when it should not
This commit is contained in:
parent
b1c2f4d468
commit
ad03a06d3c
@ -846,10 +846,11 @@ void EEVEE_lightprobes_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *ved
|
||||
/* If we update grid we need to update the cubemaps too.
|
||||
* So always refresh cubemaps. */
|
||||
scene_orig->eevee.light_cache->flag |= LIGHTCACHE_UPDATE_CUBE;
|
||||
/* Tag the lightcache to auto update. */
|
||||
scene_orig->eevee.light_cache->flag |= LIGHTCACHE_UPDATE_AUTO;
|
||||
/* Use a notifier to trigger the operator after drawing. */
|
||||
WM_event_add_notifier(draw_ctx->evil_C, NC_LIGHTPROBE, scene_orig);
|
||||
}
|
||||
|
||||
/* Use a notifier to trigger the operator after drawing. */
|
||||
WM_event_add_notifier(draw_ctx->evil_C, NC_LIGHTPROBE, scene_orig);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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[] = {
|
||||
|
@ -169,6 +169,7 @@ enum {
|
||||
LIGHTCACHE_UPDATE_CUBE = (1 << 4),
|
||||
LIGHTCACHE_UPDATE_GRID = (1 << 5),
|
||||
LIGHTCACHE_UPDATE_WORLD = (1 << 6),
|
||||
LIGHTCACHE_UPDATE_AUTO = (1 << 7),
|
||||
};
|
||||
|
||||
/* EEVEE_LightCacheTexture->data_type */
|
||||
|
Loading…
Reference in New Issue
Block a user