diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-08-19 15:13:45 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2021-08-19 15:29:42 +0300 |
commit | 5b97c00e9fc4e1e5d6cdfa7130eab5aada0e068e (patch) | |
tree | 08d14532c3dca9f64ff676b4167338073845497c /source/blender/editors | |
parent | 4db4123409de6f42a519cd03275d680b3d821298 (diff) |
Alembic import: option to always add a cache reader
The current behavior of the Alembic importer is to only create a
`MeshSequenceCache` modifier or a `Transform Cache` constraint to imported
objects if they have some animated properties.
Since static objects do not have a cache reader, when reloading files those
objects are not updated. Currently, the only way to properly reload a file
because of this is to reimport it.
This adds an option to the importer to always add a cache reader, even if
there is no animated data, to ensure that all objects coming from Alembic
archive are linked to them and updated properly upon reloads.
Reviewed by: brecht, sybren
Ref D10197.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/io/io_alembic.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c index 12890552b1d..bbff37221e8 100644 --- a/source/blender/editors/io/io_alembic.c +++ b/source/blender/editors/io/io_alembic.c @@ -615,6 +615,7 @@ static void ui_alembic_import_settings(uiLayout *layout, PointerRNA *imfptr) uiItemR(col, imfptr, "set_frame_range", 0, NULL, ICON_NONE); uiItemR(col, imfptr, "is_sequence", 0, NULL, ICON_NONE); uiItemR(col, imfptr, "validate_meshes", 0, NULL, ICON_NONE); + uiItemR(col, imfptr, "always_add_cache_reader", 0, NULL, ICON_NONE); } static void wm_alembic_import_draw(bContext *UNUSED(C), wmOperator *op) @@ -645,6 +646,7 @@ static int wm_alembic_import_exec(bContext *C, wmOperator *op) const bool is_sequence = RNA_boolean_get(op->ptr, "is_sequence"); const bool set_frame_range = RNA_boolean_get(op->ptr, "set_frame_range"); const bool validate_meshes = RNA_boolean_get(op->ptr, "validate_meshes"); + const bool always_add_cache_reader = RNA_boolean_get(op->ptr, "always_add_cache_reader"); const bool as_background_job = RNA_boolean_get(op->ptr, "as_background_job"); int offset = 0; @@ -672,6 +674,7 @@ static int wm_alembic_import_exec(bContext *C, wmOperator *op) sequence_len, offset, validate_meshes, + always_add_cache_reader, as_background_job); return as_background_job || ok ? OPERATOR_FINISHED : OPERATOR_CANCELLED; @@ -722,6 +725,13 @@ void WM_OT_alembic_import(wmOperatorType *ot) "Check imported mesh objects for invalid data (slow)"); RNA_def_boolean(ot->srna, + "always_add_cache_reader", + false, + "Always Add Cache Reader", + "Add cache modifiers and constraints to imported objects even if they are not " + "animated so that they can be updated when reloading the Alembic archive"); + + RNA_def_boolean(ot->srna, "is_sequence", false, "Is Sequence", |