diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-01-15 18:45:12 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2019-01-16 12:44:39 +0300 |
commit | 3ce9bcee70537a52f8d802abfb9e14c34f9a9251 (patch) | |
tree | 78f53ec43f4b0bf5859f1564da4cbc269cf628b7 /source/blender/editors/io/io_alembic.c | |
parent | 2bb6028d1a64bec0ec83c14483e1d06c802989de (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/editors/io/io_alembic.c')
-rw-r--r-- | source/blender/editors/io/io_alembic.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c index 38e0ec0cb3a..cbfb816d12a 100644 --- a/source/blender/editors/io/io_alembic.c +++ b/source/blender/editors/io/io_alembic.c @@ -130,6 +130,7 @@ static int wm_alembic_export_exec(bContext *C, wmOperator *op) .normals = RNA_boolean_get(op->ptr, "normals"), .vcolors = RNA_boolean_get(op->ptr, "vcolors"), .apply_subdiv = RNA_boolean_get(op->ptr, "apply_subdiv"), + .curves_as_mesh = RNA_boolean_get(op->ptr, "curves_as_mesh"), .flatten_hierarchy = RNA_boolean_get(op->ptr, "flatten"), .visible_layers_only = RNA_boolean_get(op->ptr, "visible_layers_only"), .renderable_only = RNA_boolean_get(op->ptr, "renderable_only"), @@ -246,6 +247,9 @@ static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr) uiItemR(row, imfptr, "apply_subdiv", 0, NULL, ICON_NONE); row = uiLayoutRow(box, false); + uiItemR(row, imfptr, "curves_as_mesh", 0, NULL, ICON_NONE); + + row = uiLayoutRow(box, false); uiItemR(row, imfptr, "triangulate", 0, NULL, ICON_NONE); const bool triangulate = RNA_boolean_get(imfptr, "triangulate"); @@ -373,6 +377,9 @@ void WM_OT_alembic_export(wmOperatorType *ot) RNA_def_boolean(ot->srna, "apply_subdiv", 0, "Apply Subsurf", "Export subdivision surfaces as meshes"); + RNA_def_boolean(ot->srna, "curves_as_mesh", false, + "Curves as Mesh", "Export curves and NURBS surfaces as meshes"); + RNA_def_enum(ot->srna, "compression_type", rna_enum_abc_compression_items, ABC_ARCHIVE_OGAWA, "Compression", ""); |