Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2021-09-25 10:30:12 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-09-25 10:31:00 +0300
commit505422220d6e172fddc8a40fabee47f5d35e0c7d (patch)
tree4e877ff42f81bc482fe19fcf9156db850180431b /source/blender/io/alembic/intern/abc_reader_nurbs.cc
parent43394e41a8e0a866631bc7fdf07ac50e9d7094e4 (diff)
Cleanup: use override/final for derived classes.
This will help detecting missing API changes. Those keywords were added on classes which did not already use them. Also added missing `accepts_object_type()` on NURBS reader.
Diffstat (limited to 'source/blender/io/alembic/intern/abc_reader_nurbs.cc')
-rw-r--r--source/blender/io/alembic/intern/abc_reader_nurbs.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/io/alembic/intern/abc_reader_nurbs.cc b/source/blender/io/alembic/intern/abc_reader_nurbs.cc
index 25567aa8c24..4492d1e1ca0 100644
--- a/source/blender/io/alembic/intern/abc_reader_nurbs.cc
+++ b/source/blender/io/alembic/intern/abc_reader_nurbs.cc
@@ -71,6 +71,26 @@ bool AbcNurbsReader::valid() const
return true;
}
+bool AbcNurbsReader::accepts_object_type(
+ const Alembic::AbcCoreAbstract::v12::ObjectHeader &alembic_header,
+ const Object *const ob,
+ const char **err_str) const
+{
+ if (!Alembic::AbcGeom::INuPatch::matches(alembic_header)) {
+ *err_str =
+ "Object type mismatch, Alembic object path pointed to NURBS when importing, but not any "
+ "more.";
+ return false;
+ }
+
+ if (ob->type != OB_CURVE) {
+ *err_str = "Object type mismatch, Alembic object path points to NURBS.";
+ return false;
+ }
+
+ return true;
+}
+
static bool set_knots(const FloatArraySamplePtr &knots, float *&nu_knots)
{
if (!knots || knots->size() < 2) {