[Bf-blender-cvs] [87dcbfd000] temp-sybren-alembic: Alembic: Renamed parent_map to reader_map

Sybren A. Stüvel noreply at git.blender.org
Fri Feb 24 17:06:07 CET 2017


Commit: 87dcbfd00060fe71e3eba3a5987c87cfb3104d3c
Author: Sybren A. Stüvel
Date:   Thu Feb 23 10:12:34 2017 +0100
Branches: temp-sybren-alembic
https://developer.blender.org/rB87dcbfd00060fe71e3eba3a5987c87cfb3104d3c

Alembic: Renamed parent_map to reader_map

It's a mapping from full path of an Alembic object to an AbcObjectReader*.
The fact that at some point it is used to construct parent-child relations
doesn't matter.

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

M	source/blender/alembic/intern/alembic_capi.cc

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

diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index c9f4376316..b95c0b2249 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -378,7 +378,7 @@ void ABC_export(
 
 static int visit_object(const IObject &object,
                          std::vector<AbcObjectReader *> &readers,
-                         GHash *parent_map,
+                         GHash *readers_map,
                          ImportSettings &settings)
 {
 	if (!object.valid()) {
@@ -393,7 +393,7 @@ static int visit_object(const IObject &object,
 	size_t num_children = object.getNumChildren();
 	BLI_assert((int)true == 1);
 	for (size_t i = 0; i < num_children; ++i) {
-		bool child_claims_this_object = visit_object(object.getChild(i), readers, parent_map, settings);
+		bool child_claims_this_object = visit_object(object.getChild(i), readers, readers_map, settings);
 		children_claiming_this_object += child_claims_this_object;  // using (int)true == 1
 	}
 
@@ -528,7 +528,7 @@ static int visit_object(const IObject &object,
 		/* Cast to `void *` explicitly to avoid compiler errors because it
 		 * is a `const char *` which the compiler cast to `const void *`
 		 * instead of the expected `void *`. */
-		BLI_ghash_insert(parent_map, (void *)object.getFullName().c_str(), reader);
+		BLI_ghash_insert(readers_map, (void *)object.getFullName().c_str(), reader);
 	}
 
 	return parent_is_part_of_this_object;
@@ -546,7 +546,7 @@ struct ImportJobData {
 	char filename[1024];
 	ImportSettings settings;
 
-	GHash *parent_map;
+	GHash *reader_map;
 	std::vector<AbcObjectReader *> readers;
 
 	short *stop;
@@ -621,10 +621,10 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
 	*data->do_update = true;
 	*data->progress = 0.05f;
 
-	data->parent_map = BLI_ghash_str_new("alembic parent ghash");
+	data->reader_map = BLI_ghash_str_new("alembic parent ghash");
 
 	/* Parse Alembic Archive. */
-	visit_object(archive->getTop(), data->readers, data->parent_map, data->settings);
+	visit_object(archive->getTop(), data->readers, data->reader_map, data->settings);
 
 	if (G.is_break) {
 		data->was_cancelled = true;
@@ -696,7 +696,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
 
 		while (alembic_parent) {
 			parent_reader = reinterpret_cast<AbcObjectReader *>(
-			                    BLI_ghash_lookup(data->parent_map, alembic_parent.getFullName().c_str()));
+			                    BLI_ghash_lookup(data->reader_map, alembic_parent.getFullName().c_str()));
 			if (parent_reader != NULL) {
 				break;  // found the parent reader.
 			}
@@ -767,8 +767,8 @@ static void import_endjob(void *user_data)
 		}
 	}
 
-	if (data->parent_map) {
-		BLI_ghash_free(data->parent_map, NULL, NULL);
+	if (data->reader_map) {
+		BLI_ghash_free(data->reader_map, NULL, NULL);
 	}
 
 	switch (data->error_code) {
@@ -804,7 +804,7 @@ void ABC_import(bContext *C, const char *filepath, float scale, bool is_sequence
 	job->settings.sequence_len = sequence_len;
 	job->settings.offset = offset;
 	job->settings.validate_meshes = validate_meshes;
-	job->parent_map = NULL;
+	job->reader_map = NULL;
 	job->error_code = ABC_NO_ERROR;
 	job->was_cancelled = false;




More information about the Bf-blender-cvs mailing list