[Bf-blender-cvs] [aaf0ac1] alembic_basic_io: Cleanup: function names.
Kévin Dietrich
noreply at git.blender.org
Sun Mar 27 23:31:12 CEST 2016
Commit: aaf0ac106a41f605a79d9456b5a392b410fdea50
Author: Kévin Dietrich
Date: Sun Mar 27 21:39:01 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rBaaf0ac106a41f605a79d9456b5a392b410fdea50
Cleanup: function names.
===================================================================
M source/blender/alembic/ABC_alembic.h
M source/blender/alembic/intern/alembic_capi.cc
M source/blender/blenkernel/intern/object.c
M source/blender/editors/io/io_alembic.c
M source/blender/makesrna/intern/rna_main_api.c
M source/blender/makesrna/intern/rna_object.c
M source/blender/makesrna/intern/rna_scene_api.c
M source/blender/modifiers/intern/MOD_meshcache.c
M source/blender/modifiers/intern/MOD_meshcache_abc.c
===================================================================
diff --git a/source/blender/alembic/ABC_alembic.h b/source/blender/alembic/ABC_alembic.h
index bfcef72..4af4499 100644
--- a/source/blender/alembic/ABC_alembic.h
+++ b/source/blender/alembic/ABC_alembic.h
@@ -54,22 +54,24 @@ int ABC_export(struct Scene *sce, const char *filename,
bool packuv
);
-void abcGetVertexCache(const char* filepath, float time, void *key, void* verts, int max_verts, const char* sub_obj, int is_mvert);
-struct Mesh *abcGetMesh(const char* filepath, float time, void *key, int assign_mats, const char* sub_obj, bool *p_only);
-struct Curve *abcGetNurbs(const char* filepath, float time, const char* sub_obj);
-void abcApplyMaterials(struct Object *ob, void* key);
+void ABC_get_vertex_cache(const char *filepath, float time, void *key, void *verts, int max_verts, const char *sub_obj, int is_mvert);
+struct Mesh *ABC_get_mesh(const char *filepath, float time, void *key, int assign_mats, const char *sub_obj, bool *p_only);
+struct Curve *ABC_get_nurbs(const char *filepath, float time, const char *sub_obj);
+void ABC_apply_materials(struct Object *ob, void *key);
-void ABC_getObjects(const char *filename, char* result);
-void ABC_getNurbs(const char *filename, char* result);
-void ABC_getCamera(const char *filename, char* result);
-void ABC_getTransform(const char *filename, const char* abc_subobject, float time, float mat[][4], int to_y_up);
-void ABC_setCustomProperties(struct Object* bobj);
-void ABC_set_camera(const char* filename, const char* abc_subobject, float time, struct Camera* bcam);
-void abcDestroyMeshData(void* key);
-int checkSubobjectValid(const char* name, const char* sub_obj);
-void abcDestroyKey(void*);
-void abcMutexLock(void);
-void abcMutexUnlock(void);
+void ABC_get_objects_names(const char *filename, char *result);
+void ABC_get_nurbs_names(const char *filename, char *result);
+void ABC_get_camera_names(const char *filename, char *result);
+
+void ABC_get_transform(const char *filename, const char *abc_subobject, float time, float mat[][4], int to_y_up);
+void ABC_set_custom_properties(struct Object *bobj);
+void ABC_set_camera(const char *filename, const char *abc_subobject, float time, struct Camera *bcam);
+void ABC_destroy_mesh_data(void *key);
+int ABC_check_subobject_valid(const char *name, const char *sub_obj);
+void ABC_destroy_key(void *);
+
+void ABC_mutex_lock(void);
+void ABC_mutex_unlock(void);
#ifdef __cplusplus
}
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index d09fa5d..53f4988 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -298,7 +298,8 @@ struct alembicManager {
MeshMap mesh_map_cache;
};
-static struct alembicManager *abc_manager = new alembicManager();
+/* TODO */
+static alembicManager *abc_manager = new alembicManager();
static Material *findMaterial(const char *name)
{
@@ -316,12 +317,12 @@ static Material *findMaterial(const char *name)
return found_material;
}
-void abcMutexLock()
+void ABC_mutex_lock()
{
BLI_mutex_lock(abc_manager->mutex);
}
-void abcMutexUnlock()
+void ABC_mutex_unlock()
{
BLI_mutex_unlock(abc_manager->mutex);
}
@@ -738,7 +739,6 @@ static void getIObjectAsMesh(std::pair<IPolyMeshSchema, IObject> schema, const I
}
}
-
static size_t updatePoints(std::pair<IPolyMeshSchema, IObject> schema, const ISampleSelector &sample_sel, MVert *verts, size_t vtx_start, int max_verts = -1, float (*vcos)[3] = 0) {
if (!schema.first.valid()) {
@@ -782,7 +782,7 @@ static size_t updatePoints(std::pair<IPolyMeshSchema, IObject> schema, const ISa
return vtx_start + vertex_count;
}
-void abcDestroyMeshData(void *key)
+void ABC_destroy_mesh_data(void *key)
{
if (abc_manager->mesh_map.find(key) != abc_manager->mesh_map.end()) {
AbcInfo *info = &abc_manager->mesh_map[key];
@@ -796,7 +796,7 @@ void abcDestroyMeshData(void *key)
}
}
-void abcDestroyKey(void *key)
+void ABC_destroy_key(void *key)
{
MeshMap::iterator it;
if ((it = abc_manager->mesh_map.find(key)) != abc_manager->mesh_map.end()) {
@@ -810,7 +810,7 @@ void abcDestroyKey(void *key)
}
}
-Mesh *abcGetMesh(const char *filepath, float time, void *key, int assign_mats, const char *sub_obj, bool *p_only)
+Mesh *ABC_get_mesh(const char *filepath, float time, void *key, int assign_mats, const char *sub_obj, bool *p_only)
{
Mesh *mesh = NULL;
std::string file_path = filepath;
@@ -885,7 +885,7 @@ Mesh *abcGetMesh(const char *filepath, float time, void *key, int assign_mats, c
return mesh;
}
-Curve *abcGetNurbs(const char *filepath, float time, const char *sub_obj)
+Curve *ABC_get_nurbs(const char *filepath, float time, const char *sub_obj)
{
Curve *cu = NULL;
std::string file_path = filepath;
@@ -989,7 +989,7 @@ Curve *abcGetNurbs(const char *filepath, float time, const char *sub_obj)
return cu;
}
-void abcApplyMaterials(Object *ob, void *key)
+void ABC_apply_materials(Object *ob, void *key)
{
AbcInfo &meshmap = abc_manager->mesh_map[key];
@@ -1030,7 +1030,7 @@ void abcApplyMaterials(Object *ob, void *key)
}
}
-void abcGetVertexCache(const char *filepath, float time, void *key, void *verts, int max_verts, const char *sub_obj, int is_mverts)
+void ABC_get_vertex_cache(const char *filepath, float time, void *key, void *verts, int max_verts, const char *sub_obj, int is_mverts)
{
std::string file_path = filepath;
std::string sub_object = sub_obj;
@@ -1085,7 +1085,7 @@ void abcGetVertexCache(const char *filepath, float time, void *key, void *verts,
}
}
-void ABC_getObjects(const char *filename, char *result)
+void ABC_get_objects_names(const char *filename, char *result)
{
std::vector<std::string> strings;
IArchive *archive = abc_manager->getArchive(filename);
@@ -1104,7 +1104,7 @@ void ABC_getObjects(const char *filename, char *result)
BLI_strncpy(result, final.c_str(), final.length()+1);
}
-void ABC_getNurbs(const char *filename, char *result)
+void ABC_get_nurbs_names(const char *filename, char *result)
{
std::vector<std::string> strings;
IArchive *archive = abc_manager->getArchive(filename);
@@ -1123,7 +1123,7 @@ void ABC_getNurbs(const char *filename, char *result)
BLI_strncpy(result, final.c_str(), 65535);
}
-void ABC_getCamera(const char *filename, char *result)
+void ABC_get_camera_names(const char *filename, char *result)
{
std::vector<std::string> strings;
IArchive *archive = abc_manager->getArchive(filename);
@@ -1142,7 +1142,7 @@ void ABC_getCamera(const char *filename, char *result)
BLI_strncpy(result, final.c_str(), 65535);
}
-int checkSubobjectValid(const char *name, const char *sub_obj)
+int ABC_check_subobject_valid(const char *name, const char *sub_obj)
{
if (name[0] == '\0')
return 0;
@@ -1227,7 +1227,7 @@ static void getProperties(Object *bobj, IXformSchema object, ICompoundProperty c
}
}
-void ABC_setCustomProperties(Object *bobj)
+void ABC_set_custom_properties(Object *bobj)
{
bool found;
@@ -1255,7 +1255,7 @@ void ABC_setCustomProperties(Object *bobj)
}
-void ABC_getTransform(const char *filename, const char *abc_subobject, float time, float mat[][4], int to_y_up)
+void ABC_get_transform(const char *filename, const char *abc_subobject, float time, float mat[][4], int to_y_up)
{
std::vector<std::string> strings;
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 48b5380..2b2d179 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -3173,9 +3173,9 @@ void BKE_object_handle_update_ex(EvaluationContext *eval_ctx,
if (((ob->abc_flag & 1) == 1) && ob->abc_file[0] != '\0' && ob->abc_subobject[0] != '\0'){
float time = BKE_scene_frame_get(scene) / (float)scene->r.frs_sec;
- abcMutexLock();
- ABC_getTransform(ob->abc_file, ob->abc_subobject, time, ob->obmat, ob->parent == NULL);
- abcMutexUnlock();
+ ABC_mutex_lock();
+ ABC_get_transform(ob->abc_file, ob->abc_subobject, time, ob->obmat, ob->parent == NULL);
+ ABC_mutex_unlock();
if (ob->type == OB_CAMERA){
unit_m4(cam_to_yup);
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c
index 19bebf7..e37eacc 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -173,13 +173,13 @@ static int wm_alembic_import_exec(bContext *C, wmOperator *op)
/* get objects strings */
char objects_str;
- ABC_getObjects(filename, objects_str);
+ ABC_get_objects_names(filename, objects_str);
char nurbs_str;
- ABC_getNurbs(filename, nurbs_str);
+ ABC_get_nurbs_names(filename, nurbs_str);
char camera_str;
- ABC_getCamera(filename, camera_str);
+ ABC_get_camera_names(filename, camera_str);
#endif
/* restore cursor */
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index fb1bd1e..51643b1 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -233,12 +233,12 @@ static Object *rna_Main_objects_from_alembic(
ID* data;
bool p_only = false;
- abcMutexLock();
- mesh = abcGetMesh(filepath, 0., NULL, apply_materials, subobject, &p_only);
- abcMutexUnlock();
+ ABC_mutex_lock();
+ mesh = ABC_get_mesh(filepath, 0., NULL, apply_materials, subobject, &p_only);
+ ABC_mutex_unlock();
if (!mesh){
- abcDestroyKey(NULL);
+ ABC_destroy_key(NULL);
return NULL;
}
@@ -248,12 +248,12 @@ static Object *rna_Main_objects_from_alembic(
ob = rna_Main_objects_new(bmain, reports, name, data);
if (apply_materials){
- abcApplyMaterials(ob, NULL);
+ ABC_apply_materials(ob, NULL);
}
mesh->id.us--;
- abcDestroyKey(NULL);
+ ABC_destroy_key(NULL);
return ob;
}
@@ -266,9 +266,9 @@ static Object *rna_Main_nurbs_from_alembic(
Curve *curve = NULL;
ID *data;
- abcMutexLock();
- curve = abcGetNurbs(filepath, 0., subobject);
- abcMutexUnlock();
+ ABC_mutex_lock();
+ curve = ABC_get_nurbs(filepath, 0., subobject);
+ ABC_mutex_unlock();
if (!curve){
return NULL;
diff --git a/so
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list