[Bf-blender-cvs] [8c8d752f96d] custom-manipulators: Cleanup: use BKE_object_facemap_* prefix for face-map operations

Campbell Barton noreply at git.blender.org
Tue May 30 08:37:58 CEST 2017


Commit: 8c8d752f96dc44f02147a3c514f1b46e713f3325
Author: Campbell Barton
Date:   Tue May 30 16:38:03 2017 +1000
Branches: custom-manipulators
https://developer.blender.org/rB8c8d752f96dc44f02147a3c514f1b46e713f3325

Cleanup: use BKE_object_facemap_* prefix for face-map operations

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

M	source/blender/blenkernel/BKE_object_facemap.h
M	source/blender/blenkernel/intern/object.c
M	source/blender/blenkernel/intern/object_facemap.c
M	source/blender/makesrna/intern/rna_object.c

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

diff --git a/source/blender/blenkernel/BKE_object_facemap.h b/source/blender/blenkernel/BKE_object_facemap.h
index 12996c9429d..332b2851e85 100644
--- a/source/blender/blenkernel/BKE_object_facemap.h
+++ b/source/blender/blenkernel/BKE_object_facemap.h
@@ -25,7 +25,7 @@
 
 /** \file BKE_object_facemap.h
  * \ingroup bke
- * \brief Functions for dealing with objects and facemaps.
+ * \brief Functions for dealing with object face-maps.
  */
 
 #ifdef __cplusplus
@@ -36,16 +36,15 @@ struct bFaceMap;
 struct ListBase;
 struct Object;
 
-/* Face map operations */
 struct bFaceMap *BKE_object_facemap_add(struct Object *ob);
 struct bFaceMap *BKE_object_facemap_add_name(struct Object *ob, const char *name);
-void BKE_object_facemap_remove(struct Object *ob, struct bFaceMap *fmap);
-void BKE_object_fmap_remove_all(struct Object *ob);
+void             BKE_object_facemap_remove(struct Object *ob, struct bFaceMap *fmap);
+void             BKE_object_facemap_clear(struct Object *ob);
 
-int fmap_name_index(struct Object *ob, const char *name);
-void fmap_unique_name(struct bFaceMap *fmap, struct Object *ob);
-struct bFaceMap *fmap_find_name(struct Object *ob, const char *name);
-void fmap_copy_list(struct ListBase *outbase, struct ListBase *inbase);
+int              BKE_object_facemap_name_index(struct Object *ob, const char *name);
+void             BKE_object_facemap_unique_name(struct Object *ob, struct bFaceMap *fmap);
+struct bFaceMap *BKE_object_facemap_find_name(struct Object *ob, const char *name);
+void             BKE_object_facemap_copy_list(struct ListBase *outbase, struct ListBase *inbase);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index ad9a5728e8f..59cbab2f1c0 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1153,7 +1153,7 @@ Object *BKE_object_copy_ex(Main *bmain, Object *ob, bool copy_caches)
 			BKE_pose_rebuild(obn, obn->data);
 	}
 	defgroup_copy_list(&obn->defbase, &ob->defbase);
-	fmap_copy_list(&obn->fmaps, &ob->fmaps);
+	BKE_object_facemap_copy_list(&obn->fmaps, &ob->fmaps);
 	BKE_constraints_copy(&obn->constraints, &ob->constraints, true);
 
 	obn->mode = OB_MODE_OBJECT;
diff --git a/source/blender/blenkernel/intern/object_facemap.c b/source/blender/blenkernel/intern/object_facemap.c
index c2d57f3d499..02dedc10026 100644
--- a/source/blender/blenkernel/intern/object_facemap.c
+++ b/source/blender/blenkernel/intern/object_facemap.c
@@ -90,7 +90,7 @@ static bFaceMap *fmap_duplicate(bFaceMap *infmap)
 	return outfmap;
 }
 
-void fmap_copy_list(ListBase *outbase, ListBase *inbase)
+void BKE_object_facemap_copy_list(ListBase *outbase, ListBase *inbase)
 {
 	bFaceMap *fmap, *fmapn;
 
@@ -102,7 +102,7 @@ void fmap_copy_list(ListBase *outbase, ListBase *inbase)
 	}
 }
 
