[Bf-blender-cvs] [00f5f18] alembic_basic_io: Cleanup.
Kévin Dietrich
noreply at git.blender.org
Fri Jul 1 14:59:29 CEST 2016
Commit: 00f5f182ad521cae57bec6673aaf28891dcf5cba
Author: Kévin Dietrich
Date: Fri Jul 1 14:49:46 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB00f5f182ad521cae57bec6673aaf28891dcf5cba
Cleanup.
===================================================================
M source/blender/alembic/intern/abc_curves.cc
M source/blender/alembic/intern/abc_customdata.cc
M source/blender/alembic/intern/abc_exporter.cc
M source/blender/alembic/intern/abc_mesh.cc
M source/blender/alembic/intern/abc_nurbs.cc
M source/blender/alembic/intern/abc_transform.cc
M source/blender/alembic/intern/abc_util.h
===================================================================
diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc
index 2906310..93bdbb4 100644
--- a/source/blender/alembic/intern/abc_curves.cc
+++ b/source/blender/alembic/intern/abc_curves.cc
@@ -116,7 +116,7 @@ void AbcCurveWriter::do_write()
const BezTriple *bezier = nurbs->bezt;
- /* TODO: how does Alembic store info about handles, if applicable? */
+ /* TODO(kevin): store info about handles, Alembic doesn't have this. */
for (int i = 0; i < totpoint; ++i, ++bezier) {
copy_zup_yup(temp_vert.getValue(), bezier->vec[1]);
verts.push_back(temp_vert);
diff --git a/source/blender/alembic/intern/abc_customdata.cc b/source/blender/alembic/intern/abc_customdata.cc
index 8891920..684fae7 100644
--- a/source/blender/alembic/intern/abc_customdata.cc
+++ b/source/blender/alembic/intern/abc_customdata.cc
@@ -145,7 +145,7 @@ static void write_uv(const OCompoundProperty &prop, const CDStreamConfig &config
* - C3fGeomParam/C4fGeomParam on the arbGeomParam
* - set scope as face varying
*
- * TODO: check scope.
+ * TODO(kevin): check scope.
*/
static void write_mcol(const OCompoundProperty &prop, const CDStreamConfig &config, void *data, const char *name)
{
@@ -363,18 +363,8 @@ void read_custom_data(const ICompoundProperty &prop, const CDStreamConfig &confi
continue;
}
- /* TODO: check convention on vertex colors. */
- if (IC3fGeomParam::matches(prop_header)) {
- if (++num_colors > MAX_MCOL) {
- continue;
- }
-
- read_custom_data_ex(prop, prop_header, config, iss, CD_MLOOPCOL);
- continue;
- }
-
- /* TODO: check convention on vertex colors. */
- if (IC4fGeomParam::matches(prop_header)) {
+ /* Read vertex colors according to convention. */
+ if (IC3fGeomParam::matches(prop_header) || IC4fGeomParam::matches(prop_header)) {
if (++num_colors > MAX_MCOL) {
continue;
}
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index 8680450..1c49062 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -259,7 +259,8 @@ void AbcExporter::operator()(Main *bmain, float &progress, bool &was_canceled)
else
#endif
m_archive = Alembic::Abc::CreateArchiveWithInfo(Alembic::AbcCoreOgawa::WriteArchive(),
- m_filename, "Blender",
+ m_filename,
+ "Blender",
scene_name,
Alembic::Abc::ErrorHandler::kThrowPolicy,
arg);
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index abb289c..65b2eec 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -896,12 +896,7 @@ void AbcMeshReader::readObjectData(Main *bmain, Scene *scene, float time)
m_object = BKE_object_add(bmain, scene, OB_MESH, m_object_name.c_str());
m_object->data = mesh;
- /* TODO: expose this as a setting to the user? */
- const bool assign_mat = true;
-
- if (assign_mat) {
- readFaceSetsSample(bmain, mesh, poly_start, sample_sel);
- }
+ readFaceSetsSample(bmain, mesh, poly_start, sample_sel);
if (m_subd_schema.valid()) {
const ISubDSchema::Sample sample = m_subd_schema.getValue(sample_sel);
diff --git a/source/blender/alembic/intern/abc_nurbs.cc b/source/blender/alembic/intern/abc_nurbs.cc
index 211038b..bc82c20 100644
--- a/source/blender/alembic/intern/abc_nurbs.cc
+++ b/source/blender/alembic/intern/abc_nurbs.cc
@@ -71,7 +71,7 @@ AbcNurbsWriter::AbcNurbsWriter(Scene *scene,
/* if the object is static, use the default static time sampling */
if (!m_is_animated) {
- time_sampling = 0;
+ m_time_sampling = 0;
}
Curve *curve = static_cast<Curve *>(m_object->data);
@@ -94,7 +94,7 @@ bool AbcNurbsWriter::isAnimated() const
{
/* check if object has shape keys */
Curve *cu = static_cast<Curve *>(m_object->data);
- return (cu->key != NULL);
+ return (cu->key != NULL);cu->adt;
}
static void get_knots(std::vector<float> &knots, const int num_knots, float *nu_knots)
@@ -120,8 +120,9 @@ static void get_knots(std::vector<float> &knots, const int num_knots, float *nu_
void AbcNurbsWriter::do_write()
{
/* we have already stored a sample for this object. */
- if (!m_first_frame && !m_is_animated)
+ if (!m_first_frame && !m_is_animated) {
return;
+ }
if (!ELEM(m_object->type, OB_SURF, OB_CURVE)) {
return;
diff --git a/source/blender/alembic/intern/abc_transform.cc b/source/blender/alembic/intern/abc_transform.cc
index 26bf545..912ff36 100644
--- a/source/blender/alembic/intern/abc_transform.cc
+++ b/source/blender/alembic/intern/abc_transform.cc
@@ -125,7 +125,7 @@ Imath::Box3d AbcTransformWriter::bounds()
bool AbcTransformWriter::hasAnimation(Object */*ob*/) const
{
- /* TODO: implement this */
+ /* TODO(kevin): implement this. */
return true;
}
@@ -134,12 +134,15 @@ bool AbcTransformWriter::hasAnimation(Object */*ob*/) const
AbcEmptyReader::AbcEmptyReader(const Alembic::Abc::IObject &object, ImportSettings &settings)
: AbcObjectReader(object, settings)
{
+ Alembic::AbcGeom::IXform xform(object, Alembic::AbcGeom::kWrapExisting);
+ m_schema = xform.getSchema();
+
get_min_max_time(m_schema, m_min_time, m_max_time);
}
bool AbcEmptyReader::valid() const
{
- return true; // TODO? m_schema.valid();
+ return m_schema.valid();
}
void AbcEmptyReader::readObjectData(Main *bmain, Scene *scene, float /*time*/)
diff --git a/source/blender/alembic/intern/abc_util.h b/source/blender/alembic/intern/abc_util.h
index f67beae..4cc91b5 100644
--- a/source/blender/alembic/intern/abc_util.h
+++ b/source/blender/alembic/intern/abc_util.h
@@ -76,9 +76,6 @@ bool has_property(const Alembic::Abc::ICompoundProperty &prop, const std::string
/* ************************** */
-/* TODO: this duplicates MINLINE from BLI_math, but then need to keep things
- * separate somewhat. */
-
#ifdef _MSC_VER
# define ABC_INLINE static __forceinline
#else
More information about the Bf-blender-cvs
mailing list