[Bf-blender-cvs] [00c69c9] alembic: Support CD_MTFACE as a dummy layer in Alembic exports.

Lukas Tönne noreply at git.blender.org
Fri Apr 24 17:36:14 CEST 2015


Commit: 00c69c91711e79332906ec8e879eeea86d26a5bf
Author: Lukas Tönne
Date:   Fri Apr 24 13:13:26 2015 +0200
Branches: alembic
https://developer.blender.org/rB00c69c91711e79332906ec8e879eeea86d26a5bf

Support CD_MTFACE as a dummy layer in Alembic exports.

Customdata layers also store some base information, such as "active"
layer for rendering. This information is needed currently for syncing
particle UV and MCol data in cycles, even though the MTFACE layer type
itself is pretty much deprecated.

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

M	source/blender/pointcache/alembic/abc_customdata.cpp
M	source/blender/pointcache/alembic/abc_mesh.cpp

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

diff --git a/source/blender/pointcache/alembic/abc_customdata.cpp b/source/blender/pointcache/alembic/abc_customdata.cpp
index a817372..59723cd 100644
--- a/source/blender/pointcache/alembic/abc_customdata.cpp
+++ b/source/blender/pointcache/alembic/abc_customdata.cpp
@@ -108,6 +108,12 @@ void write_sample<CD_MDEFORMVERT>(CustomDataWriter *writer, OCompoundProperty &p
 }
 
 template <>
+void write_sample<CD_MTFACE>(CustomDataWriter */*writer*/, OCompoundProperty &/*parent*/, const std::string &/*name*/, void */*data*/, int /*num_data*/)
+{
+	/* XXX this is a dummy layer, to have access to active render layers etc. */
+}
+
+template <>
 void write_sample<CD_MCOL>(CustomDataWriter *writer, OCompoundProperty &parent, const std::string &name, void *data, int num_data)
 {
 	OC4fArrayProperty prop = writer->add_array_property<OC4fArrayProperty>(name, parent);
@@ -299,6 +305,13 @@ PTCReadSampleResult read_sample<CD_MDEFORMVERT>(CustomDataReader *reader, ICompo
 }
 
 template <>
+PTCReadSampleResult read_sample<CD_MTFACE>(CustomDataReader */*reader*/, ICompoundProperty &/*parent*/, const ISampleSelector &/*ss*/, const std::string &/*name*/, void */*data*/, int /*num_data*/)
+{
+	/* XXX this is a dummy layer, to have access to active render layers etc. */
+	return PTC_READ_SAMPLE_EXACT;
+}
+
+template <>
 PTCReadSampleResult read_sample<CD_MCOL>(CustomDataReader *reader, ICompoundProperty &parent, const ISampleSelector &ss, const std::string &name, void *data, int num_data)
 {
 	IC4fArrayProperty prop = reader->add_array_property<IC4fArrayProperty>(name, parent);
diff --git a/source/blender/pointcache/alembic/abc_mesh.cpp b/source/blender/pointcache/alembic/abc_mesh.cpp
index d63f0a7..7397b55 100644
--- a/source/blender/pointcache/alembic/abc_mesh.cpp
+++ b/source/blender/pointcache/alembic/abc_mesh.cpp
@@ -43,9 +43,12 @@ using namespace Abc;
 using namespace AbcGeom;
 
 /* CD layers that are stored in generic customdata arrays created with CD_ALLOC */
+/* XXX CD_MASK_MTFACE is deprecated, but currently still needed as a dummy for syncing
+ * particle UV and MCol layers to the mesh shader attributes ...
+ */
 static CustomDataMask CD_MASK_CACHE_EXCLUDE =
         CD_MASK_MVERT | CD_MASK_MEDGE | CD_MASK_MFACE | CD_MASK_MPOLY | CD_MASK_MLOOP |
-        CD_MASK_MTFACE | CD_MASK_MTEXPOLY |
+        /*CD_MASK_MTFACE |*/ CD_MASK_MTEXPOLY |
         CD_MASK_PROP_STR |
         CD_MASK_SHAPEKEY | CD_MASK_SHAPE_KEYINDEX |
         CD_MASK_MDISPS | CD_MASK_CREASE | CD_MASK_BWEIGHT | CD_MASK_RECAST | CD_MASK_PAINT_MASK |




More information about the Bf-blender-cvs mailing list