-void fmap_unique_name(bFaceMap *fmap, Object *ob)
+void BKE_object_facemap_unique_name(Object *ob, bFaceMap *fmap)
 {
 	struct {Object *ob; void *fmap; } data;
 	data.ob = ob;
@@ -126,7 +126,7 @@ bFaceMap *BKE_object_facemap_add_name(Object *ob, const char *name)
 	
 	ob->actfmap = BLI_listbase_count(&ob->fmaps);
 	
-	fmap_unique_name(fmap, ob);
+	BKE_object_facemap_unique_name(ob, fmap);
 
 	return fmap;
 }
@@ -227,7 +227,7 @@ void BKE_object_facemap_remove(Object *ob, bFaceMap *fmap)
 	fmap_remove_exec(ob, fmap, BKE_object_is_in_editmode(ob), true);
 }
 
-void BKE_object_fmap_remove_all(Object *ob)
+void BKE_object_facemap_clear(Object *ob)
 {
 	bFaceMap *fmap = (bFaceMap *)ob->fmaps.first;
 
@@ -248,12 +248,12 @@ void BKE_object_fmap_remove_all(Object *ob)
 	ob->actfmap = 0;
 }
 
-int fmap_name_index(Object *ob, const char *name)
+int BKE_object_facemap_name_index(Object *ob, const char *name)
 {
 	return (name) ? BLI_findstringindex(&ob->fmaps, name, offsetof(bFaceMap, name)) : -1;
 }
 
-bFaceMap *fmap_find_name(Object *ob, const char *name)
+bFaceMap *BKE_object_facemap_find_name(Object *ob, const char *name)
 {
 	return BLI_findstring(&ob->fmaps, name, offsetof(bFaceMap, name));
 }
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 667ac8bbb56..a935715d031 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -614,7 +614,7 @@ static void rna_FaceMap_name_set(PointerRNA *ptr, const char *value)
 	Object *ob = (Object *)ptr->id.data;
 	bFaceMap *fmap = (bFaceMap *)ptr->data;
 	BLI_strncpy_utf8(fmap->name, value, sizeof(fmap->name));
-	fmap_unique_name(fmap, ob);
+	BKE_object_facemap_unique_name(ob, fmap);
 }
 
 static int rna_FaceMap_index_get(PointerRNA *ptr)
@@ -651,7 +651,7 @@ static void rna_Object_active_face_map_index_range(PointerRNA *ptr, int *min, in
 	*max = max_ii(0, BLI_listbase_count(&ob->fmaps) - 1);
 }
 
-void rna_object_fmap_name_index_get(PointerRNA *ptr, char *value, int index)
+void rna_object_BKE_object_facemap_name_index_get(PointerRNA *ptr, char *value, int index)
 {
 	Object *ob = (Object *)ptr->id.data;
 	bFaceMap *fmap;
@@ -662,7 +662,7 @@ void rna_object_fmap_name_index_get(PointerRNA *ptr, char *value, int index)
 	else value[0] = '\0';
 }
 
-int rna_object_fmap_name_index_length(PointerRNA *ptr, int index)
+int rna_object_BKE_object_facemap_name_index_length(PointerRNA *ptr, int index)
 {
 	Object *ob = (Object *)ptr->id.data;
 	bFaceMap *fmap;
@@ -671,16 +671,16 @@ int rna_object_fmap_name_index_length(PointerRNA *ptr, int index)
 	return (fmap) ? strlen(fmap->name) : 0;
 }
 
-void rna_object_fmap_name_index_set(PointerRNA *ptr, const char *value, short *index)
+void rna_object_BKE_object_facemap_name_index_set(PointerRNA *ptr, const char *value, short *index)
 {
 	Object *ob = (Object *)ptr->id.data;
-	*index = fmap_name_index(ob, value) + 1;
+	*index = BKE_object_facemap_name_index(ob, value) + 1;
 }
 
 void rna_object_fmap_name_set(PointerRNA *ptr, const char *value, char *result, int maxlen)
 {
 	Object *ob = (Object *)ptr->id.data;
-	bFaceMap *fmap = fmap_find_name(ob, value);
+	bFaceMap *fmap = BKE_object_facemap_find_name(ob, value);
 	if (fmap) {
 		BLI_strncpy(result, value, maxlen); /* no need for BLI_strncpy_utf8, since this matches an existing group */
 		return;
@@ -1560,7 +1560,7 @@ static void rna_Object_fmap_remove(Object *ob, ReportList *reports, PointerRNA *
 
 static void rna_Object_fmap_clear(Object *ob)
 {
-	BKE_object_fmap_remove_all(ob);
+	BKE_object_facemap_clear(ob);
 
 	WM_main_add_notifier(NC_OBJECT | ND_DRAW, ob);
 }




More information about the Bf-blender-cvs mailing list