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@blender.org>2020-09-08 17:15:49 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-09-08 17:41:59 +0300
commitb3759cc0d67eeb8cec55314d3304db0bc02168af (patch)
tree83903d61963f58e93702bced40d23b27050381ad /source/blender/editors/io
parent8f4f9275cea6602e74eecf7e9a88c101f9cc5245 (diff)
Alembic Export: support instanced object data
Add support for object data instancing. This is used when the objects are instances, for example when duplicated by a particle system, or instanced by the duplication system (collection-duplicating empties, vertex/face duplis, etc.) Since Alembic already deduplicates data, this doesn't make the resulting Alembic files any smaller. They will be faster to write, though, when there is a lot of instanced geometry, as the deduplication system won't have to do any comparisons. This instancing support is still limited, in the sense that only object data is instanced and all transforms are still written explicitly. A future improvement could be to support instancing entire collection hierarchies. Blender's Alembic importer has no understanding of these Alembic instances yet, and will thus happily duplicate the data on import. The USD Alembic plugin seems to have problems understanding the instancing. There might also be other software with similar issues. Because of this, instancing can be turned off in the exporter (it's on by default).
Diffstat (limited to 'source/blender/editors/io')
-rw-r--r--source/blender/editors/io/io_alembic.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c
index 22171d8be66..0c4064b5693 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -133,6 +133,7 @@ static int wm_alembic_export_exec(bContext *C, wmOperator *op)
.use_subdiv_schema = RNA_boolean_get(op->ptr, "subdiv_schema"),
.export_hair = RNA_boolean_get(op->ptr, "export_hair"),
.export_particles = RNA_boolean_get(op->ptr, "export_particles"),
+ .use_instancing = RNA_boolean_get(op->ptr, "use_instancing"),
.packuv = RNA_boolean_get(op->ptr, "packuv"),
.triangulate = RNA_boolean_get(op->ptr, "triangulate"),
.quad_method = RNA_enum_get(op->ptr, "quad_method"),
@@ -189,6 +190,7 @@ static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr)
uiItemS(col);
uiItemR(col, imfptr, "flatten", 0, NULL, ICON_NONE);
+ uiItemR(sub, imfptr, "use_instancing", 0, IFACE_("Use Instancing"), ICON_NONE);
sub = uiLayoutColumnWithHeading(col, true, IFACE_("Only"));
uiItemR(sub, imfptr, "selected", 0, IFACE_("Selected Objects"), ICON_NONE);
uiItemR(sub, imfptr, "renderable_only", 0, IFACE_("Renderable Objects"), ICON_NONE);
@@ -401,6 +403,13 @@ void WM_OT_alembic_export(wmOperatorType *ot)
"Curves as Mesh",
"Export curves and NURBS surfaces as meshes");
+ RNA_def_boolean(ot->srna,
+ "use_instancing",
+ true,
+ "Use Instancing",
+ "Export data of duplicated objects as Alembic instances; speeds up the export "
+ "and can be disabled for compatibility with other software");
+
RNA_def_float(
ot->srna,
"global_scale",