[Bf-blender-cvs] [be72e44] gooseberry: CD_NORMAL support for mesh customdata caching.
Lukas Tönne
noreply at git.blender.org
Mon Mar 23 13:04:20 CET 2015
Commit: be72e445484beed8f5c32f813011a5ffc43bb7de
Author: Lukas Tönne
Date: Thu Mar 19 14:19:40 2015 +0100
Branches: gooseberry
https://developer.blender.org/rBbe72e445484beed8f5c32f813011a5ffc43bb7de
CD_NORMAL support for mesh customdata caching.
===================================================================
M source/blender/pointcache/alembic/abc_customdata.cpp
===================================================================
diff --git a/source/blender/pointcache/alembic/abc_customdata.cpp b/source/blender/pointcache/alembic/abc_customdata.cpp
index 145e19b..6f60a7f 100644
--- a/source/blender/pointcache/alembic/abc_customdata.cpp
+++ b/source/blender/pointcache/alembic/abc_customdata.cpp
@@ -133,6 +133,14 @@ void write_sample<CD_ORIGINDEX>(CustomDataWriter *writer, OCompoundProperty &par
}
template <>
+void write_sample<CD_NORMAL>(CustomDataWriter *writer, OCompoundProperty &parent, const std::string &name, void *data, int num_data)
+{
+ ON3fArrayProperty prop = writer->add_array_property<ON3fArrayProperty>(name, parent);
+
+ prop.set(ON3fArrayProperty::sample_type((N3f *)data, num_data));
+}
+
+template <>
void write_sample<CD_ORIGSPACE>(CustomDataWriter *writer, OCompoundProperty &parent, const std::string &name, void *data, int num_data)
{
OCompoundProperty prop = writer->add_compound_property<OCompoundProperty>(name, parent);
@@ -258,6 +266,20 @@ PTCReadSampleResult read_sample<CD_ORIGINDEX>(CustomDataReader *reader, ICompoun
}
template <>
+PTCReadSampleResult read_sample<CD_NORMAL>(CustomDataReader *reader, ICompoundProperty &parent, const ISampleSelector &ss, const std::string &name, void *data, int num_data)
+{
+ IN3fArrayProperty prop = reader->add_array_property<IN3fArrayProperty>(name, parent);
+
+ N3fArraySamplePtr sample = prop.getValue(ss);
+
+ if (sample->size() != num_data)
+ return PTC_READ_SAMPLE_INVALID;
+
+ memcpy(data, sample->getData(), sizeof(N3f) * num_data);
+ return PTC_READ_SAMPLE_EXACT;
+}
+
+template <>
PTCReadSampleResult read_sample<CD_ORIGSPACE>(CustomDataReader *reader, ICompoundProperty &parent, const ISampleSelector &ss, const std::string &name, void *data, int num_data)
{
ICompoundProperty prop = reader->add_compound_property<ICompoundProperty>(name, parent);
More information about the Bf-blender-cvs
mailing list