[Bf-blender-cvs] [9bf69ab3c1] temp-sybren-alembic: Alembic import: don't crash on instances

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


Commit: 9bf69ab3c1ac77ce3cb4fd6090b6e8ff722de64d
Author: Sybren A. Stüvel
Date:   Thu Feb 23 15:56:11 2017 +0100
Branches: temp-sybren-alembic
https://developer.blender.org/rB9bf69ab3c1ac77ce3cb4fd6090b6e8ff722de64d

Alembic import: don't crash on instances

Importing instances (i.e. Alembic objects that reference instance
sources rather than contain data for themselves) isn't supported yet, but
with this change at least it doesn't crash Blender.

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

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 d542c530c3..f773b4a770 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -376,7 +376,7 @@ void ABC_export(
 
 /* ********************** Import file ********************** */
 
-static int visit_object(const IObject &object,
+static int visit_object(IObject object,
                          std::vector<AbcObjectReader *> &readers,
                          GHash *readers_map,
                          ImportSettings &settings)
@@ -515,6 +515,17 @@ static int visit_object(const IObject &object,
 
 //	std::cerr << std::endl;
 
+	if (object.isInstanceRoot()) {
+		std::cerr << "Alembic object " << full_name
+		          << " is an instance of other object "
+		          << object.instanceSourcePath()
+		          << ", ignoring for now." << std::endl;
+		if (reader) {
+			delete reader;
+			reader = NULL;
+		}
+	}
+
 	if (reader) {
 		readers.push_back(reader);
 		reader->incref();




More information about the Bf-blender-cvs mailing list