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:
authorStefan Werner <stefan.werner@tangent-animation.com>2021-08-21 23:03:31 +0300
committerStefan Werner <stefan.werner@tangent-animation.com>2021-08-21 23:03:31 +0300
commitc5b56a525cd6113caa2bd3ec7bfb91fe4a04513a (patch)
tree77dae5ae2fbeccf6703034c94ad3e1f3aa81140b /source/blender/io/usd/intern/usd_reader_nurbs.h
parent34e8d79c3edbc58fd242cec0c1f2bed4e43855af (diff)
parent67c29bc5a273b66e278bd20c18187b425acf1869 (diff)
Merge branch 'master' into cycles_texture_cachecycles_texture_cache
Diffstat (limited to 'source/blender/io/usd/intern/usd_reader_nurbs.h')
-rw-r--r--source/blender/io/usd/intern/usd_reader_nurbs.h61
1 files changed, 61 insertions, 0 deletions
diff --git a/source/blender/io/usd/intern/usd_reader_nurbs.h b/source/blender/io/usd/intern/usd_reader_nurbs.h
new file mode 100644
index 00000000000..33a4acf503e
--- /dev/null
+++ b/source/blender/io/usd/intern/usd_reader_nurbs.h
@@ -0,0 +1,61 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Adapted from the Blender Alembic importer implementation.
+ *
+ * Modifications Copyright (C) 2021 Tangent Animation.
+ * All rights reserved.
+ */
+#pragma once
+
+#include "usd.h"
+#include "usd_reader_geom.h"
+
+#include "pxr/usd/usdGeom/nurbsCurves.h"
+
+struct Curve;
+
+namespace blender::io::usd {
+
+class USDNurbsReader : public USDGeomReader {
+ protected:
+ pxr::UsdGeomNurbsCurves curve_prim_;
+ Curve *curve_;
+
+ public:
+ USDNurbsReader(const pxr::UsdPrim &prim,
+ const USDImportParams &import_params,
+ const ImportSettings &settings)
+ : USDGeomReader(prim, import_params, settings), curve_prim_(prim), curve_(nullptr)
+ {
+ }
+
+ bool valid() const override
+ {
+ return static_cast<bool>(curve_prim_);
+ }
+
+ void create_object(Main *bmain, double motionSampleTime) override;
+ void read_object_data(Main *bmain, double motionSampleTime) override;
+
+ void read_curve_sample(Curve *cu, double motionSampleTime);
+
+ Mesh *read_mesh(struct Mesh *existing_mesh,
+ double motionSampleTime,
+ int read_flag,
+ const char **err_str) override;
+};
+
+} // namespace blender::io::usd