[Bf-blender-cvs] [00e0a94b3c9] master: Alembic: import empties under their own name in Alembic, not their parent's
Sybren A. Stüvel
noreply at git.blender.org
Thu Apr 6 16:51:50 CEST 2017
Commit: 00e0a94b3c96f8971dbd1a933856d2735a83b219
Author: Sybren A. Stüvel
Date: Wed Feb 15 15:32:15 2017 +0100
Branches: master
https://developer.blender.org/rB00e0a94b3c96f8971dbd1a933856d2735a83b219
Alembic: import empties under their own name in Alembic, not their parent's
Before this commit something strange happened, as the m_data_name of
an inherit data-less object was used.
===================================================================
M source/blender/alembic/intern/abc_transform.cc
===================================================================
diff --git a/source/blender/alembic/intern/abc_transform.cc b/source/blender/alembic/intern/abc_transform.cc
index 99bf7de93f7..5f807e2eb46 100644
--- a/source/blender/alembic/intern/abc_transform.cc
+++ b/source/blender/alembic/intern/abc_transform.cc
@@ -132,6 +132,10 @@ bool AbcTransformWriter::hasAnimation(Object * /*ob*/) const
AbcEmptyReader::AbcEmptyReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
: AbcObjectReader(object, settings)
{
+ /* Empties have no data. It makes the import of Alembic files easier to
+ * understand when we name the empty after its name in Alembic. */
+ m_object_name = object.getName();
+
Alembic::AbcGeom::IXform xform(object, Alembic::AbcGeom::kWrapExisting);
m_schema = xform.getSchema();
@@ -145,6 +149,7 @@ bool AbcEmptyReader::valid() const
void AbcEmptyReader::readObjectData(Main *bmain, float /*time*/)
{
- m_object = BKE_object_add_only_object(bmain, OB_EMPTY, m_data_name.c_str());
+ const char *empty_name = m_iobject.getName().c_str();
+ m_object = BKE_object_add_only_object(bmain, OB_EMPTY, empty_name);
m_object->data = NULL;
}
More information about the Bf-blender-cvs
mailing list