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:
authorSybren A. Stüvel <sybren@stuvel.eu>2019-01-15 18:45:12 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2019-01-16 12:44:39 +0300
commit3ce9bcee70537a52f8d802abfb9e14c34f9a9251 (patch)
tree78f53ec43f4b0bf5859f1564da4cbc269cf628b7 /source/blender/alembic/intern/abc_curves.cc
parent2bb6028d1a64bec0ec83c14483e1d06c802989de (diff)
Alembic export: write curve/NURBS as mesh
It's now possible to export curves and NURBS as mesh data to Alembic. This allows artists to do any crazy thing on curves and export the visual result to Alembic for interoperability with other software (or caching for later use, etc.). It's an often-requested feature. This works around T60503 and the fixes export part of T51311. Note that exporting zero-width curves is currently not supported, as exporting a faceless mesh (e.g. just edges and vertices) is not supported by the mesh writer at all. To test, create a curve with thickness (for example extruded), export to Alembic and check the 'Curves to Mesh' checkbox in the export options. Reviewers: sergey Differential Revision: https://developer.blender.org/D4213
Diffstat (limited to 'source/blender/alembic/intern/abc_curves.cc')
-rw-r--r--source/blender/alembic/intern/abc_curves.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc
index 9501c643e32..67754a1732b 100644
--- a/source/blender/alembic/intern/abc_curves.cc
+++ b/source/blender/alembic/intern/abc_curves.cc
@@ -194,6 +194,27 @@ void AbcCurveWriter::do_write()
m_schema.set(m_sample);
}
+
+AbcCurveMeshWriter::AbcCurveMeshWriter(Object *ob,
+ AbcTransformWriter *parent,
+ uint32_t time_sampling,
+ ExportSettings &settings)
+ : AbcGenericMeshWriter(ob, parent, time_sampling, settings)
+{}
+
+Mesh *AbcCurveMeshWriter::getEvaluatedMesh(Scene * /*scene_eval*/, Object *ob_eval, bool &r_needsfree)
+{
+ if (ob_eval->runtime.mesh_eval != NULL) {
+ /* Mesh_eval only exists when generative modifiers are in use. */
+ r_needsfree = false;
+ return ob_eval->runtime.mesh_eval;
+ }
+
+ r_needsfree = true;
+ return BKE_mesh_new_nomain_from_curve(ob_eval);
+}
+
+
/* ************************************************************************** */
AbcCurveReader::AbcCurveReader(const Alembic::Abc::IObject &object, ImportSettings &settings)