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:
authorBrecht Van Lommel <brecht@blender.org>2020-04-12 03:37:31 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-04-12 15:48:23 +0300
commitf16fcb5bd5ecfc6ef80b537b77b9a7dd99d9ecf8 (patch)
tree446203854af195ddc2c26330e076dc6e6b48ccfe /source/blender/editors/object/object_volume.c
parent0a747cd4e3a138942b6d85f9193ffc75aaa5fabf (diff)
Fix volume object not loading frame sequences correct in some cases
Ensure we use the first frame as filepath so we can compute the number of leading zeros. For file validation, always test the first frame rather than the current scene frame.
Diffstat (limited to 'source/blender/editors/object/object_volume.c')
-rw-r--r--source/blender/editors/object/object_volume.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/editors/object/object_volume.c b/source/blender/editors/object/object_volume.c
index bb619972e80..b7da91b70ba 100644
--- a/source/blender/editors/object/object_volume.c
+++ b/source/blender/editors/object/object_volume.c
@@ -109,11 +109,6 @@ static int volume_import_exec(bContext *C, wmOperator *op)
BLI_path_rel(volume->filepath, BKE_main_blendfile_path(bmain));
}
- volume->is_sequence = (range->length > 1);
- volume->frame_duration = (volume->is_sequence) ? range->length : 0;
- volume->frame_start = 1;
- volume->frame_offset = (volume->is_sequence) ? range->offset - 1 : 0;
-
if (!BKE_volume_load(volume, bmain)) {
BKE_reportf(op->reports,
RPT_WARNING,
@@ -134,6 +129,13 @@ static int volume_import_exec(bContext *C, wmOperator *op)
continue;
}
+ /* Set sequence parameters after trying to load the first frame, for file validation we want
+ * to use a consistent frame rather than whatever corresponds to the current scene frame. */
+ volume->is_sequence = (range->length > 1);
+ volume->frame_duration = (volume->is_sequence) ? range->length : 0;
+ volume->frame_start = 1;
+ volume->frame_offset = (volume->is_sequence) ? range->offset - 1 : 0;
+
if (BKE_volume_is_y_up(volume)) {
object->rot[0] += M_PI_2;
}