DNA: rename Lamp -> Light

- BKE_lamp -> BKE_light
- Main.lamp -> light
This commit is contained in:
Campbell Barton 2019-02-27 10:46:48 +11:00
parent ce104ca896
commit 3051e2f4ae
Notes: blender-bot 2023-02-14 03:44:36 +01:00
Referenced by commit f8b2268f4f, Fix error renaming Lamp to Light
Referenced by issue #61500, DNA renaming proposal
68 changed files with 215 additions and 217 deletions

View File

@ -30,17 +30,17 @@ extern "C" {
#include "BLI_compiler_attrs.h"
struct Lamp;
struct Light;
struct Main;
struct Scene;
void BKE_lamp_init(struct Lamp *la);
struct Lamp *BKE_lamp_add(struct Main *bmain, const char *name) ATTR_WARN_UNUSED_RESULT;
void BKE_lamp_copy_data(struct Main *bmain, struct Lamp *la_dst, const struct Lamp *la_src, const int flag);
struct Lamp *BKE_lamp_copy(struct Main *bmain, const struct Lamp *la) ATTR_WARN_UNUSED_RESULT;
struct Lamp *BKE_lamp_localize(struct Lamp *la) ATTR_WARN_UNUSED_RESULT;
void BKE_lamp_make_local(struct Main *bmain, struct Lamp *la, const bool lib_local);
void BKE_lamp_free(struct Lamp *la);
void BKE_light_init(struct Light *la);
struct Light *BKE_light_add(struct Main *bmain, const char *name) ATTR_WARN_UNUSED_RESULT;
void BKE_light_copy_data(struct Main *bmain, struct Light *la_dst, const struct Light *la_src, const int flag);
struct Light *BKE_light_copy(struct Main *bmain, const struct Light *la) ATTR_WARN_UNUSED_RESULT;
struct Light *BKE_light_localize(struct Light *la) ATTR_WARN_UNUSED_RESULT;
void BKE_light_make_local(struct Main *bmain, struct Light *la, const bool lib_local);
void BKE_light_free(struct Light *la);
#ifdef __cplusplus
}

View File

