[Bf-blender-cvs] [f3300052667] master: Cleanup: BKE naming conventions for datablock add/localize

Campbell Barton noreply at git.blender.org
Wed Jan 10 23:58:28 CET 2018


Commit: f33000526679c543c1398a68a84b93dad521a5cb
Author: Campbell Barton
Date:   Thu Jan 11 09:55:41 2018 +1100
Branches: master
https://developer.blender.org/rBf33000526679c543c1398a68a84b93dad521a5cb

Cleanup: BKE naming conventions for datablock add/localize

Conventions were already followed nearly everywhere.

===================================================================

M	source/blender/blenkernel/BKE_action.h
M	source/blender/blenkernel/BKE_lamp.h
M	source/blender/blenkernel/BKE_material.h
M	source/blender/blenkernel/BKE_particle.h
M	source/blender/blenkernel/BKE_world.h
M	source/blender/blenkernel/intern/action.c
M	source/blender/blenkernel/intern/anim_sys.c
M	source/blender/blenkernel/intern/ipo.c
M	source/blender/blenkernel/intern/lamp.c
M	source/blender/blenkernel/intern/material.c
M	source/blender/blenkernel/intern/particle.c
M	source/blender/blenkernel/intern/world.c
M	source/blender/blenloader/intern/versioning_legacy.c
M	source/blender/editors/animation/keyframing.c
M	source/blender/editors/armature/pose_lib.c
M	source/blender/editors/physics/particle_object.c
M	source/blender/editors/render/render_preview.c
M	source/blender/editors/render/render_shading.c
M	source/blender/editors/space_action/action_data.c
M	source/blender/makesrna/intern/rna_fluidsim.c
M	source/blender/makesrna/intern/rna_main_api.c
M	source/blender/render/intern/source/render_texture.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 28be2b04c71..f7ebe85bcef 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -55,7 +55,7 @@ extern "C" {
 /* Action Lib Stuff ----------------- */
 
 /* Allocate a new bAction with the given name */
-struct bAction *add_empty_action(struct Main *bmain, const char name[]);
+struct bAction *BKE_action_add(struct Main *bmain, const char name[]);
 
 void BKE_action_copy_data(struct Main *bmain, struct bAction *act_dst, const struct bAction *act_src, const int flag);
 /* Allocate a copy of the given Action and all its data */
diff --git a/source/blender/blenkernel/BKE_lamp.h b/source/blender/blenkernel/BKE_lamp.h
index b68da654520..3673e657b33 100644
--- a/source/blender/blenkernel/BKE_lamp.h
+++ b/source/blender/blenkernel/BKE_lamp.h
@@ -46,7 +46,7 @@ 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 *localize_lamp(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);
 
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h
index c6ebda2c399..f7850913014 100644
--- a/source/blender/blenkernel/BKE_material.h
+++ b/source/blender/blenkernel/BKE_material.h
@@ -56,7 +56,7 @@ void BKE_material_remap_object_calc(struct  Object *ob_dst, struct Object *ob_sr
 struct Material *BKE_material_add(struct Main *bmain, const char *name);
 void BKE_material_copy_data(struct Main *bmain, struct Material *ma_dst, const struct Material *ma_src, const int flag);
 struct Material *BKE_material_copy(struct Main *bmain, const struct Material *ma);
-struct Material *localize_material(struct Material *ma);
+struct Material *BKE_material_localize(struct Material *ma);
 struct Material *give_node_material(struct Material *ma); /* returns node material or self */
 void BKE_material_make_local(struct Main *bmain, struct Material *ma, const bool lib_local);
 
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index ddb4f9c37bd..b43d000ed35 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -323,7 +323,7 @@ struct ParticleSystemModifierData *psys_get_modifier(struct Object *ob, struct P
 
 struct ModifierData *object_add_particle_system(struct Scene *scene, struct Object *ob, const char *name);
 void object_remove_particle_system(struct Scene *scene, struct Object *ob);
-struct ParticleSettings *psys_new_settings(const char *name, struct Main *main);
+struct ParticleSettings *BKE_particlesettings_add(struct Main *main, const char *name);
 void BKE_particlesettings_copy_data(
         struct Main *bmain, struct ParticleSettings *part_dst, const struct ParticleSettings *part_src,
         const int flag);
diff --git a/source/blender/blenkernel/BKE_world.h b/source/blender/blenkernel/BKE_world.h
index 2a811496bb9..dfa367afeb2 100644
--- a/source/blender/blenkernel/BKE_world.h
+++ b/source/blender/blenkernel/BKE_world.h
@@ -38,10 +38,10 @@ struct World;
 
 void BKE_world_free(struct World *sc);
 void BKE_world_init(struct World *wrld);
-struct World *add_world(struct Main *bmian, const char *name);
+struct World *BKE_world_add(struct Main *bmian, const char *name);
 void BKE_world_copy_data(struct Main *bmain, struct World *wrld_dst, const struct World *wrld_src, const int flag);
 struct World *BKE_world_copy(struct Main *bmain, const struct World *wrld);
-struct World *localize_world(struct World *wrld);
+struct World *BKE_world_localize(struct World *wrld);
 void BKE_world_make_local(struct Main *bmain, struct World *wrld, const bool lib_local);
 
 #endif
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 5c2fe0bb040..034248df8d5 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -84,7 +84,7 @@
 
 /* ***************** Library data level operations on action ************** */
 
-bAction *add_empty_action(Main *bmain, const char name[])
+bAction *BKE_action_add(Main *bmain, const char name[])
 {
 	bAction *act;
 	
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index ba8f454aa47..2c6339de500 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -527,7 +527,7 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths
 	if (srcAdt->action) {
 		/* set up an action if necessary, and name it in a similar way so that it can be easily found again */
 		if (dstAdt->action == NULL) {
-			dstAdt->action = add_empty_action(G.main, srcAdt->action->id.name + 2);
+			dstAdt->action = BKE_action_add(G.main, srcAdt->action->id.name + 2);
 		}
 		else if (dstAdt->action == srcAdt->action) {
 			printf("Argh! Source and Destination share animation! ('%s' and '%s' both use '%s') Making new empty action\n",
@@ -535,7 +535,7 @@ void BKE_animdata_separate_by_basepath(ID *srcID, ID *dstID, ListBase *basepaths
 			
 			/* TODO: review this... */
 			id_us_min(&dstAdt->action->id);
-			dstAdt->action = add_empty_action(G.main, dstAdt->action->id.name + 2);
+			dstAdt->action = BKE_action_add(G.main, dstAdt->action->id.name + 2);
 		}
 			
 		/* loop over base paths, trying to fix for each one... */
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index 90247441631..00cf40f06cd 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -1559,7 +1559,7 @@ static void ipo_to_animdata(ID *id, Ipo *ipo, char actname[], char constname[],
 			
 			BLI_snprintf(nameBuf, sizeof(nameBuf), "CDA:%s", ipo->id.name + 2);
 			
-			adt->action = add_empty_action(G.main, nameBuf);
+			adt->action = BKE_action_add(G.main, nameBuf);
 			if (G.debug & G_DEBUG) printf("\t\tadded new action - '%s'\n", nameBuf);
 		}
 		
@@ -2107,7 +2107,7 @@ void do_versions_ipos_to_animato(Main *main)
 			bAction *new_act;
 			
 			/* add a new action for this, and convert all data into that action */
-			new_act = add_empty_action(main, id->name + 2);
+			new_act = BKE_action_add(main, id->name + 2);
 			ipo_to_animato(NULL, ipo, NULL, NULL, NULL, NULL, &new_act->curves, &drivers);
 			new_act->idroot = ipo->blocktype;
 		}
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index fe481905fb2..3a4c920d8fb 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -156,7 +156,7 @@ Lamp *BKE_lamp_copy(Main *bmain, const Lamp *la)
 	return la_copy;
 }
 
-Lamp *localize_lamp(Lamp *la)
+Lamp *BKE_lamp_localize(Lamp *la)
 {
 	/* TODO replace with something like
 	 * 	Lamp *la_copy;
@@ -172,7 +172,7 @@ Lamp *localize_lamp(Lamp *la)
 
 	for (a = 0; a < MAX_MTEX; a++) {
 		if (lan->mtex[a]) {
-			lan->mtex[a] = MEM_mallocN(sizeof(MTex), "localize_lamp");
+			lan->mtex[a] = MEM_mallocN(sizeof(MTex), __func__);
 			memcpy(lan->mtex[a], la->mtex[a], sizeof(MTex));
 		}
 	}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 07c2ff4ba9d..0dd7047a376 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -267,7 +267,7 @@ Material *BKE_material_copy(Main *bmain, const Material *ma)
 }
 
 /* XXX (see above) material copy without adding to main dbase */
-Material *localize_material(Material *ma)
+Material *BKE_material_localize(Material *ma)
 {
 	/* TODO replace with something like
 	 * 	Material *ma_copy;
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index cbbb44c55cb..8b3910c1d53 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3136,7 +3136,7 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n
 	psys->pointcache = BKE_ptcache_add(&psys->ptcaches);
 	BLI_addtail(&ob->particlesystem, psys);
 
-	psys->part = psys_new_settings(DATA_("ParticleSettings"), NULL);
+	psys->part = BKE_particlesettings_add(NULL, DATA_("ParticleSettings"));
 
 	if (BLI_listbase_count_ex(&ob->particlesystem, 2) > 1)
 		BLI_snprintf(psys->name, sizeof(psys->name), DATA_("ParticleSystem %i"), BLI_listbase_count(&ob->particlesystem));
@@ -3294,7 +3294,7 @@ static void default_particle_settings(ParticleSettings *part)
 }
 
 
-ParticleSettings *psys_new_settings(const char *name, Main *main)
+ParticleSettings *BKE_particlesettings_add(Main *main, const char *name)
 {
 	ParticleSettings *part;
 
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index acab94be9c5..10fcfaa444f 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -108,7 +108,7 @@ void BKE_world_init(World *wrld)
 	wrld->mistdist = 25.0f;
 }
 
-World *add_world(Main *bmain, const char *name)
+World *BKE_world_add(Main *bmain, const char *name)
 {
 	World *wrld;
 
@@ -158,7 +158,7 @@ World *BKE_world_copy(Main *bmain, const World *wrld)
 	return wrld_copy;
 }
 
-World *localize_world(World *wrld)
+World *BKE_world_localize(World *wrld)
 {
 	/* TODO replace with something like
 	 * 	World *wrld_copy;
@@ -174,7 +174,7 @@ World *localize_world(World *wrld)
 	
 	for (a = 0; a < MAX_MTEX; a++) {
 		if (wrld->mtex[a]) {
-			wrldn->mtex[a] = MEM_mallocN(sizeof(MTex), "localize_world");
+			wrldn->mtex[a] = MEM_mallocN(sizeof(MTex), __func__);
 			memcpy(wrldn->mtex[a], wrld->mtex[a], sizeof(MTex));
 		}
 	}
diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_leg

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list