Blender V4.3
lightprobe.cc File Reference
#include <cstring>
#include "DNA_collection_types.h"
#include "DNA_defaults.h"
#include "DNA_lightprobe_types.h"
#include "DNA_object_types.h"
#include "BLI_math_base.h"
#include "BLI_span.hh"
#include "BLI_utildefines.h"
#include "BKE_idtype.hh"
#include "BKE_lib_id.hh"
#include "BKE_lib_query.hh"
#include "BKE_lightprobe.h"
#include "BLT_translation.hh"
#include "BLO_read_write.hh"

Go to the source code of this file.

Functions

static void lightprobe_init_data (ID *id)
 
static void lightprobe_foreach_id (ID *id, LibraryForeachIDData *data)
 
static void lightprobe_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
void BKE_lightprobe_type_set (LightProbe *probe, const short lightprobe_type)
 
void * BKE_lightprobe_add (Main *bmain, const char *name)
 
static void lightprobe_grid_cache_frame_blend_write (BlendWriter *writer, const LightProbeGridCacheFrame *cache)
 
static void lightprobe_grid_cache_frame_blend_read (BlendDataReader *reader, LightProbeGridCacheFrame *cache)
 
void BKE_lightprobe_cache_blend_write (BlendWriter *writer, LightProbeObjectCache *cache)
 
void BKE_lightprobe_cache_blend_read (BlendDataReader *reader, LightProbeObjectCache *cache)
 
template<typename T >
static void spherical_harmonic_free (T &data)
 
template<typename DataT , typename T >
static void spherical_harmonic_copy (T &dst, T &src)
 
LightProbeGridCacheFrameBKE_lightprobe_grid_cache_frame_create ()
 
LightProbeGridCacheFrameBKE_lightprobe_grid_cache_frame_copy (LightProbeGridCacheFrame *src)
 
void BKE_lightprobe_grid_cache_frame_free (LightProbeGridCacheFrame *cache)
 
void BKE_lightprobe_cache_create (Object *object)
 
LightProbeObjectCacheBKE_lightprobe_cache_copy (LightProbeObjectCache *src_cache)
 
void BKE_lightprobe_cache_free (Object *object)
 
int64_t BKE_lightprobe_grid_cache_frame_sample_count (const LightProbeGridCacheFrame *cache)
 

Variables

IDTypeInfo IDType_ID_LP
 

Function Documentation

◆ BKE_lightprobe_add()

void * BKE_lightprobe_add ( Main * bmain,
const char * name )

Definition at line 107 of file lightprobe.cc.

References BKE_id_new(), and ID_LP.

Referenced by BKE_object_obdata_add_from_type().

◆ BKE_lightprobe_cache_blend_read()

void BKE_lightprobe_cache_blend_read ( BlendDataReader * reader,
LightProbeObjectCache * cache )

◆ BKE_lightprobe_cache_blend_write()

void BKE_lightprobe_cache_blend_write ( BlendWriter * writer,
LightProbeObjectCache * cache )

◆ BKE_lightprobe_cache_copy()

LightProbeObjectCache * BKE_lightprobe_cache_copy ( LightProbeObjectCache * src_cache)

Create a copy of a whole cache. This does not include the in-progress baking data.

Definition at line 253 of file lightprobe.cc.

References BKE_lightprobe_grid_cache_frame_copy(), BLI_assert, LightProbeObjectCache::grid_static_cache, and MEM_dupallocN.

Referenced by object_copy_data().

◆ BKE_lightprobe_cache_create()

void BKE_lightprobe_cache_create ( struct Object * object)

Create the grid cache list depending on the lightprobe baking settings. The list is left empty to be filled by the baking process.

Definition at line 245 of file lightprobe.cc.

References BLI_assert, and MEM_callocN.

Referenced by lightprobe_cache_irradiance_volume_subset_get().

◆ BKE_lightprobe_cache_free()

void BKE_lightprobe_cache_free ( struct Object * object)

◆ BKE_lightprobe_grid_cache_frame_copy()

◆ BKE_lightprobe_grid_cache_frame_create()

LightProbeGridCacheFrame * BKE_lightprobe_grid_cache_frame_create ( void )

Create a single empty irradiance grid cache.

Definition at line 206 of file lightprobe.cc.

References MEM_callocN.

Referenced by blender::eevee::IrradianceBake::read_result_packed(), and blender::eevee::IrradianceBake::read_result_unpacked().

◆ BKE_lightprobe_grid_cache_frame_free()

◆ BKE_lightprobe_grid_cache_frame_sample_count()

◆ BKE_lightprobe_type_set()

◆ lightprobe_blend_write()

static void lightprobe_blend_write ( BlendWriter * writer,
ID * id,
const void * id_address )
static

Definition at line 44 of file lightprobe.cc.

References BKE_id_blend_write(), BLO_write_id_struct, and LightProbe::id.

◆ lightprobe_foreach_id()

static void lightprobe_foreach_id ( ID * id,
LibraryForeachIDData * data )
static

◆ lightprobe_grid_cache_frame_blend_read()

◆ lightprobe_grid_cache_frame_blend_write()

◆ lightprobe_init_data()

static void lightprobe_init_data ( ID * id)
static

◆ spherical_harmonic_copy()

template<typename DataT , typename T >
static void spherical_harmonic_copy ( T & dst,
T & src )
static

Definition at line 198 of file lightprobe.cc.

References MEM_dupallocN.

Referenced by BKE_lightprobe_grid_cache_frame_copy().

◆ spherical_harmonic_free()

template<typename T >
static void spherical_harmonic_free ( T & data)
static

Definition at line 190 of file lightprobe.cc.

References MEM_SAFE_FREE.

Referenced by BKE_lightprobe_grid_cache_frame_free().

Variable Documentation

◆ IDType_ID_LP

IDTypeInfo IDType_ID_LP
Initial value:
= {
sizeof(LightProbe),
"LightProbe",
N_("lightprobes"),
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition BKE_idtype.hh:39
#define BLT_I18NCONTEXT_ID_LIGHTPROBE
@ INDEX_ID_LP
Definition DNA_ID.h:1303
#define FILTER_ID_IM
Definition DNA_ID.h:1171
#define FILTER_ID_LP
Definition DNA_ID.h:1194
@ ID_LP
struct LightProbe LightProbe
static void lightprobe_init_data(ID *id)
Definition lightprobe.cc:29
static void lightprobe_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition lightprobe.cc:44
static void lightprobe_foreach_id(ID *id, LibraryForeachIDData *data)
Definition lightprobe.cc:37
#define N_(msgid)

Definition at line 53 of file lightprobe.cc.