[Bf-blender-cvs] [0a22353] alembic_basic_io: Cleanup, make API a bit more consistent.

Kévin Dietrich noreply at git.blender.org
Tue May 31 01:51:14 CEST 2016


Commit: 0a223539f04e5820a8cc25615281f6c044badb6d
Author: Kévin Dietrich
Date:   Tue May 31 01:25:59 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB0a223539f04e5820a8cc25615281f6c044badb6d

Cleanup, make API a bit more consistent.

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

M	source/blender/alembic/ABC_alembic.h
M	source/blender/alembic/intern/abc_hair.cc
M	source/blender/alembic/intern/abc_hair.h
M	source/blender/alembic/intern/alembic_capi.cc

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

diff --git a/source/blender/alembic/ABC_alembic.h b/source/blender/alembic/ABC_alembic.h
index e22af68..daef9e2 100644
--- a/source/blender/alembic/ABC_alembic.h
+++ b/source/blender/alembic/ABC_alembic.h
@@ -39,7 +39,7 @@ enum {
 #define BL_ABC_NO_ERR 0
 #define BL_ABC_UNKNOWN_ERROR 1
 
-int ABC_export(struct Scene *scene, struct bContext *C, const char *filename,
+int ABC_export(struct Scene *scene, struct bContext *C, const char *filepath,
                double start, double end,
                double xformstep, double geomstep,
                double shutter_open, double shutter_close,
@@ -54,13 +54,13 @@ int ABC_export(struct Scene *scene, struct bContext *C, const char *filename,
                int geogroups, int compression,
                bool packuv, float scale);
 
-void ABC_import(struct bContext *C, const char *filename, float scale);
+void ABC_import(struct bContext *C, const char *filepath, float scale);
 
-void ABC_get_vertex_cache(const char *filepath, float time, void *verts, int max_verts, const char *sub_obj, int is_mvert);
+void ABC_get_vertex_cache(const char *filepath, float time, void *verts, int max_verts, const char *object_path, int is_mvert);
 
-int ABC_check_subobject_valid(const char *name, const char *sub_obj);
+int ABC_check_subobject_valid(const char *filepath, const char *object_path);
 
-void ABC_get_transform(struct Object *ob, const char *filename, const char *object_path, float r_mat[4][4], float time);
+void ABC_get_transform(struct Object *ob, const char *filepath, const char *object_path, float r_mat[4][4], float time);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/alembic/intern/abc_hair.cc b/source/blender/alembic/intern/abc_hair.cc
index 7ef7b3e..d0ac2c9 100644
--- a/source/blender/alembic/intern/abc_hair.cc
+++ b/source/blender/alembic/intern/abc_hair.cc
@@ -69,17 +69,11 @@ AbcHairWriter::AbcHairWriter(Scene *scene,
     : AbcShapeWriter(scene, ob, parent, timeSampling, settings)
 {
 	m_psys = psys;
-	m_is_animated = isAnimated();
 
 	OCurves curves(parent->alembicXform(), m_name, m_time_sampling);
 	m_curves_schema = curves.getSchema();
 }
 
-bool AbcHairWriter::isAnimated() const
-{
-	return true;
-}
-
 void AbcHairWriter::do_write()
 {
 	if (!m_psys) {
diff --git a/source/blender/alembic/intern/abc_hair.h b/source/blender/alembic/intern/abc_hair.h
index 68ad644..1186072 100644
--- a/source/blender/alembic/intern/abc_hair.h
+++ b/source/blender/alembic/intern/abc_hair.h
@@ -33,7 +33,6 @@ struct ParticleSettings;
 struct ParticleSystem;
 
 class AbcHairWriter : public AbcShapeWriter {
-	bool m_is_animated;
     ParticleSystem *m_psys;
 
 	Alembic::AbcGeom::OCurvesSchema m_curves_schema;
@@ -50,8 +49,6 @@ public:
 private:
 	virtual void do_write();
 
-    bool isAnimated() const;
-
 	void write_hair_sample(DerivedMesh *dm,
                            ParticleSettings *part,
                            std::vector<Imath::V3f> &verts,
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index 42359d7..1bcf75d 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -151,14 +151,14 @@ static size_t update_points(std::pair<IPolyMeshSchema, IObject> schema,
 }
 
 static void find_mesh_object(const IObject &object, IObject &ret,
-                             const std::string &name, bool &found)
+                             const std::string &object_path, bool &found)
 {
 	if (!object.valid()) {
 		return;
 	}
 
 	std::vector<std::string> tokens;
-	split(name, '/', tokens);
+	split(object_path, '/', tokens);
 
 	IObject tmp = object;
 
@@ -183,7 +183,7 @@ static void find_mesh_object(const IObject &object, IObject &ret,
 }
 
 void ABC_get_vertex_cache(const char *filepath, float time, void *verts,
-                          int max_verts, const char *sub_obj, int is_mverts)
+                          int max_verts, const char *object_path, int is_mverts)
 {
 	IArchive archive = open_archive(filepath);
 
@@ -200,7 +200,7 @@ void ABC_get_vertex_cache(const char *filepath, float time, void *verts,
 	IObject mesh_obj;
 	bool found = false;
 
-	find_mesh_object(object, mesh_obj, sub_obj, found);
+	find_mesh_object(object, mesh_obj, object_path, found);
 
 	if (!found) {
 		return;
@@ -221,13 +221,13 @@ void ABC_get_vertex_cache(const char *filepath, float time, void *verts,
 	}
 }
 
-int ABC_check_subobject_valid(const char *name, const char *sub_obj)
+int ABC_check_subobject_valid(const char *filepath, const char *object_path)
 {
-	if ((name[0] == '\0') || (sub_obj[0] == '\0')) {
+	if ((filepath[0] == '\0') || (object_path[0] == '\0')) {
 		return 0;
 	}
 
-	IArchive archive = open_archive(name);
+	IArchive archive = open_archive(filepath);
 
 	if (!archive.valid()) {
 		return 0;
@@ -235,7 +235,7 @@ int ABC_check_subobject_valid(const char *name, const char *sub_obj)
 
 	bool found = false;
 	IObject ob;
-	find_mesh_object(archive.getTop(), ob, sub_obj, found);
+	find_mesh_object(archive.getTop(), ob, object_path, found);
 
 	return (found && ob.valid());
 }
@@ -283,7 +283,7 @@ static void export_endjob(void */*customdata*/)
     BKE_spacedata_draw_locks(false);
 }
 
-int ABC_export(Scene *scene, bContext *C, const char *filename,
+int ABC_export(Scene *scene, bContext *C, const char *filepath,
                double start, double end,
                double xformstep, double geomstep,
                double shutter_open, double shutter_close,
@@ -299,7 +299,7 @@ int ABC_export(Scene *scene, bContext *C, const char *filename,
 {
 	ExportJobData *job = static_cast<ExportJobData *>(MEM_mallocN(sizeof(ExportJobData), "ExportJobData"));
 	job->scene = scene;
-	BLI_strncpy(job->filename, filename, 1024);
+	BLI_strncpy(job->filename, filepath, 1024);
 
 	job->settings.scene = job->scene;
 	job->settings.startframe = start;
@@ -531,12 +531,12 @@ static void import_startjob(void *cjv, short *stop, short *do_update, float *pro
 	WM_main_add_notifier(NC_SCENE | ND_FRAME, data->scene);
 }
 
-void ABC_import(bContext *C, const char *filename, float scale)
+void ABC_import(bContext *C, const char *filepath, float scale)
 {
 	ImportJobData *job = static_cast<ImportJobData *>(MEM_mallocN(sizeof(ImportJobData), "ImportJobData"));
 	job->bmain = CTX_data_main(C);
 	job->scene = CTX_data_scene(C);
-	BLI_strncpy(job->filename, filename, 1024);
+	BLI_strncpy(job->filename, filepath, 1024);
 
 	job->settings.scale = scale;
 
@@ -598,9 +598,9 @@ static IXform get_xform(const IObject &object, const std::string &name, bool &fo
 	return IXform(tmp.getParent(), kWrapExisting);
 }
 
-void ABC_get_transform(Object *ob, const char *filename, const char *object_path, float r_mat[4][4], float time)
+void ABC_get_transform(Object *ob, const char *filepath, const char *object_path, float r_mat[4][4], float time)
 {
-	IArchive archive = open_archive(filename);
+	IArchive archive = open_archive(filepath);
 
 	if (!archive.valid()) {
 		return;




More information about the Bf-blender-cvs mailing list