[Bf-blender-cvs] [12a0379] alembic_basic_io: Remove mesh cache implementation of Alembic.

Kévin Dietrich noreply at git.blender.org
Thu Jun 30 01:19:58 CEST 2016


Commit: 12a037965b66af9ebb6ae39bfe83c08ccf688954
Author: Kévin Dietrich
Date:   Tue Jun 28 01:55:41 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB12a037965b66af9ebb6ae39bfe83c08ccf688954

Remove mesh cache implementation of Alembic.

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

M	source/blender/alembic/ABC_alembic.h
M	source/blender/alembic/intern/alembic_capi.cc
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/CMakeLists.txt
M	source/blender/modifiers/intern/MOD_meshcache.c
D	source/blender/modifiers/intern/MOD_meshcache_abc.c
M	source/blender/modifiers/intern/MOD_meshcache_util.h

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

diff --git a/source/blender/alembic/ABC_alembic.h b/source/blender/alembic/ABC_alembic.h
index adf86b9..4d90207 100644
--- a/source/blender/alembic/ABC_alembic.h
+++ b/source/blender/alembic/ABC_alembic.h
@@ -73,16 +73,6 @@ void ABC_import(struct bContext *C,
                 int sequence_len,
                 int offset);
 
-void ABC_get_vertex_cache(const char *filepath,
-                          float time,
-                          void *verts,
-                          int max_verts,
-                          const char *object_path,
-                          int is_mvert);
-
-bool ABC_check_subobject_valid(const char *filename,
-                               const char *object_path);
-
 AbcArchiveHandle *ABC_create_handle(const char *filename);
 
 void ABC_free_handle(AbcArchiveHandle *handle);
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index 37158e0..3353234 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -155,50 +155,6 @@ int ABC_get_version()
 	return ALEMBIC_LIBRARY_VERSION;
 }
 
