From 3051e2f4ae8fd3e72a43dd1e5d40893d0efec500 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Feb 2019 10:46:48 +1100 Subject: DNA: rename Lamp -> Light - BKE_lamp -> BKE_light - Main.lamp -> light --- source/blender/blenkernel/intern/anim_sys.c | 6 +++--- source/blender/blenkernel/intern/camera.c | 2 +- source/blender/blenkernel/intern/icons.c | 2 +- source/blender/blenkernel/intern/ipo.c | 8 ++++---- source/blender/blenkernel/intern/lamp.c | 26 ++++++++++++------------ source/blender/blenkernel/intern/library.c | 10 ++++----- source/blender/blenkernel/intern/library_query.c | 2 +- source/blender/blenkernel/intern/library_remap.c | 2 +- source/blender/blenkernel/intern/main.c | 4 ++-- source/blender/blenkernel/intern/node.c | 12 +++++------ source/blender/blenkernel/intern/object.c | 4 ++-- source/blender/blenkernel/intern/smoke.c | 2 +- 12 files changed, 40 insertions(+), 40 deletions(-) (limited to 'source/blender/blenkernel/intern') diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 1b09868bf7d..872129e351d 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -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); diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index 92281424f99..8e27b3f288d 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -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; diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 1fce0a128a1..24d548c18c6 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -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); diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index 1b5ff6128b8..b49debc36cc 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -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) diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c index fe04ad62f93..5057daaa35d 100644 --- a/source/blender/blenkernel/intern/lamp.c +++ b/source/blender/blenkernel/intern/lamp.c @@ -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); diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 503ac9da0bd..5ff1418cf6a 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -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); diff --git a/source/blender/blenkernel/intern/library_query.c b/source/blender/blenkernel/intern/library_query.c index c9c223c8724..65bece54306 100644 --- a/source/blender/blenkernel/intern/library_query.c +++ b/source/blender/blenkernel/intern/library_query.c @@ -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); diff --git a/source/blender/blenkernel/intern/library_remap.c b/source/blender/blenkernel/intern/library_remap.c index c8be98bb695..a5fdcfcb0f2 100644 --- a/source/blender/blenkernel/intern/library_remap.c +++ b/source/blender/blenkernel/intern/library_remap.c @@ -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); diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c index 9a7146abba4..c5be951ee23 100644 --- a/source/blender/blenkernel/intern/main.c +++ b/source/blender/blenkernel/intern/main.c @@ -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); diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 70e38e86c0c..b8ccd0d9274 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -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; diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 80c8f973663..460c50d0d0b 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -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; diff --git a/source/blender/blenkernel/intern/smoke.c b/source/blender/blenkernel/intern/smoke.c index 79fbe4c4c62..707daaf0c54 100644 --- a/source/blender/blenkernel/intern/smoke.c +++ b/source/blender/blenkernel/intern/smoke.c @@ -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]); -- cgit v1.2.3