@ -94,7 +94,7 @@ typedef struct Main {
ListBase tex;
ListBase image;
ListBase latt;
ListBase lamp;
ListBase light;
ListBase camera;
ListBase ipo; // XXX deprecated
ListBase key;

View File

@ -662,7 +662,7 @@ struct NodeTreeIterStore {
Scene *scene;
Material *mat;
Tex *tex;
Lamp *lamp;
Light *light;
World *world;
FreestyleLineStyle *linestyle;
};

View File

@ -31,7 +31,7 @@ struct Brush;
struct ColorBand;
struct FreestyleLineStyle;
struct ImagePool;
struct Lamp;
struct Light;
struct MTex;
struct Main;
struct Material;

View File

@ -1132,7 +1132,7 @@ void BKE_animdata_main_cb(Main *bmain, ID_AnimData_Edit_Callback func, void *use
ANIMDATA_NODETREE_IDS_CB(bmain->tex.first, Tex);
/* lamps */
ANIMDATA_NODETREE_IDS_CB(bmain->lamp.first, Lamp);
ANIMDATA_NODETREE_IDS_CB(bmain->light.first, Light);
/* materials */
ANIMDATA_NODETREE_IDS_CB(bmain->mat.first, Material);
@ -1231,7 +1231,7 @@ void BKE_animdata_fix_paths_rename_all(ID *ref_id, const char *prefix, const cha
RENAMEFIX_ANIM_NODETREE_IDS(bmain->tex.first, Tex);
/* lamps */
RENAMEFIX_ANIM_NODETREE_IDS(bmain->lamp.first, Lamp);
RENAMEFIX_ANIM_NODETREE_IDS(bmain->light.first, Light);
/* materials */
RENAMEFIX_ANIM_NODETREE_IDS(bmain->mat.first, Material);
@ -3613,7 +3613,7 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, Scene
EVAL_ANIM_NODETREE_IDS(main->tex.first, Tex, ADT_RECALC_ANIM);
/* lamps */
EVAL_ANIM_NODETREE_IDS(main->lamp.first, Lamp, ADT_RECALC_ANIM);
EVAL_ANIM_NODETREE_IDS(main->light.first, Light, ADT_RECALC_ANIM);
/* materials */
EVAL_ANIM_NODETREE_IDS(main->mat.first, Material, ADT_RECALC_ANIM);

View File

@ -202,7 +202,7 @@ void BKE_camera_params_from_object(CameraParams *params, const Object *ob)
}
else if (ob->type == OB_LAMP) {
/* lamp object */
Lamp *la = ob->data;
Light *la = ob->data;
params->lens = 16.0f / tanf(la->spotsize * 0.5f);
if (params->lens == 0.0f)
params->lens = 35.0f;

View File

@ -323,7 +323,7 @@ PreviewImage **BKE_previewimg_id_get_p(const ID *id)
ID_PRV_CASE(ID_MA, Material);
ID_PRV_CASE(ID_TE, Tex);
ID_PRV_CASE(ID_WO, World);
ID_PRV_CASE(ID_LA, Lamp);
ID_PRV_CASE(ID_LA, Light);
ID_PRV_CASE(ID_IM, Image);
ID_PRV_CASE(ID_BR, Brush);
ID_PRV_CASE(ID_OB, Object);

View File

@ -614,7 +614,7 @@ static const char *camera_adrcodes_to_paths(int adrcode, int *array_index)
return NULL;
}
/* Lamp Types */
/* Light Types */
static const char *lamp_adrcodes_to_paths(int adrcode, int *array_index)
{
/* set array index like this in-case nothing sets it correctly */
@ -1990,8 +1990,8 @@ void do_versions_ipos_to_animato(Main *bmain)
}
/* lamps */
for (id = bmain->lamp.first; id; id = id->next) {
Lamp *la = (Lamp *)id;
for (id = bmain->light.first; id; id = id->next) {
Light *la = (Light *)id;
if (G.debug & G_DEBUG) printf("\tconverting light %s\n", id->name + 2);
@ -2000,7 +2000,7 @@ void do_versions_ipos_to_animato(Main *bmain)
/* Add AnimData block */
AnimData *adt = BKE_animdata_add_id(id);
/* Convert Lamp data... */
/* Convert Light data... */
ipo_to_animdata(bmain, id, la->ipo, NULL, NULL, NULL);
if (adt->action)

View File

@ -44,7 +44,7 @@
#include "BKE_main.h"
#include "BKE_node.h"
void BKE_lamp_init(Lamp *la)
void BKE_light_init(Light *la)
{
BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(la, id));
@ -84,26 +84,26 @@ void BKE_lamp_init(Lamp *la)
curvemapping_initialize(la->curfalloff);
}
Lamp *BKE_lamp_add(Main *bmain, const char *name)
Light *BKE_light_add(Main *bmain, const char *name)
{
Lamp *la;
Light *la;
la = BKE_libblock_alloc(bmain, ID_LA, name, 0);
BKE_lamp_init(la);
BKE_light_init(la);
return la;
}
/**
* Only copy internal data of Lamp ID from source to already allocated/initialized destination.
* Only copy internal data of Light 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!
*
* \param flag: Copying options (see BKE_library.h's LIB_ID_COPY_... flags for more).
*/
void BKE_lamp_copy_data(Main *bmain, Lamp *la_dst, const Lamp *la_src, const int flag)
void BKE_light_copy_data(Main *bmain, Light *la_dst, const Light *la_src, const int flag)
{
la_dst->curfalloff = curvemapping_copy(la_src->curfalloff);
@ -121,18 +121,18 @@ void BKE_lamp_copy_data(Main *bmain, Lamp *la_dst, const Lamp *la_src, const int
}
}
Lamp *BKE_lamp_copy(Main *bmain, const Lamp *la)
Light *BKE_light_copy(Main *bmain, const Light *la)
{
Lamp *la_copy;
Light *la_copy;
BKE_id_copy(bmain, &la->id, (ID **)&la_copy);
return la_copy;
}
Lamp *BKE_lamp_localize(Lamp *la)
Light *BKE_light_localize(Light *la)
{
/* TODO(bastien): Replace with something like:
*
* Lamp *la_copy;
* Light *la_copy;
* BKE_id_copy_ex(bmain, &la->id, (ID **)&la_copy,
* LIB_ID_COPY_NO_MAIN | LIB_ID_COPY_NO_PREVIEW | LIB_ID_COPY_NO_USER_REFCOUNT,
* false);
@ -140,7 +140,7 @@ Lamp *BKE_lamp_localize(Lamp *la)
*
* NOTE: Only possible once nested node trees are fully converted to that too. */
Lamp *lan = BKE_libblock_copy_for_localize(&la->id);
Light *lan = BKE_libblock_copy_for_localize(&la->id);
lan->curfalloff = curvemapping_copy(la->curfalloff);
@ -154,12 +154,12 @@ Lamp *BKE_lamp_localize(Lamp *la)
return lan;
}
void BKE_lamp_make_local(Main *bmain, Lamp *la, const bool lib_local)
void BKE_light_make_local(Main *bmain, Light *la, const bool lib_local)
{
BKE_id_make_local_generic(bmain, &la->id, true, lib_local);
}
void BKE_lamp_free(Lamp *la)
void BKE_light_free(Light *la)
{
BKE_animdata_free((ID *)la, false);

View File

@ -409,7 +409,7 @@ bool id_make_local(Main *bmain, ID *id, const bool test, const bool lib_local)
if (!test) BKE_lattice_make_local(bmain, (Lattice *)id, lib_local);
return true;
case ID_LA:
if (!test) BKE_lamp_make_local(bmain, (Lamp *)id, lib_local);
if (!test) BKE_light_make_local(bmain, (Light *)id, lib_local);
return true;
case ID_CA:
if (!test) BKE_camera_make_local(bmain, (Camera *)id, lib_local);
@ -591,7 +591,7 @@ bool BKE_id_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int flag)
BKE_lattice_copy_data(bmain, (Lattice *)*r_newid, (Lattice *)id, flag);
break;
case ID_LA:
BKE_lamp_copy_data(bmain, (Lamp *)*r_newid, (Lamp *)id, flag);
BKE_light_copy_data(bmain, (Light *)*r_newid, (Light *)id, flag);
break;
case ID_SPK:
BKE_speaker_copy_data(bmain, (Speaker *)*r_newid, (Speaker *)id, flag);
@ -716,7 +716,7 @@ void BKE_id_swap(Main *bmain, ID *id_a, ID *id_b)
CASE_SWAP(ID_TE, Tex);
CASE_SWAP(ID_IM, Image);
CASE_SWAP(ID_LT, Lattice);
CASE_SWAP(ID_LA, Lamp);
CASE_SWAP(ID_LA, Light);
CASE_SWAP(ID_LP, LightProbe);
CASE_SWAP(ID_CA, Camera);
CASE_SWAP(ID_KE, Key);
@ -1049,7 +1049,7 @@ size_t BKE_libblock_get_alloc_info(short type, const char **name)
CASE_RETURN(ID_TE, Tex);
CASE_RETURN(ID_IM, Image);
CASE_RETURN(ID_LT, Lattice);
CASE_RETURN(ID_LA, Lamp);
CASE_RETURN(ID_LA, Light);
CASE_RETURN(ID_CA, Camera);
CASE_RETURN(ID_IP, Ipo);
CASE_RETURN(ID_KE, Key);
@ -1186,7 +1186,7 @@ void BKE_libblock_init_empty(ID *id)
BKE_lattice_init((Lattice *)id);
break;
case ID_LA:
BKE_lamp_init((Lamp *)id);
BKE_light_init((Light *)id);
break;
case ID_SPK:
BKE_speaker_init((Speaker *)id);

View File

@ -702,7 +702,7 @@ void BKE_library_foreach_ID_link(Main *bmain, ID *id, LibraryIDLinkCallback call
case ID_LA:
{
Lamp *lamp = (Lamp *) id;
Light *lamp = (Light *) id;
if (lamp->nodetree) {
/* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */
library_foreach_ID_as_subdata_link((ID **)&lamp->nodetree, callback, user_data, flag, &data);

View File

@ -732,7 +732,7 @@ void BKE_libblock_free_datablock(ID *id, const int UNUSED(flag))
BKE_lattice_free((Lattice *)id);
break;
case ID_LA:
BKE_lamp_free((Lamp *)id);
BKE_light_free((Light *)id);
break;
case ID_CA:
BKE_camera_free((Camera *) id);

View File

@ -342,7 +342,7 @@ ListBase *which_libbase(Main *bmain, short type)
case ID_LT:
return &(bmain->latt);
case ID_LA:
return &(bmain->lamp);
return &(bmain->light);
case ID_CA:
return &(bmain->camera);
case ID_IP:
@ -433,7 +433,7 @@ int set_listbasepointers(Main *bmain, ListBase **lb)
lb[INDEX_ID_MB] = &(bmain->mball);
lb[INDEX_ID_LT] = &(bmain->latt);
lb[INDEX_ID_LA] = &(bmain->lamp);
lb[INDEX_ID_LA] = &(bmain->light);
lb[INDEX_ID_CA] = &(bmain->camera);
lb[INDEX_ID_TXT] = &(bmain->text);

View File

@ -1965,7 +1965,7 @@ bNodeTree *ntreeFromID(const ID *id)
{
switch (GS(id->name)) {
case ID_MA: return ((const Material *)id)->nodetree;
case ID_LA: return ((const Lamp *)id)->nodetree;
case ID_LA: return ((const Light *)id)->nodetree;
case ID_WO: return ((const World *)id)->nodetree;
case ID_TE: return ((const Tex *)id)->nodetree;
case ID_SCE: return ((const Scene *)id)->nodetree;
@ -3694,7 +3694,7 @@ void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *b
ntreeiter->scene = bmain->scene.first;
ntreeiter->mat = bmain->mat.first;
ntreeiter->tex = bmain->tex.first;
ntreeiter->lamp = bmain->lamp.first;
ntreeiter->light = bmain->light.first;
ntreeiter->world = bmain->world.first;
ntreeiter->linestyle = bmain->linestyle.first;
}
@ -3721,10 +3721,10 @@ bool BKE_node_tree_iter_step(struct NodeTreeIterStore *ntreeiter,
*r_id = (ID *)ntreeiter->tex;
ntreeiter->tex = ntreeiter->tex->id.next;
}
else if (ntreeiter->lamp) {
*r_nodetree = ntreeiter->lamp->nodetree;
*r_id = (ID *)ntreeiter->lamp;
ntreeiter->lamp = ntreeiter->lamp->id.next;
else if (ntreeiter->light) {
*r_nodetree = ntreeiter->light->nodetree;
*r_id = (ID *)ntreeiter->light;
ntreeiter->light = ntreeiter->light->id.next;
}
else if (ntreeiter->world) {
*r_nodetree = ntreeiter->world->nodetree;

View File

@ -793,7 +793,7 @@ void *BKE_object_obdata_add_from_type(Main *bmain, int type, const char *name)
case OB_FONT: return BKE_curve_add(bmain, name, OB_FONT);
case OB_MBALL: return BKE_mball_add(bmain, name);
case OB_CAMERA: return BKE_camera_add(bmain, name);
case OB_LAMP: return BKE_lamp_add(bmain, name);
case OB_LAMP: return BKE_light_add(bmain, name);
case OB_LATTICE: return BKE_lattice_add(bmain, name);
case OB_ARMATURE: return BKE_armature_add(bmain, name);
case OB_SPEAKER: return BKE_speaker_add(bmain, name);
@ -1680,7 +1680,7 @@ void BKE_object_obdata_size_init(struct Object *ob, const float size)
}
case OB_LAMP:
{
Lamp *lamp = ob->data;
Light *lamp = ob->data;
lamp->dist *= size;
lamp->area_size *= size;
lamp->area_sizey *= size;

View File

@ -723,7 +723,7 @@ static int get_lamp(ViewLayer *view_layer, float *light)
// try to find a lamp, preferably local
for (base_tmp = FIRSTBASE(view_layer); base_tmp; base_tmp = base_tmp->next) {
if (base_tmp->object->type == OB_LAMP) {
Lamp *la = base_tmp->object->data;
Light *la = base_tmp->object->data;
if (la->type == LA_LOCAL) {
copy_v3_v3(light, base_tmp->object->obmat[3]);

View File

@ -253,7 +253,7 @@ LinkNode *BLO_blendhandle_get_previews(BlendHandle *bh, int ofblocktype, int *to
}
/**
* Gets the names of all the linkable datablock types available in a file. (e.g. "Scene", "Mesh", "Lamp", etc.).
* Gets the names of all the linkable datablock types available in a file. (e.g. "Scene", "Mesh", "Light", etc.).
*
* \param bh: The blendhandle to access.
* \return A BLI_linklist of strings. The string links should be freed with malloc.

View File

@ -3975,7 +3975,7 @@ static void direct_link_camera(FileData *fd, Camera *ca)
static void lib_link_lamp(FileData *fd, Main *main)
{
for (Lamp *la = main->lamp.first; la; la = la->id.next) {
for (Light *la = main->light.first; la; la = la->id.next) {
if (la->id.tag & LIB_TAG_NEED_LINK) {
IDP_LibLinkProperty(la->id.properties, fd);
lib_link_animdata(fd, &la->id, la->adt);
@ -3992,7 +3992,7 @@ static void lib_link_lamp(FileData *fd, Main *main)
}
}
static void direct_link_lamp(FileData *fd, Lamp *la)
static void direct_link_lamp(FileData *fd, Light *la)
{
la->adt = newdataadr(fd, la->adt);
direct_link_animdata(fd, la->adt);
@ -9059,7 +9059,7 @@ static BHead *read_libblock(FileData *fd, Main *main, BHead *bhead, const int ta
direct_link_image(fd, (Image *)id);
break;
case ID_LA:
direct_link_lamp(fd, (Lamp *)id);
direct_link_lamp(fd, (Light *)id);
break;
case ID_VF:
direct_link_vfont(fd, (VFont *)id);
@ -10126,7 +10126,7 @@ static void expand_material(FileData *fd, Main *mainvar, Material *ma)
}
}
static void expand_lamp(FileData *fd, Main *mainvar, Lamp *la)
static void expand_lamp(FileData *fd, Main *mainvar, Light *la)
{
expand_doit(fd, mainvar, la->ipo); // XXX deprecated - old animation system
@ -10692,7 +10692,7 @@ void BLO_expand_main(void *fdhandle, Main *mainvar)
expand_lattice(fd, mainvar, (Lattice *)id);
break;
case ID_LA:
expand_lamp(fd, mainvar, (Lamp *)id);
expand_lamp(fd, mainvar, (Light *)id);
break;
case ID_KE:
expand_key(fd, mainvar, (Key *)id);

View File

@ -822,7 +822,6 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
Scene *sce;
Material *mat;
Tex *tex;
Lamp *lamp;
World *world;
bNodeTree *ntree;
@ -841,9 +840,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
do_versions_nodetree_socket_use_flags_2_62(tex->nodetree);
}
for (lamp = bmain->lamp.first; lamp; lamp = lamp->id.next) {
if (lamp->nodetree)
do_versions_nodetree_socket_use_flags_2_62(lamp->nodetree);
for (Light *la = bmain->light.first; la; la = la->id.next) {
if (la->nodetree)
do_versions_nodetree_socket_use_flags_2_62(la->nodetree);
}
for (world = bmain->world.first; world; world = world->id.next) {
@ -1177,7 +1176,6 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
Scene *sce;
Material *mat;
Tex *tex;
Lamp *lamp;
World *world;
bNodeTree *ntree;
@ -1193,9 +1191,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (tex->nodetree)
do_versions_nodetree_frame_2_64_6(tex->nodetree);
for (lamp = bmain->lamp.first; lamp; lamp = lamp->id.next)
if (lamp->nodetree)
do_versions_nodetree_frame_2_64_6(lamp->nodetree);
for (Light *la = bmain->light.first; la; la = la->id.next)
if (la->nodetree)
do_versions_nodetree_frame_2_64_6(la->nodetree);
for (world = bmain->world.first; world; world = world->id.next)
if (world->nodetree)
@ -2319,10 +2317,10 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
{
Scene *scene;
Object *ob;
Lamp *lamp;
for (lamp = bmain->lamp.first; lamp; lamp = lamp->id.next)
lamp->spotsize = DEG2RADF(lamp->spotsize);
for (Light *la = bmain->light.first; la; la = la->id.next) {
la->spotsize = DEG2RADF(la->spotsize);
}
for (ob = bmain->object.first; ob; ob = ob->id.next) {
ModifierData *md;

View File

@ -1063,11 +1063,10 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
{
Lamp *lamp;
#define LA_YF_PHOTON 5
for (lamp = bmain->lamp.first; lamp; lamp = lamp->id.next) {
if (lamp->type == LA_YF_PHOTON) {
lamp->type = LA_LOCAL;
for (Light *la = bmain->light.first; la; la = la->id.next) {
if (la->type == LA_YF_PHOTON) {
la->type = LA_LOCAL;
}
}
#undef LA_YF_PHOTON

View File

@ -923,8 +923,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
if (!MAIN_VERSION_ATLEAST(bmain, 280, 1)) {
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "bleedexp")) {
for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "bleedexp")) {
for (Light *la = bmain->light.first; la; la = la->id.next) {
la->bleedexp = 2.5f;
}
}
@ -950,8 +950,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
if (!MAIN_VERSION_ATLEAST(bmain, 280, 2)) {
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "cascade_max_dist")) {
for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "cascade_max_dist")) {
for (Light *la = bmain->light.first; la; la = la->id.next) {
la->cascade_max_dist = 1000.0f;
la->cascade_count = 4;
la->cascade_exponent = 0.8f;
@ -959,8 +959,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "contact_dist")) {
for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "contact_dist")) {
for (Light *la = bmain->light.first; la; la = la->id.next) {
la->contact_dist = 0.2f;
la->contact_bias = 0.03f;
la->contact_spread = 0.2f;
@ -1280,10 +1280,10 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
if (!MAIN_VERSION_ATLEAST(bmain, 280, 11)) {
for (Lamp *lamp = bmain->lamp.first; lamp; lamp = lamp->id.next) {
if (lamp->mode & (1 << 13)) { /* LA_SHAD_RAY */
lamp->mode |= LA_SHADOW;
lamp->mode &= ~(1 << 13);
for (Light *la = bmain->light.first; la; la = la->id.next) {
if (la->mode & (1 << 13)) { /* LA_SHAD_RAY */
la->mode |= LA_SHADOW;
la->mode &= ~(1 << 13);
}
}
}
@ -1312,8 +1312,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
if (!MAIN_VERSION_ATLEAST(bmain, 280, 13)) {
/* Initialize specular factor. */
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "spec_fac")) {
for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "spec_fac")) {
for (Light *la = bmain->light.first; la; la = la->id.next) {
la->spec_fac = 1.0f;
}
}
@ -2219,7 +2219,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
for (Light *la = bmain->light.first; la; la = la->id.next) {
/* Removed Hemi lights. */
if (!ELEM(la->type, LA_LOCAL, LA_SUN, LA_SPOT, LA_AREA)) {
la->type = LA_SUN;
@ -2244,8 +2244,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "att_dist")) {
for (Lamp *la = bmain->lamp.first; la; la = la->id.next) {
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "att_dist")) {
for (Light *la = bmain->light.first; la; la = la->id.next) {
la->att_dist = la->clipend;
}
}

View File

@ -327,8 +327,8 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
}
/* Rename lamp objects. */
rename_id_for_versioning(bmain, ID_OB, "Lamp", "Light");
rename_id_for_versioning(bmain, ID_LA, "Lamp", "Light");
rename_id_for_versioning(bmain, ID_OB, "Light", "Light");
rename_id_for_versioning(bmain, ID_LA, "Light", "Light");
for (Mesh *mesh = bmain->mesh.first; mesh; mesh = mesh->id.next) {
/* Match default for new meshes. */

View File

@ -1541,7 +1541,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
if (bmain->versionfile <= 241) {
Object *ob;
Scene *sce;
Lamp *la;
Light *la;
bArmature *arm;
bNodeTree *ntree;
@ -1581,7 +1581,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next)
ntree_version_241(ntree);
for (la = bmain->lamp.first; la; la = la->id.next)
for (la = bmain->light.first; la; la = la->id.next)
if (la->buffers == 0)
la->buffers = 1;
@ -1915,7 +1915,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
Scene *sce;
Object *ob;
Image *ima;
Lamp *la;
Light *la;
Material *ma;
ParticleSettings *part;
Mesh *me;
@ -2048,7 +2048,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
}
if (bmain->versionfile != 245 || bmain->subversionfile < 1) {
for (la = bmain->lamp.first; la; la = la->id.next) {
for (la = bmain->light.first; la; la = la->id.next) {
la->falloff_type = LA_FALLOFF_INVLINEAR;
if (la->curfalloff == NULL) {
@ -2403,7 +2403,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
idproperties_fix_group_lengths(bmain->tex);
idproperties_fix_group_lengths(bmain->image);
idproperties_fix_group_lengths(bmain->latt);
idproperties_fix_group_lengths(bmain->lamp);
idproperties_fix_group_lengths(bmain->light);
idproperties_fix_group_lengths(bmain->camera);
idproperties_fix_group_lengths(bmain->ipo);
idproperties_fix_group_lengths(bmain->key);

View File

@ -2368,11 +2368,11 @@ static void write_world(WriteData *wd, World *wrld)
}
}
static void write_lamp(WriteData *wd, Lamp *la)
static void write_lamp(WriteData *wd, Light *la)
{
if (la->id.us > 0 || wd->use_memfile) {
/* write LibData */
writestruct(wd, ID_LA, Lamp, 1, la);
writestruct(wd, ID_LA, Light, 1, la);
write_iddata(wd, &la->id);
if (la->adt) {
@ -3934,7 +3934,7 @@ static bool write_file_handle(
write_camera(wd, (Camera *)id);
break;
case ID_LA:
write_lamp(wd, (Lamp *)id);
write_lamp(wd, (Light *)id);
break;
case ID_LT:
write_lattice(wd, (Lattice *)id);

View File

@ -994,7 +994,7 @@ void AnimationImporter::translate_Animations(COLLADAFW::Node *node,
}
if ((animType->light) != 0) {
Lamp *lamp = (Lamp *) ob->data;
Light *lamp = (Light *) ob->data;
if (!lamp->adt || !lamp->adt->action)
act = verify_adt_action(bmain, (ID *)&lamp->id, 1);
else

View File

@ -86,7 +86,7 @@ void BCAnimationCurve::init_pointer_rna(Object *ob)
break;
case BC_ANIMATION_TYPE_LIGHT:
{
Lamp *lamp = (Lamp *)ob->data;
Light *lamp = (Light *)ob->data;
RNA_id_pointer_create(&lamp->id, &id_ptr);
}
break;
@ -175,7 +175,7 @@ const std::string BCAnimationCurve::get_animation_name(Object *ob) const
case BC_ANIMATION_TYPE_LIGHT:
{
Lamp *lamp = (Lamp *)ob->data;
Light *lamp = (Light *)ob->data;
name = id_name(ob) + "-" + id_name(lamp) + "-light";
}
break;

View File

@ -387,8 +387,8 @@ Object *DocumentImporter::create_lamp_object(COLLADAFW::InstanceLight *lamp, Sce
Main *bmain = CTX_data_main(mContext);
Object *ob = bc_add_object(bmain, sce, view_layer, OB_LAMP, NULL);
Lamp *la = uid_lamp_map[lamp_uid];
Lamp *old_lamp = (Lamp *)ob->data;
Light *la = uid_lamp_map[lamp_uid];
Light *old_lamp = (Light *)ob->data;
ob->data = la;
BKE_id_free_us(bmain, old_lamp);
return ob;
@ -983,7 +983,7 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light)
return true;
Main *bmain = CTX_data_main(mContext);
Lamp *lamp = NULL;
Light *lamp = NULL;
std::string la_id, la_name;
ExtraTags *et = getExtraTags(light->getUniqueId());
@ -995,8 +995,8 @@ bool DocumentImporter::writeLight(const COLLADAFW::Light *light)
la_id = light->getOriginalId();
la_name = light->getName();
if (la_name.size()) lamp = (Lamp *)BKE_lamp_add(bmain, (char *)la_name.c_str());
else lamp = (Lamp *)BKE_lamp_add(bmain, (char *)la_id.c_str());
if (la_name.size()) lamp = (Light *)BKE_light_add(bmain, (char *)la_name.c_str());
else lamp = (Light *)BKE_light_add(bmain, (char *)la_id.c_str());
if (!lamp) {
fprintf(stderr, "Cannot create light.\n");

View File

@ -156,7 +156,7 @@ private:
std::map<COLLADAFW::UniqueId, Material*> uid_material_map;
std::map<COLLADAFW::UniqueId, Material*> uid_effect_map;
std::map<COLLADAFW::UniqueId, Camera*> uid_camera_map;
std::map<COLLADAFW::UniqueId, Lamp*> uid_lamp_map;
std::map<COLLADAFW::UniqueId, Light*> uid_lamp_map;
std::map<Material*, TexIndexTextureArrayMap> material_texture_mapping_map;
std::multimap<COLLADAFW::UniqueId, Object*> object_map;
std::map<COLLADAFW::UniqueId, COLLADAFW::Node*> node_map;

View File

@ -55,7 +55,7 @@ void LightsExporter::exportLights(Scene *sce)
void LightsExporter::operator()(Object *ob)
{
Lamp *la = (Lamp *)ob->data;
Light *la = (Light *)ob->data;
std::string la_id(get_light_id(ob));
std::string la_name(id_name(la));
COLLADASW::Color col(la->r * la->energy, la->g * la->energy, la->b * la->energy);
@ -119,7 +119,7 @@ void LightsExporter::operator()(Object *ob)
}
bool LightsExporter::exportBlenderProfile(COLLADASW::Light &cla, Lamp *la)
bool LightsExporter::exportBlenderProfile(COLLADASW::Light &cla, Light *la)
{
cla.addExtraTechniqueParameter("blender", "type", la->type);
cla.addExtraTechniqueParameter("blender", "flag", la->flag);

View File

@ -37,7 +37,7 @@ public:
void exportLights(Scene *sce);
void operator()(Object *ob);
private:
bool exportBlenderProfile(COLLADASW::Light &cla, Lamp *la);
bool exportBlenderProfile(COLLADASW::Light &cla, Light *la);
const ExportSettings *export_settings;
};

View File

@ -90,13 +90,13 @@ inline bAction *bc_getSceneObjectAction(Object *ob)
return (ob->adt && ob->adt->action) ? ob->adt->action : NULL;
}
/* Returns Lamp Action or NULL */
/* Returns Light Action or NULL */
inline bAction *bc_getSceneLampAction(Object *ob)
{
if (ob->type != OB_LAMP)
return NULL;
Lamp *lamp = (Lamp *)ob->data;
Light *lamp = (Light *)ob->data;
return (lamp->adt && lamp->adt->action) ? lamp->adt->action : NULL;
}

View File

@ -424,7 +424,7 @@ void DepsgraphNodeBuilder::build_id(ID *id)
build_shapekeys((Key *)id);
break;
case ID_LA:
build_lamp((Lamp *)id);
build_lamp((Light *)id);
break;
case ID_LP:
build_lightprobe((LightProbe *)id);
@ -722,7 +722,7 @@ void DepsgraphNodeBuilder::build_object_data_camera(Object *object)
void DepsgraphNodeBuilder::build_object_data_lamp(Object *object)
{
Lamp *lamp = (Lamp *)object->data;
Light *lamp = (Light *)object->data;
build_lamp(lamp);
}
@ -1417,7 +1417,7 @@ void DepsgraphNodeBuilder::build_camera(Camera *camera)
op_node->set_as_exit();
}
void DepsgraphNodeBuilder::build_lamp(Lamp *lamp)
void DepsgraphNodeBuilder::build_lamp(Light *lamp)
{
if (built_map_.checkIsBuiltAndTag(lamp)) {
return;

View File

@ -40,8 +40,8 @@ struct GHash;
struct ID;
struct Image;
struct Key;
struct Lamp;
struct LayerCollection;
struct Light;
struct LightProbe;
struct ListBase;
struct MTex;
@ -204,7 +204,7 @@ struct DepsgraphNodeBuilder {
void build_armature(bArmature *armature);
void build_shapekeys(Key *key);
void build_camera(Camera *camera);
void build_lamp(Lamp *lamp);
void build_lamp(Light *lamp);
void build_nodetree(bNodeTree *ntree);
void build_material(Material *ma);
void build_texture(Tex *tex);

View File

@ -495,7 +495,7 @@ void DepsgraphRelationBuilder::build_id(ID *id)
build_shapekeys((Key *)id);
break;
case ID_LA:
build_lamp((Lamp *)id);
build_lamp((Light *)id);
break;
case ID_LP:
build_lightprobe((LightProbe *)id);
@ -806,7 +806,7 @@ void DepsgraphRelationBuilder::build_object_data_camera(Object *object)
void DepsgraphRelationBuilder::build_object_data_lamp(Object *object)
{
Lamp *lamp = (Lamp *)object->data;
Light *lamp = (Light *)object->data;
build_lamp(lamp);
ComponentKey lamp_parameters_key(&lamp->id, NodeType::PARAMETERS);
ComponentKey object_parameters_key(&object->id, NodeType::PARAMETERS);
@ -2349,7 +2349,7 @@ void DepsgraphRelationBuilder::build_camera(Camera *camera)
}
/* Lamps */
void DepsgraphRelationBuilder::build_lamp(Lamp *lamp)
void DepsgraphRelationBuilder::build_lamp(Light *lamp)
{
if (built_map_.checkIsBuiltAndTag(lamp)) {
return;

View File

@ -52,8 +52,8 @@ struct FCurve;
struct GHash;
struct ID;
struct Key;
struct Lamp;
struct LayerCollection;
struct Light;
struct LightProbe;
struct ListBase;
struct MTex;
@ -265,7 +265,7 @@ struct DepsgraphRelationBuilder
void build_shapekeys(Key *key);
void build_armature(bArmature *armature);
void build_camera(Camera *camera);
void build_lamp(Lamp *lamp);
void build_lamp(Light *lamp);
void build_nodetree(bNodeTree *ntree);
void build_material(Material *ma);
void build_texture(Tex *tex);

View File

@ -102,7 +102,7 @@ namespace {
union NestedIDHackTempStorage {
Curve curve;
FreestyleLineStyle linestyle;
Lamp lamp;
Light lamp;
Lattice lattice;
Material material;
Mesh mesh;
@ -123,7 +123,7 @@ void nested_id_hack_discard_pointers(ID *id_cow)
}
SPECIAL_CASE(ID_LS, FreestyleLineStyle, nodetree)
SPECIAL_CASE(ID_LA, Lamp, nodetree)
SPECIAL_CASE(ID_LA, Light, nodetree)
SPECIAL_CASE(ID_MA, Material, nodetree)
SPECIAL_CASE(ID_TE, Tex, nodetree)
SPECIAL_CASE(ID_WO, World, nodetree)
@ -176,7 +176,7 @@ const ID *nested_id_hack_get_discarded_pointers(NestedIDHackTempStorage *storage
}
SPECIAL_CASE(ID_LS, FreestyleLineStyle, nodetree, linestyle)
SPECIAL_CASE(ID_LA, Lamp, nodetree, lamp)
SPECIAL_CASE(ID_LA, Light, nodetree, lamp)
SPECIAL_CASE(ID_MA, Material, nodetree, material)
SPECIAL_CASE(ID_TE, Tex, nodetree, tex)
SPECIAL_CASE(ID_WO, World, nodetree, world)
@ -217,7 +217,7 @@ void nested_id_hack_restore_pointers(const ID *old_id, ID *new_id)
}
SPECIAL_CASE(ID_LS, FreestyleLineStyle, nodetree)
SPECIAL_CASE(ID_LA, Lamp, nodetree)
SPECIAL_CASE(ID_LA, Light, nodetree)
SPECIAL_CASE(ID_MA, Material, nodetree)
SPECIAL_CASE(ID_SCE, Scene, nodetree)
SPECIAL_CASE(ID_TE, Tex, nodetree)
@ -255,7 +255,7 @@ void ntree_hack_remap_pointers(const Depsgraph *depsgraph, ID *id_cow)
}
SPECIAL_CASE(ID_LS, FreestyleLineStyle, nodetree, bNodeTree)
SPECIAL_CASE(ID_LA, Lamp, nodetree, bNodeTree)
SPECIAL_CASE(ID_LA, Light, nodetree, bNodeTree)
SPECIAL_CASE(ID_MA, Material, nodetree, bNodeTree)
SPECIAL_CASE(ID_SCE, Scene, nodetree, bNodeTree)
SPECIAL_CASE(ID_TE, Tex, nodetree, bNodeTree)

View File

@ -151,7 +151,7 @@ EEVEE_LightProbeEngineData *EEVEE_lightprobe_data_ensure(Object *ob)
NULL);
}
/* Lamp data. */
/* Light data. */
static void eevee_lamp_data_init(DrawData *dd)
{

View File

@ -55,7 +55,7 @@ extern char datatoc_concentric_samples_lib_glsl[];
/* Prototypes */
static void eevee_light_setup(Object *ob, EEVEE_Light *evli);
static float light_attenuation_radius_get(Lamp *la, float light_threshold);
static float light_attenuation_radius_get(Light *la, float light_threshold);
/* *********** LIGHT BITS *********** */
static void lightbits_set_single(EEVEE_LightBits *bitf, uint idx, bool val)
@ -342,7 +342,7 @@ void EEVEE_lights_cache_add(EEVEE_ViewLayerData *sldata, Object *ob)
printf("Too many lights in the scene !!!\n");
}
else {
Lamp *la = (Lamp *)ob->data;
Light *la = (Light *)ob->data;
EEVEE_Light *evli = linfo->light_data + linfo->num_light;
eevee_light_setup(ob, evli);
@ -591,7 +591,7 @@ void EEVEE_lights_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
EEVEE_lights_update(sldata, vedata);
}
float light_attenuation_radius_get(Lamp *la, float light_threshold)
float light_attenuation_radius_get(Light *la, float light_threshold)
{
if (la->mode & LA_CUSTOM_ATTENUATION) {
return la->att_dist;
@ -607,7 +607,7 @@ float light_attenuation_radius_get(Lamp *la, float light_threshold)
return distance;
}
static void light_shape_parameters_set(EEVEE_Light *evli, const Lamp *la, float scale[3])
static void light_shape_parameters_set(EEVEE_Light *evli, const Light *la, float scale[3])
{
if (la->type == LA_SPOT) {
/* Spot size & blend */
@ -631,7 +631,7 @@ static void light_shape_parameters_set(EEVEE_Light *evli, const Lamp *la, float
}
}
static float light_shape_power_get(const Lamp *la, const EEVEE_Light *evli)
static float light_shape_power_get(const Light *la, const EEVEE_Light *evli)
{
float power;
/* Make illumination power constant */
@ -662,7 +662,7 @@ static float light_shape_power_get(const Lamp *la, const EEVEE_Light *evli)
/* Update buffer with lamp data */
static void eevee_light_setup(Object *ob, EEVEE_Light *evli)
{
Lamp *la = (Lamp *)ob->data;
Light *la = (Light *)ob->data;
float mat[4][4], scale[3], power, att_radius;
const DRWContextState *draw_ctx = DRW_context_state_get();
@ -695,7 +695,7 @@ static void eevee_light_setup(Object *ob, EEVEE_Light *evli)
light_shape_parameters_set(evli, la, scale);
/* Lamp Type */
/* Light Type */
evli->lamptype = (float)la->type;
if ((la->type == LA_AREA) && ELEM(la->area_shape, LA_AREA_DISK, LA_AREA_ELLIPSE)) {
evli->lamptype = LAMPTYPE_AREA_ELLIPSE;
@ -777,7 +777,7 @@ static void sample_ellipse(
static void shadow_cube_random_position_set(
EEVEE_Light *evli, Lamp *la,
EEVEE_Light *evli, Light *la,
int sample_ofs,
float ws_sample_pos[3])
{
@ -815,7 +815,7 @@ static void eevee_shadow_cube_setup(Object *ob, EEVEE_LampsInfo *linfo, EEVEE_La
EEVEE_Light *evli = linfo->light_data + sh_data->light_id;
EEVEE_Shadow *ubo_data = linfo->shadow_data + sh_data->shadow_id;
EEVEE_ShadowCube *cube_data = linfo->shadow_cube_data + sh_data->cube_id;
Lamp *la = (Lamp *)ob->data;
Light *la = (Light *)ob->data;
copy_v3_v3(cube_data->position, ob->obmat[3]);
@ -912,7 +912,7 @@ static void eevee_shadow_cascade_setup(
Object *ob, EEVEE_LampsInfo *linfo, EEVEE_LampEngineData *led,
DRWMatrixState *saved_mats, float view_near, float view_far, int sample_ofs)
{
Lamp *la = (Lamp *)ob->data;
Light *la = (Light *)ob->data;
/* Camera Matrices */
float (*persinv)[4] = saved_mats->mat[DRW_MAT_PERSINV];
@ -1231,7 +1231,7 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
/* Precompute all shadow/view test before rendering and trashing the culling cache. */
bool cube_visible[MAX_SHADOW_CUBE];
for (i = 0; (ob = linfo->shadow_cube_ref[i]) && (i < MAX_SHADOW_CUBE); i++) {
Lamp *la = (Lamp *)ob->data;
Light *la = (Light *)ob->data;
BoundSphere bsphere = {
.center = {ob->obmat[3][0], ob->obmat[3][1], ob->obmat[3][2]},
.radius = light_attenuation_radius_get(la, light_threshold),
@ -1259,7 +1259,7 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
/* Render each shadow to one layer of the array */
for (i = 0; (ob = linfo->shadow_cube_ref[i]) && (i < MAX_SHADOW_CUBE); i++) {
EEVEE_LampEngineData *led = EEVEE_lamp_data_ensure(ob);
Lamp *la = (Lamp *)ob->data;
Light *la = (Light *)ob->data;
if (!led->need_update || !cube_visible[i]) {
continue;
@ -1372,7 +1372,7 @@ void EEVEE_draw_shadows(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
}
EEVEE_LampEngineData *led = EEVEE_lamp_data_ensure(ob);
Lamp *la = (Lamp *)ob->data;
Light *la = (Light *)ob->data;
EEVEE_ShadowCascadeData *evscd = &led->data.scad;
EEVEE_ShadowRender *srd = &linfo->shadow_render_data;

View File

@ -369,7 +369,7 @@ typedef struct EEVEE_ShadowCube {
} EEVEE_ShadowCube;
typedef struct EEVEE_ShadowCascade {
/* World->Lamp->NDC->Tex : used for sampling the shadow map. */
/* World->Light->NDC->Tex : used for sampling the shadow map. */
float shadowmat[MAX_CASCADE_NUM][4][4];
float split_start[4];
float split_end[4];
@ -727,7 +727,7 @@ typedef struct EEVEE_ShadowCubeData {
typedef struct EEVEE_ShadowCascadeData {
short light_id, shadow_id, cascade_id, layer_id;
/* World->Lamp->NDC : used for rendering the shadow map. */
/* World->Light->NDC : used for rendering the shadow map. */
float viewprojmat[MAX_CASCADE_NUM][4][4];
float projmat[MAX_CASCADE_NUM][4][4];
float viewmat[4][4], viewinv[4][4];

View File

@ -1501,7 +1501,7 @@ static void DRW_shgroup_mball_handles(OBJECT_ShadingGroupList *sgl, Object *ob,
static void DRW_shgroup_lamp(OBJECT_ShadingGroupList *sgl, Object *ob, ViewLayer *view_layer)
{
Lamp *la = ob->data;
Light *la = ob->data;
float *color;
int theme_id = DRW_object_wire_theme_get(ob, view_layer, &color);
static float zero = 0.0f;

View File

@ -1483,7 +1483,7 @@ static int acf_dslight_setting_flag(bAnimContext *UNUSED(ac), eAnimChannel_Setti
/* get pointer to the setting */
static void *acf_dslight_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type)
{
Lamp *la = (Lamp *)ale->data;
Light *la = (Light *)ale->data;
/* clear extra return data first */
*type = 0;

View File

@ -672,7 +672,7 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
}
case ANIMTYPE_DSLAM:
{
Lamp *la = (Lamp *)data;
Light *la = (Light *)data;
AnimData *adt = la->adt;
ale->flag = FILTER_LAM_OBJD(la);
@ -2082,7 +2082,7 @@ static size_t animdata_filter_ds_texture(bAnimContext *ac, ListBase *anim_data,
}
/* NOTE: owner_id is the direct owner of the texture stack in question
* It used to be Material/Lamp/World before the Blender Internal removal for 2.8
* It used to be Material/Light/World before the Blender Internal removal for 2.8
*/
static size_t animdata_filter_ds_textures(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, int filter_mode)
{
@ -2363,9 +2363,9 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
expanded = FILTER_CAM_OBJD(ca);
break;
}
case OB_LAMP: /* ---------- Lamp ----------- */
case OB_LAMP: /* ---------- Light ----------- */
{
Lamp *la = (Lamp *)ob->data;
Light *la = (Light *)ob->data;
if (ads->filterflag & ADS_FILTER_NOLAM)
return 0;
@ -2451,7 +2451,7 @@ static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, b
switch (ob->type) {
case OB_LAMP: /* lamp - textures + nodetree */
{
Lamp *la = ob->data;
Light *la = ob->data;
bNodeTree *ntree = la->nodetree;
/* nodetree */

View File

@ -335,7 +335,7 @@ typedef enum eAnimFilter_Flags {
/* 'Sub-object' channels (flags stored in Data block) */
#define FILTER_SKE_OBJD(key) (CHECK_TYPE_INLINE(key, Key *), ((key->flag & KEY_DS_EXPAND)))
#define FILTER_MAT_OBJD(ma) (CHECK_TYPE_INLINE(ma, Material *), ((ma->flag & MA_DS_EXPAND)))
#define FILTER_LAM_OBJD(la) (CHECK_TYPE_INLINE(la, Lamp *), ((la->flag & LA_DS_EXPAND)))
#define FILTER_LAM_OBJD(la) (CHECK_TYPE_INLINE(la, Light *), ((la->flag & LA_DS_EXPAND)))
#define FILTER_CAM_OBJD(ca) (CHECK_TYPE_INLINE(ca, Camera *), ((ca->flag & CAM_DS_EXPAND)))
#define FILTER_CACHEFILE_OBJD(cf) (CHECK_TYPE_INLINE(cf, CacheFile *), ((cf->flag & CACHEFILE_DS_EXPAND)))
#define FILTER_CUR_OBJD(cu) (CHECK_TYPE_INLINE(cu, Curve *), ((cu->flag & CU_DS_EXPAND)))

View File

@ -2192,7 +2192,7 @@ void uiTemplatePreview(
else if (parent && (GS(parent->name) == ID_WO))
pr_texture = &((World *)parent)->pr_texture;
else if (parent && (GS(parent->name) == ID_LA))
pr_texture = &((Lamp *)parent)->pr_texture;
pr_texture = &((Light *)parent)->pr_texture;
else if (parent && (GS(parent->name) == ID_LS))
pr_texture = &((FreestyleLineStyle *)parent)->pr_texture;

View File

@ -1115,7 +1115,7 @@ static int object_light_add_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *ob;
Lamp *la;
Light *la;
int type = RNA_enum_get(op->ptr, "type");
ushort local_view_bits;
float loc[3], rot[3];
@ -1141,7 +1141,7 @@ static int object_light_add_exec(bContext *C, wmOperator *op)
}
BKE_object_obdata_size_init(ob, size);
la = (Lamp *)ob->data;
la = (Light *)ob->data;
la->type = type;
if (BKE_scene_uses_cycles(scene)) {
@ -2351,7 +2351,7 @@ static Base *object_add_duplicate_internal(Main *bmain, Scene *scene, ViewLayer
if (dupflag & USER_DUP_LAMP) {
ID_NEW_REMAP_US2(obn->data)
else {
obn->data = ID_NEW_SET(obn->data, BKE_lamp_copy(bmain, obn->data));
obn->data = ID_NEW_SET(obn->data, BKE_light_copy(bmain, obn->data));
didit = 1;
}
id_us_min(id);

View File

@ -1180,7 +1180,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
data->tar = obact;
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
/* Lamp, Camera and Speaker track differently by default */
/* Light, Camera and Speaker track differently by default */
if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
data->trackflag = TRACK_nZ;
}
@ -1203,7 +1203,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
data->tar = obact;
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
/* Lamp, Camera and Speaker track differently by default */
/* Light, Camera and Speaker track differently by default */
if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
data->reserved1 = TRACK_nZ;
data->reserved2 = UP_Y;
@ -1227,7 +1227,7 @@ static int track_set_exec(bContext *C, wmOperator *op)
data->tar = obact;
DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
/* Lamp, Camera and Speaker track differently by default */
/* Light, Camera and Speaker track differently by default */
if (ELEM(ob->type, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
data->trackflag = TRACK_nZ;
data->lockflag = LOCK_Y;
@ -1699,7 +1699,7 @@ static void new_id_matar(Main *bmain, Material **matar, const int totcol)
static void single_obdata_users(Main *bmain, Scene *scene, ViewLayer *view_layer, View3D *v3d, const int flag)
{
Lamp *la;
Light *la;
Curve *cu;
/* Camera *cam; */
Mesh *me;
@ -1716,7 +1716,7 @@ static void single_obdata_users(Main *bmain, Scene *scene, ViewLayer *view_layer
switch (ob->type) {
case OB_LAMP:
ob->data = la = ID_NEW_SET(ob->data, BKE_lamp_copy(bmain, ob->data));
ob->data = la = ID_NEW_SET(ob->data, BKE_light_copy(bmain, ob->data));
break;
case OB_CAMERA:
ob->data = ID_NEW_SET(ob->data, BKE_camera_copy(bmain, ob->data));

View File

@ -868,14 +868,14 @@ static bool select_grouped_siblings(bContext *C, Object *ob)
}
static bool select_grouped_lamptype(bContext *C, Object *ob)
{
Lamp *la = ob->data;
Light *la = ob->data;
bool changed = false;
CTX_DATA_BEGIN (C, Base *, base, selectable_bases)
{
if (base->object->type == OB_LAMP) {
Lamp *la_test = base->object->data;
Light *la_test = base->object->data;
if ((la->type == la_test->type) && ((base->flag & BASE_SELECTED) == 0)) {
ED_object_base_select(base, BA_SELECT);
changed = true;

View File

@ -510,7 +510,7 @@ static int apply_objects_internal(
}
if (ob->type == OB_LAMP) {
Lamp *la = ob->data;
Light *la = ob->data;
if (la->type == LA_AREA) {
if (apply_rot || apply_loc) {
BKE_reportf(reports, RPT_ERROR,
@ -654,7 +654,7 @@ static int apply_objects_internal(
}
}
else if (ob->type == OB_LAMP) {
Lamp *la = ob->data;
Light *la = ob->data;
if (la->type != LA_AREA) {
continue;
}
@ -1361,7 +1361,7 @@ static void object_transform_axis_target_calc_depth_init(struct XFormAxisData *x
static bool object_is_target_compat(const Object *ob)
{
if (ob->type == OB_LAMP) {
const Lamp *la = ob->data;
const Light *la = ob->data;
if (ELEM(la->type, LA_SUN, LA_SPOT, LA_AREA)) {
return true;
}

View File

@ -156,7 +156,7 @@ typedef struct ShaderPreview {
/* datablocks with nodes need full copy during preview render, glsl uses it too */
Material *matcopy;
Tex *texcopy;
Lamp *lampcopy;
Light *lampcopy;
World *worldcopy;
/** Copy of the active objects #Object.color */
@ -268,7 +268,7 @@ static const char *preview_collection_name(const char pr_type)
case MA_TEXTURE:
return "Texture";
case MA_LAMP:
return "Lamp";
return "Light";
case MA_SKY:
return "Sky";
case MA_HAIR:
@ -330,7 +330,7 @@ static ID *duplicate_ids(ID *id, Depsgraph *depsgraph)
case ID_TE:
return (ID *)BKE_texture_localize((Tex *)id_eval);
case ID_LA:
return (ID *)BKE_lamp_localize((Lamp *)id_eval);
return (ID *)BKE_light_localize((Light *)id_eval);
case ID_WO:
return (ID *)BKE_world_localize((World *)id_eval);
case ID_IM:
@ -479,14 +479,14 @@ static Scene *preview_prepare_scene(Main *bmain, Scene *scene, ID *id, int id_ty
}
}
else if (id_type == ID_LA) {
Lamp *la = NULL, *origla = (Lamp *)id;
Light *la = NULL, *origla = (Light *)id;
/* work on a copy */
if (origla) {
BLI_assert(sp->id_copy != NULL);
la = sp->lampcopy = (Lamp *)sp->id_copy;
la = sp->lampcopy = (Light *)sp->id_copy;
sp->id_copy = NULL;
BLI_addtail(&pr_main->lamp, la);
BLI_addtail(&pr_main->light, la);
}
set_preview_collection(sce, view_layer, MA_LAMP);
@ -705,7 +705,7 @@ static void shader_preview_updatejob(void *spv)
ntreeLocalSync(sp->worldcopy->nodetree, wrld->nodetree);
}
else if (GS(sp->id->name) == ID_LA) {
Lamp *la = (Lamp *)sp->id;
Light *la = (Light *)sp->id;
if (sp->lampcopy && la->nodetree && sp->lampcopy->nodetree)
ntreeLocalSync(sp->lampcopy->nodetree, la->nodetree);
@ -912,7 +912,7 @@ static void shader_preview_free(void *customdata)
}
if (sp->lampcopy) {
sp->id_copy = (ID *)sp->lampcopy;
BLI_remlink(&pr_main->lamp, sp->lampcopy);
BLI_remlink(&pr_main->light, sp->lampcopy);
}
if (sp->id_copy) {
/* node previews */
@ -934,7 +934,7 @@ static void shader_preview_free(void *customdata)
BKE_texture_free((Tex *)sp->id_copy);
break;
case ID_LA:
BKE_lamp_free((Lamp *)sp->id_copy);
BKE_light_free((Light *)sp->id_copy);
break;
case ID_WO:
BKE_world_free((World *)sp->id_copy);

View File

@ -1916,7 +1916,7 @@ static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
if (id == NULL) {
Material *ma = CTX_data_pointer_get_type(C, "material", &RNA_Material).data;
Lamp *la = CTX_data_pointer_get_type(C, "light", &RNA_Light).data;
Light *la = CTX_data_pointer_get_type(C, "light", &RNA_Light).data;
World *wo = CTX_data_pointer_get_type(C, "world", &RNA_World).data;
ParticleSystem *psys = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem).data;
FreestyleLineStyle *linestyle = CTX_data_pointer_get_type(C, "line_style", &RNA_FreestyleLineStyle).data;

View File

@ -210,7 +210,7 @@ static void material_changed(Main *UNUSED(bmain), Material *ma)
BKE_icon_changed(BKE_icon_id_ensure(&ma->id));
}
static void lamp_changed(Main *UNUSED(bmain), Lamp *la)
static void lamp_changed(Main *UNUSED(bmain), Light *la)
{
/* icons */
BKE_icon_changed(BKE_icon_id_ensure(&la->id));
@ -293,7 +293,7 @@ void ED_render_id_flush_update(const DEGEditorUpdateContext *update_ctx, ID *id)
world_changed(bmain, (World *)id);
break;
case ID_LA:
lamp_changed(bmain, (Lamp *)id);
lamp_changed(bmain, (Light *)id);
break;
case ID_IM:
image_changed(bmain, (Image *)id);

View File

@ -102,7 +102,7 @@ static bNodeTree *node_tree_from_ID(ID *id)
case ID_MA:
return ((Material *)id)->nodetree;
case ID_LA:
return ((Lamp *)id)->nodetree;
return ((Light *)id)->nodetree;
case ID_WO:
return ((World *)id)->nodetree;
case ID_SCE:

View File

@ -413,7 +413,7 @@ void ED_node_shader_default(const bContext *C, ID *id)
}
case ID_LA:
{
Lamp *la = (Lamp *)id;
Light *la = (Light *)id;
la->nodetree = ntree;
output_type = SH_NODE_OUTPUT_LIGHT;

View File

@ -531,7 +531,7 @@ static void node_area_refresh(const struct bContext *C, ScrArea *sa)
ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
}
else if (GS(snode->id->name) == ID_LA) {
Lamp *la = (Lamp *)snode->id;
Light *la = (Light *)snode->id;
if (la->use_nodes)
ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
}

View File

@ -1337,7 +1337,7 @@ TreeElementIcon tree_element_get_icon(TreeStoreElem *tselem, TreeElement *te)
data.icon = ICON_OUTLINER_DATA_LATTICE; break;
case ID_LA:
{
Lamp *la = (Lamp *)tselem->id;
Light *la = (Light *)tselem->id;
switch (la->type) {
case LA_LOCAL:
data.icon = ICON_LIGHT_POINT; break;

View File

@ -584,7 +584,7 @@ static void outliner_add_id_contents(SpaceOutliner *soops, TreeElement *te, Tree
}
case ID_LA:
{
Lamp *la = (Lamp *)id;
Light *la = (Light *)id;
if (outliner_animdata_test(la->adt))
outliner_add_element(soops, &te->subtree, la, te, TSE_ANIM_DATA, 0);

View File

@ -45,7 +45,7 @@
#include "view3d_intern.h" /* own include */
/* -------------------------------------------------------------------- */
/** \name Spot Lamp Gizmos
/** \name Spot Light Gizmos
* \{ */
static bool WIDGETGROUP_lamp_spot_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
@ -62,7 +62,7 @@ static bool WIDGETGROUP_lamp_spot_poll(const bContext *C, wmGizmoGroupType *UNUS
if (base && BASE_SELECTABLE(v3d, base)) {
Object *ob = base->object;
if (ob->type == OB_LAMP) {
Lamp *la = ob->data;
Light *la = ob->data;
return (la->type == LA_SPOT);
}
}
@ -90,7 +90,7 @@ static void WIDGETGROUP_lamp_spot_refresh(const bContext *C, wmGizmoGroup *gzgro
wmGizmo *gz = wwrapper->gizmo;
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = OBACT(view_layer);
Lamp *la = ob->data;
Light *la = ob->data;
float dir[3];
negate_v3_v3(dir, ob->obmat[2]);
@ -122,7 +122,7 @@ void VIEW3D_GGT_lamp_spot(wmGizmoGroupType *gzgt)
/** \} */
/* -------------------------------------------------------------------- */
/** \name Area Lamp Gizmos
/** \name Area Light Gizmos
* \{ */
/* scale callbacks */
@ -132,7 +132,7 @@ static void gizmo_area_lamp_prop_matrix_get(
{
BLI_assert(gz_prop->type->array_length == 16);
float (*matrix)[4] = value_p;
const Lamp *la = gz_prop->custom_func.user_data;
const Light *la = gz_prop->custom_func.user_data;
matrix[0][0] = la->area_size;
matrix[1][1] = ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_ELLIPSE) ? la->area_sizey : la->area_size;
@ -144,7 +144,7 @@ static void gizmo_area_lamp_prop_matrix_set(
{
const float (*matrix)[4] = value_p;
BLI_assert(gz_prop->type->array_length == 16);
Lamp *la = gz_prop->custom_func.user_data;
Light *la = gz_prop->custom_func.user_data;
if (ELEM(la->area_shape, LA_AREA_RECT, LA_AREA_ELLIPSE)) {
la->area_size = len_v3(matrix[0]);
@ -170,7 +170,7 @@ static bool WIDGETGROUP_lamp_area_poll(const bContext *C, wmGizmoGroupType *UNUS
if (base && BASE_SELECTABLE(v3d, base)) {
Object *ob = base->object;
if (ob->type == OB_LAMP) {
Lamp *la = ob->data;
Light *la = ob->data;
return (la->type == LA_AREA);
}
}
@ -198,7 +198,7 @@ static void WIDGETGROUP_lamp_area_refresh(const bContext *C, wmGizmoGroup *gzgro
wmGizmoWrapper *wwrapper = gzgroup->customdata;
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = OBACT(view_layer);
Lamp *la = ob->data;
Light *la = ob->data;
wmGizmo *gz = wwrapper->gizmo;
copy_m4_m4(gz->matrix_basis, ob->obmat);
@ -238,7 +238,7 @@ void VIEW3D_GGT_lamp_area(wmGizmoGroupType *gzgt)
/* -------------------------------------------------------------------- */
/** \name Lamp Target Gizmo
/** \name Light Target Gizmo
* \{ */
static bool WIDGETGROUP_lamp_target_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
@ -253,7 +253,7 @@ static bool WIDGETGROUP_lamp_target_poll(const bContext *C, wmGizmoGroupType *UN
if (base && BASE_SELECTABLE(v3d, base)) {
Object *ob = base->object;
if (ob->type == OB_LAMP) {
Lamp *la = ob->data;
Light *la = ob->data;
return (ELEM(la->type, LA_SUN, LA_SPOT, LA_AREA));
}
#if 0
@ -297,7 +297,7 @@ static void WIDGETGROUP_lamp_target_draw_prepare(const bContext *C, wmGizmoGroup
unit_m4(gz->matrix_offset);
if (ob->type == OB_LAMP) {
Lamp *la = ob->data;
Light *la = ob->data;
if (la->type == LA_SPOT) {
/* Draw just past the lamp size angle gizmo. */
madd_v3_v3fl(gz->matrix_basis[3], gz->matrix_basis[2], -la->spotsize);

View File

@ -368,7 +368,7 @@ typedef enum ID_Type {
ID_TE = MAKE_ID2('T', 'E'), /* Tex (Texture) */
ID_IM = MAKE_ID2('I', 'M'), /* Image */
ID_LT = MAKE_ID2('L', 'T'), /* Lattice */
ID_LA = MAKE_ID2('L', 'A'), /* Lamp */
ID_LA = MAKE_ID2('L', 'A'), /* Light */
ID_CA = MAKE_ID2('C', 'A'), /* Camera */
ID_IP = MAKE_ID2('I', 'P'), /* Ipo (depreciated, replaced by FCurves) */
ID_KE = MAKE_ID2('K', 'E'), /* Key (shape key) */

View File

@ -325,7 +325,7 @@ typedef struct Ipo {
#define WO_STARDIST 15
#define WO_STARSIZE 16
/* ********** Lamp (ID_LA) ********** */
/* ********** Light (ID_LA) ********** */
#define LA_TOTIPO 21
#define LA_TOTNAM 10

View File

@ -37,7 +37,7 @@ struct Ipo;
struct MTex;
struct bNodeTree;
typedef struct Lamp {
typedef struct Light {
ID id;
/** Animation data (must be immediately after id for utilities to use it). */
struct AnimData *adt;
@ -88,7 +88,7 @@ typedef struct Lamp {
/* nodes */
struct bNodeTree *nodetree;
} Lamp;
} Light;
/* **************** LAMP ********************* */

View File

@ -51,6 +51,7 @@
/* Match RNA names where possible, keep sorted. */
DNA_STRUCT_RENAME(Lamp, Light)
DNA_STRUCT_RENAME(SpaceButs, SpaceProperties)
DNA_STRUCT_RENAME(SpaceIpo, SpaceGraph)
DNA_STRUCT_RENAME(SpaceOops, SpaceOutliner)
@ -86,5 +87,5 @@ DNA_STRUCT_RENAME_ELEM(bTheme, tuserpref, space_preferences)
DNA_STRUCT_RENAME_ELEM(bTheme, tv3d, space_view3d)
#if 0
DNA_STRUCT_RENAME(Lamp, Light)
DNA_STRUCT_RENAME(Light, Light)
#endif

View File

@ -1499,7 +1499,7 @@ static void rna_def_modifier_gpencilhook(BlenderRNA *brna)
prop = RNA_def_property(srna, "falloff_curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curfalloff");
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Lamp Falloff Curve");
RNA_def_property_ui_text(prop, "Falloff Curve", "Custom Light Falloff Curve");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "center", PROP_FLOAT, PROP_NONE);

View File

@ -50,7 +50,7 @@
static void rna_Light_buffer_size_set(PointerRNA *ptr, int value)
{
Lamp *la = (Lamp *)ptr->data;
Light *la = (Light *)ptr->data;
CLAMP(value, 128, 10240);
la->bufsize = value;
@ -59,7 +59,7 @@ static void rna_Light_buffer_size_set(PointerRNA *ptr, int value)
static StructRNA *rna_Light_refine(struct PointerRNA *ptr)
{
Lamp *la = (Lamp *)ptr->data;
Light *la = (Light *)ptr->data;
switch (la->type) {
case LA_LOCAL:
@ -77,7 +77,7 @@ static StructRNA *rna_Light_refine(struct PointerRNA *ptr)
static void rna_Light_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Lamp *la = ptr->id.data;
Light *la = ptr->id.data;
DEG_id_tag_update(&la->id, 0);
WM_main_add_notifier(NC_LAMP | ND_LIGHTING, la);
@ -85,7 +85,7 @@ static void rna_Light_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerR
static void rna_Light_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
{
Lamp *la = ptr->id.data;
Light *la = ptr->id.data;
DEG_id_tag_update(&la->id, 0);
WM_main_add_notifier(NC_LAMP | ND_LIGHTING_DRAW, la);
@ -93,7 +93,7 @@ static void rna_Light_draw_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
static void rna_Light_use_nodes_update(bContext *C, PointerRNA *ptr)
{
Lamp *la = (Lamp *)ptr->data;
Light *la = (Light *)ptr->data;
if (la->use_nodes && la->nodetree == NULL)
ED_node_shader_default(C, &la->id);
@ -118,7 +118,7 @@ static void rna_def_light(BlenderRNA *brna)
static float default_color[4] = {1.0f, 1.0f, 1.0f, 1.0f};
srna = RNA_def_struct(brna, "Light", "ID");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_sdna(srna, "Light");
RNA_def_struct_refine_func(srna, "rna_Light_refine");
RNA_def_struct_ui_text(srna, "Light", "Light data-block for lighting a scene");
RNA_def_struct_translation_context(srna, BLT_I18NCONTEXT_ID_LIGHT);
@ -420,7 +420,7 @@ static void rna_def_point_light(BlenderRNA *brna)
StructRNA *srna;
srna = RNA_def_struct(brna, "PointLight", "Light");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_sdna(srna, "Light");
RNA_def_struct_ui_text(srna, "Point Light", "Omnidirectional point Light");
RNA_def_struct_ui_icon(srna, ICON_LIGHT_POINT);
@ -443,7 +443,7 @@ static void rna_def_area_light(BlenderRNA *brna)
};
srna = RNA_def_struct(brna, "AreaLight", "Light");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_sdna(srna, "Light");
RNA_def_struct_ui_text(srna, "Area Light", "Directional area Light");
RNA_def_struct_ui_icon(srna, ICON_LIGHT_AREA);
@ -481,7 +481,7 @@ static void rna_def_spot_light(BlenderRNA *brna)
PropertyRNA *prop;
srna = RNA_def_struct(brna, "SpotLight", "Light");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_sdna(srna, "Light");
RNA_def_struct_ui_text(srna, "Spot Light", "Directional cone Light");
RNA_def_struct_ui_icon(srna, ICON_LIGHT_SPOT);
@ -520,7 +520,7 @@ static void rna_def_sun_light(BlenderRNA *brna)
StructRNA *srna;
srna = RNA_def_struct(brna, "SunLight", "Light");
RNA_def_struct_sdna(srna, "Lamp");
RNA_def_struct_sdna(srna, "Light");
RNA_def_struct_ui_text(srna, "Sun Light", "Constant direction parallel ray Light");
RNA_def_struct_ui_icon(srna, ICON_LIGHT_SUN);

View File

@ -105,7 +105,7 @@ static void rna_Main_object_begin(CollectionPropertyIterator *iter, PointerRNA *
static void rna_Main_light_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
Main *bmain = (Main *)ptr->data;
rna_iterator_listbase_begin(iter, &bmain->lamp, NULL);
rna_iterator_listbase_begin(iter, &bmain->light, NULL);
}
static void rna_Main_library_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
@ -362,7 +362,7 @@ int rna_Main_mesh_lookup_string(PointerRNA *ptr, const char *key, struct Pointer
int rna_Main_light_lookup_string(PointerRNA *ptr, const char *key, struct PointerRNA *r_ptr)
{
Main *bmain = ptr->data;
return rna_ID_lookup_string(&bmain->lamp, key, r_ptr);
return rna_ID_lookup_string(&bmain->light, key, r_ptr);
}
int rna_Main_library_lookup_string(PointerRNA *ptr, const char *key, struct PointerRNA *r_ptr)

View File

@ -325,12 +325,12 @@ Mesh *rna_Main_meshes_new_from_object(
return BKE_mesh_new_from_object(depsgraph, bmain, sce, ob, apply_modifiers, calc_undeformed);
}
static Lamp *rna_Main_lights_new(Main *bmain, const char *name, int type)
static Light *rna_Main_lights_new(Main *bmain, const char *name, int type)
{
char safe_name[MAX_ID_NAME - 2];
rna_idname_validate(name, safe_name);
Lamp *lamp = BKE_lamp_add(bmain, safe_name);
Light *lamp = BKE_light_add(bmain, safe_name);
lamp->type = type;
id_us_min(&lamp->id);
return lamp;
@ -617,7 +617,7 @@ RNA_MAIN_ID_TAG_FUNCS_DEF(objects, object, ID_OB)
RNA_MAIN_ID_TAG_FUNCS_DEF(materials, mat, ID_MA)
RNA_MAIN_ID_TAG_FUNCS_DEF(node_groups, nodetree, ID_NT)
RNA_MAIN_ID_TAG_FUNCS_DEF(meshes, mesh, ID_ME)
RNA_MAIN_ID_TAG_FUNCS_DEF(lights, lamp, ID_LA)
RNA_MAIN_ID_TAG_FUNCS_DEF(lights, light, ID_LA)
RNA_MAIN_ID_TAG_FUNCS_DEF(libraries, library, ID_LI)
RNA_MAIN_ID_TAG_FUNCS_DEF(screens, screen, ID_SCR)
RNA_MAIN_ID_TAG_FUNCS_DEF(window_managers, wm, ID_WM)

View File

@ -87,7 +87,7 @@ static void shader_get_from_context(const bContext *C, bNodeTreeType *UNUSED(tre
*r_from = &ob->id;
if (ob->type == OB_LAMP) {
*r_id = ob->data;
*r_ntree = ((Lamp *)ob->data)->nodetree;
*r_ntree = ((Light *)ob->data)->nodetree;
}
else {
Material *ma = give_current_material(ob, ob->actcol);

View File

@ -320,7 +320,7 @@ typedef struct wmNotifier {
#define ND_SHADING_LINKS (32<<16)
#define ND_SHADING_PREVIEW (33<<16)
/* NC_LAMP Lamp */
/* NC_LAMP Light */
#define ND_LIGHTING (40<<16)
#define ND_LIGHTING_DRAW (41<<16)
#define ND_SKY (42<<16)

View File

@ -2983,7 +2983,7 @@ static int previews_id_ensure_callback(void *userdata, ID *UNUSED(self_id), ID *
static int previews_ensure_exec(bContext *C, wmOperator *UNUSED(op))
{
Main *bmain = CTX_data_main(C);
ListBase *lb[] = {&bmain->mat, &bmain->tex, &bmain->image, &bmain->world, &bmain->lamp, NULL};
ListBase *lb[] = {&bmain->mat, &bmain->tex, &bmain->image, &bmain->world, &bmain->light, NULL};
PreviewsIDEnsureData preview_id_data;
Scene *scene;
ID *id;
@ -3049,7 +3049,7 @@ static int previews_clear_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
ListBase *lb[] = {&bmain->object, &bmain->collection,
&bmain->mat, &bmain->world, &bmain->lamp, &bmain->tex, &bmain->image, NULL};
&bmain->mat, &bmain->world, &bmain->light, &bmain->tex, &bmain->image, NULL};
int i;
const int id_filters = RNA_enum_get(op->ptr, "id_type");