-static size_t update_points(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()) {
-		return vtx_start;
-	}
-
-	IPolyMeshSchema::Sample smp = schema.first.getValue(sample_sel);
-	P3fArraySamplePtr positions = smp.getPositions();
-
-	const size_t vertex_count = positions->size();
-
-	/* don't overflow the buffer! */
-	if (max_verts > 0) {
-		if ((vtx_start + vertex_count) > max_verts)
-			return vtx_start;
-	}
-
-	if (verts) {
-		int j = vtx_start;
-		for (int i = 0; i < vertex_count; ++i, ++j) {
-			Imath::V3f pos_in = (*positions)[i];
-
-			verts[j].co[0] = pos_in[0];
-			verts[j].co[1] = pos_in[1];
-			verts[j].co[2] = pos_in[2];
-		}
-	}
-	else if (vcos) {
-		int j = vtx_start;
-		for (int i = 0; i < vertex_count; ++i, ++j) {
-			Imath::V3f pos_in = (*positions)[i];
-
-			vcos[j][0] = pos_in[0];
-			vcos[j][1] = pos_in[1];
-			vcos[j][2] = pos_in[2];
-		}
-	}
-
-	return vtx_start + vertex_count;
-}
-
 static void find_iobject(const IObject &object, IObject &ret,
                          const std::string &path)
 {
@@ -220,63 +176,6 @@ static void find_iobject(const IObject &object, IObject &ret,
 	ret = tmp;
 }
 
-void ABC_get_vertex_cache(const char *filepath, float time, void *verts,
-                          int max_verts, const char *object_path, int is_mverts)
-{
-	IArchive *archive = open_archive(filepath);
-
-	if (!archive || !archive->valid()) {
-		return;
-	}
-
-	IObject top = archive->getTop();
-
-	if (!top.valid()) {
-		return;
-	}
-
-	IObject iobject;
-	find_iobject(top, iobject, object_path);
-
-	if (!IPolyMesh::matches(iobject.getHeader())) {
-		return;
-	}
-
-	IPolyMesh mesh(iobject, kWrapExisting);
-	IPolyMeshSchema schema = mesh.getSchema();
-	ISampleSelector sample_sel(time);
-
-	if (is_mverts) {
-		update_points(std::pair<IPolyMeshSchema, IObject>(schema, iobject),
-		              sample_sel, static_cast<MVert *>(verts), 0, max_verts, NULL);
-	}
-	else {
-		float (*vcos)[3] = static_cast<float (*)[3]>(verts);
-		update_points(std::pair<IPolyMeshSchema, IObject>(schema, iobject),
-		              sample_sel, NULL, 0, max_verts, vcos);
-	}
-
-	/* TODO. */
-	delete archive;
-}
-
-bool ABC_check_subobject_valid(const char *filename, const char *object_path)
-{
-	IArchive *archive = open_archive(filename);
-
-	if (!archive || !archive->valid()) {
-		return false;
-	}
-
-	IObject ob;
-	find_iobject(archive->getTop(), ob, object_path);
-
-	/* TODO. */
-	delete archive;
-
-	return (ob.valid());
-}
-
 struct ExportJobData {
 	Scene *scene;
 	Main *bmain;
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 747978f..5b67524 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -1400,13 +1400,11 @@ typedef struct MeshCacheModifierData {
 	float eval_factor;
 
 	char filepath[1024];  /* FILE_MAX */
-	char sub_object[1024];  /* Alembic sub object */
 } MeshCacheModifierData;
 
 enum {
 	MOD_MESHCACHE_TYPE_MDD  = 1,
 	MOD_MESHCACHE_TYPE_PC2  = 2,
-	MOD_MESHCACHE_TYPE_ABC  = 3,
 };
 
 enum {
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 9b41fce..65366b1 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -4089,9 +4089,6 @@ static void rna_def_modifier_meshcache(BlenderRNA *brna)
 	static EnumPropertyItem prop_format_type_items[] = {
 		{MOD_MESHCACHE_TYPE_MDD, "MDD", 0, "MDD ", ""},
 		{MOD_MESHCACHE_TYPE_PC2, "PC2", 0, "PC2", ""},
-#ifdef WITH_ALEMBIC
-		{MOD_MESHCACHE_TYPE_ABC, "ABC", 0, "Alembic", ""},
-#endif
 		{0, NULL, 0, NULL, NULL}
 	};
 
@@ -4170,10 +4167,6 @@ static void rna_def_modifier_meshcache(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "File Path", "Path to external displacements file");
 	RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
-	prop = RNA_def_property(srna, "sub_object", PROP_STRING, PROP_NONE);
-	RNA_def_property_ui_text(prop, "Object", "Path to the object in the Alembic archive");
-	RNA_def_property_update(prop, 0, "rna_Modifier_update");
-
 	prop = RNA_def_property(srna, "factor", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "factor");
 	RNA_def_property_range(prop, 0.0f, 1.0f);
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index e560315..86e7b94 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -70,7 +70,6 @@ set(SRC
 	intern/MOD_lattice.c
 	intern/MOD_mask.c
 	intern/MOD_meshcache.c
-	intern/MOD_meshcache_abc.c
 	intern/MOD_meshcache_mdd.c
 	intern/MOD_meshcache_pc2.c
 	intern/MOD_meshcache_util.c
diff --git a/source/blender/modifiers/intern/MOD_meshcache.c b/source/blender/modifiers/intern/MOD_meshcache.c
index e3bbbb9..aa3e3eb 100644
--- a/source/blender/modifiers/intern/MOD_meshcache.c
+++ b/source/blender/modifiers/intern/MOD_meshcache.c
@@ -48,10 +48,6 @@
 
 #include "MOD_modifiertypes.h"
 
-#ifdef WITH_ALEMBIC
-#	include "ABC_alembic.h"
-#endif
-
 static void initData(ModifierData *md)
 {
 	MeshCacheModifierData *mcmd = (MeshCacheModifierData *)md;
@@ -88,13 +84,7 @@ static bool isDisabled(ModifierData *md, int UNUSED(useRenderParams))
 	MeshCacheModifierData *mcmd = (MeshCacheModifierData *) md;
 
 	/* leave it up to the modifier to check the file is valid on calculation */
-	bool is_disabled = (mcmd->factor <= 0.0f) || (mcmd->filepath[0] == '\0');
-
-	if (mcmd->type == MOD_MESHCACHE_TYPE_ABC) {
-		is_disabled |= (mcmd->sub_object[0] == '\0');
-	}
-
-	return is_disabled;
+	return (mcmd->factor <= 0.0f) || (mcmd->filepath[0] == '\0');
 }
 
 
@@ -182,10 +172,6 @@ static void meshcache_do(
 			ok = MOD_meshcache_read_pc2_times(filepath, vertexCos, numVerts,
 			                                  mcmd->interp, time, fps, mcmd->time_mode, &err_str);
 			break;
-		case MOD_MESHCACHE_TYPE_ABC:
-			ok = MOD_meshcache_read_abc_times(filepath, mcmd->sub_object, vertexCos, numVerts,
-			                                  mcmd->interp, time, fps, mcmd->time_mode, &err_str);
-			break;
 		default:
 			ok = false;
 			break;
diff --git a/source/blender/modifiers/intern/MOD_meshcache_abc.c b/source/blender/modifiers/intern/MOD_meshcache_abc.c
deleted file mode 100644
index b3e7cec..0000000
--- a/source/blender/modifiers/intern/MOD_meshcache_abc.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Contributor(s): Kevin Dietrich
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/modifiers/intern/MOD_meshcache_abc.c
- *  \ingroup modifiers
- */
-
-#include <stdio.h>  /* needed for forward declaration of FILE */
-
-#include "DNA_modifier_types.h"
-
-#include "BLI_utildefines.h"
-
-#include "MOD_meshcache_util.h"
-
-#include "ABC_alembic.h"
-
-bool MOD_meshcache_read_abc_index(const char *filepath, const char *sub_object,
-                                  float (*vertexCos)[3], const int verts_tot,
-                                  const int index, const float factor,
-                                  const char **err_str)
-{
-#ifdef WITH_ALEMBIC
-    ABC_get_vertex_cache(filepath, factor, vertexCos, verts_tot, sub_object, 0);
-#else
-	UNUSED_VARS(filepath, factor, vertexCos, verts_tot, sub_object);
-#endif
-
-	UNUSED_VARS(index, err_str);
-
-	return true;
-}
-
-bool MOD_meshcache_read_abc_frame(const char *filepath, const char *sub_object,
-                                  float (*vertexCos)[3], const int verts_tot, const char interp,
-                                  const float frame,
-                                  const char **err_str)
-{
-	return MOD_meshcache_read_abc_index(filepath, sub_object, vertexCos, verts_tot, interp, frame, err_str);
-}
-
-bool MOD_meshcache_read_abc_times(const char *filepath, const char *sub_object,
-                                  float (*vertexCos)[3], const int verts_tot, const char interp,
-                                  const float time, const float fps, const char time_mode,
-                                  const char **err_str)
-{
-#ifdef WITH_ALEMBIC
-	if (!ABC_check_subobject_vali

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list