[Bf-blender-cvs] [6c3db47] alembic_basic_io: Fix crash constructing depsgraph with missing objects.

Kévin Dietrich noreply at git.blender.org
Wed Jul 13 15:01:25 CEST 2016


Commit: 6c3db47c0d05fdd0830523650355d3c7ec78bd59
Author: Kévin Dietrich
Date:   Wed Jul 13 04:40:19 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB6c3db47c0d05fdd0830523650355d3c7ec78bd59

Fix crash constructing depsgraph with missing objects.

Wait till all of the objects present in the Alembic archive are created
and parentship set before updating the scene and its depsgraph.

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

M	source/blender/alembic/intern/abc_curves.cc
M	source/blender/alembic/intern/abc_mesh.cc
M	source/blender/alembic/intern/abc_object.cc
M	source/blender/alembic/intern/abc_object.h
M	source/blender/alembic/intern/abc_points.cc
M	source/blender/alembic/intern/alembic_capi.cc

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

diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc
index 960712f..c17c279 100644
--- a/source/blender/alembic/intern/abc_curves.cc
+++ b/source/blender/alembic/intern/abc_curves.cc
@@ -209,7 +209,7 @@ void AbcCurveReader::readObjectData(Main *bmain, Scene *scene, float time)
 	read_curve_sample(cu, m_curves_schema, time);
 
 	if (m_settings->is_sequence || !m_curves_schema.isConstant()) {
-		addDefaultModifier(bmain);
+		addDefaultModifier();
 	}
 }
 
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index 401c1de..016cc31 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -924,7 +924,7 @@ void AbcMeshReader::readObjectData(Main *bmain, Scene *scene, float time)
 	}
 
 	if (!is_constant) {
-		addDefaultModifier(bmain);
+		addDefaultModifier();
 	}
 }
 
diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc
index ad275ba..bf92172 100644
--- a/source/blender/alembic/intern/abc_object.cc
+++ b/source/blender/alembic/intern/abc_object.cc
@@ -214,7 +214,7 @@ void AbcObjectReader::readObjectMatrix(const float time)
 	}
 }
 
-void AbcObjectReader::addDefaultModifier(Main *bmain) const
+void AbcObjectReader::addDefaultModifier() const
 {
 	ModifierData *md = modifier_new(eModifierType_MeshSequenceCache);
 	BLI_addtail(&m_object->modifiers, md);
@@ -225,9 +225,6 @@ void AbcObjectReader::addDefaultModifier(Main *bmain) const
 	id_us_plus(&mcmd->cache_file->id);
 
 	BLI_strncpy(mcmd->abc_object_path, m_iobject.getFullName().c_str(), FILE_MAX);
-
-	DAG_id_tag_update(&m_object->id, OB_RECALC_DATA);
-	DAG_relations_tag_update(bmain);
 }
 
 chrono_t AbcObjectReader::minTime() const
diff --git a/source/blender/alembic/intern/abc_object.h b/source/blender/alembic/intern/abc_object.h
index e53a415..ac2fbf8 100644
--- a/source/blender/alembic/intern/abc_object.h
+++ b/source/blender/alembic/intern/abc_object.h
@@ -126,7 +126,7 @@ public:
 
 	void readObjectMatrix(const float time);
 
-	void addDefaultModifier(Main *bmain) const;
+	void addDefaultModifier() const;
 
 	chrono_t minTime() const;
 	chrono_t maxTime() const;
diff --git a/source/blender/alembic/intern/abc_points.cc b/source/blender/alembic/intern/abc_points.cc
index 690305d..ca58bd8 100644
--- a/source/blender/alembic/intern/abc_points.cc
+++ b/source/blender/alembic/intern/abc_points.cc
@@ -179,6 +179,6 @@ void AbcPointsReader::readObjectData(Main *bmain, Scene *scene, float time)
 	m_object->data = mesh;
 
 	if (m_settings->is_sequence || !m_schema.isConstant()) {
-		addDefaultModifier(bmain);
+		addDefaultModifier();
 	}
 }
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index 70a129e..91e5deb 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -693,10 +693,6 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
 			if (parent != NULL && reader->object() != parent) {
 				Object *ob = reader->object();
 				ob->parent = parent;
-
-				DAG_id_tag_update(&ob->id, OB_RECALC_OB);
-				DAG_relations_tag_update(data->bmain);
-				WM_main_add_notifier(NC_OBJECT | ND_PARENT, ob);
 			}
 		}
 
@@ -706,6 +702,8 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
 			return;
 		}
 	}
+
+	DAG_relations_tag_update(data->bmain);
 }
 
 static void import_endjob(void *user_data)




More information about the Bf-blender-cvs mailing list