Blender  V3.3
Macros | Functions | Variables
world.c File Reference
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_defaults.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "BKE_anim_data.h"
#include "BKE_icons.h"
#include "BKE_idtype.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BKE_world.h"
#include "BLT_translation.h"
#include "DRW_engine.h"
#include "DEG_depsgraph.h"
#include "GPU_material.h"
#include "BLO_read_write.h"

Go to the source code of this file.

Macros

#define DNA_DEPRECATED_ALLOW
 

Functions

static void world_free_data (ID *id)
 
static void world_init_data (ID *id)
 
static void world_copy_data (Main *bmain, ID *id_dst, const ID *id_src, const int flag)
 
static void world_foreach_id (ID *id, LibraryForeachIDData *data)
 
static void world_blend_write (BlendWriter *writer, ID *id, const void *id_address)
 
static void world_blend_read_data (BlendDataReader *reader, ID *id)
 
static void world_blend_read_lib (BlendLibReader *reader, ID *id)
 
static void world_blend_read_expand (BlendExpander *expander, ID *id)
 
WorldBKE_world_add (Main *bmain, const char *name)
 
void BKE_world_eval (struct Depsgraph *depsgraph, World *world)
 

Variables

IDTypeInfo IDType_ID_WO
 

Macro Definition Documentation

◆ DNA_DEPRECATED_ALLOW

#define DNA_DEPRECATED_ALLOW

Definition at line 15 of file world.c.

Function Documentation

◆ BKE_world_add()

World* BKE_world_add ( Main bmain,
const char *  name 
)

Definition at line 212 of file world.c.

References BKE_id_new(), and ID_WO.

Referenced by new_world_exec().

◆ BKE_world_eval()

void BKE_world_eval ( struct Depsgraph depsgraph,
World world 
)

◆ world_blend_read_data()

static void world_blend_read_data ( BlendDataReader reader,
ID id 
)
static

◆ world_blend_read_expand()

static void world_blend_read_expand ( BlendExpander expander,
ID id 
)
static

Definition at line 176 of file world.c.

References BLO_expand.

◆ world_blend_read_lib()

static void world_blend_read_lib ( BlendLibReader reader,
ID id 
)
static

Definition at line 170 of file world.c.

References BLO_read_id_address, World::id, and ID::lib.

◆ world_blend_write()

static void world_blend_write ( BlendWriter writer,
ID id,
const void id_address 
)
static

◆ world_copy_data()

static void world_copy_data ( Main bmain,
ID id_dst,
const ID id_src,
const int  flag 
)
static

Only copy internal data of World ID from source to already allocated/initialized destination. You probably never want to use that directly, use BKE_id_copy or BKE_id_copy_ex for typical needs.

WARNING! This function will not handle ID user count!

Parameters
flagCopying options (see BKE_lib_id.h's LIB_ID_COPY_... flags for more).

Definition at line 84 of file world.c.

References BKE_id_copy_ex(), BKE_previewimg_id_copy(), BLI_listbase_clear(), World::drawdata, World::gpumaterial, World::id, LIB_ID_COPY_NO_PREVIEW, LIB_ID_CREATE_LOCAL, LIB_ID_CREATE_NO_ALLOCATE, World::lightgroup, MEM_dupallocN, World::nodetree, ntreeLocalize, NULL, and World::preview.

◆ world_foreach_id()

static void world_foreach_id ( ID id,
LibraryForeachIDData data 
)
static

◆ world_free_data()

static void world_free_data ( ID id)
static

Free (or release) any data used by this world (does not free the world itself).

Definition at line 45 of file world.c.

References BKE_icon_id_delete(), BKE_previewimg_free(), DRW_drawdata_free(), GPU_material_free(), World::gpumaterial, World::lightgroup, MEM_freeN, MEM_SAFE_FREE, World::nodetree, ntreeFreeEmbeddedTree(), NULL, and World::preview.

◆ world_init_data()

static void world_init_data ( ID id)
static

Variable Documentation

◆ IDType_ID_WO

IDTypeInfo IDType_ID_WO
Initial value:
= {
.id_code = ID_WO,
.id_filter = FILTER_ID_WO,
.main_listbase_index = INDEX_ID_WO,
.struct_size = sizeof(World),
.name = "World",
.name_plural = "worlds",
.translation_context = BLT_I18NCONTEXT_ID_WORLD,
.asset_type_info = NULL,
.copy_data = world_copy_data,
.free_data = world_free_data,
.make_local = NULL,
.foreach_id = world_foreach_id,
.foreach_cache = NULL,
.foreach_path = NULL,
.owner_get = NULL,
.blend_write = world_blend_write,
.blend_read_data = world_blend_read_data,
.blend_read_lib = world_blend_read_lib,
.blend_read_expand = world_blend_read_expand,
.blend_read_undo_preserve = NULL,
.lib_override_apply_post = NULL,
}
@ IDTYPE_FLAGS_APPEND_IS_REUSABLE
Definition: BKE_idtype.h:39
#define BLT_I18NCONTEXT_ID_WORLD
@ INDEX_ID_WO
Definition: DNA_ID.h:1014
#define FILTER_ID_WO
Definition: DNA_ID.h:925
@ ID_WO
Definition: DNA_ID_enums.h:59
struct World World
static void init_data(ModifierData *md)
static void world_blend_read_expand(BlendExpander *expander, ID *id)
Definition: world.c:176
static void world_blend_read_lib(BlendLibReader *reader, ID *id)
Definition: world.c:170
static void world_free_data(ID *id)
Definition: world.c:45
static void world_blend_write(BlendWriter *writer, ID *id, const void *id_address)
Definition: world.c:129
static void world_blend_read_data(BlendDataReader *reader, ID *id)
Definition: world.c:157
static void world_foreach_id(ID *id, LibraryForeachIDData *data)
Definition: world.c:118
static void world_init_data(ID *id)
Definition: world.c:66
static void world_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag)
Definition: world.c:84

Definition at line 182 of file world.c.