[Bf-blender-cvs] [3d14994] alembic_basic_io: Expose CacheFile.is_sequence to the UI, to avoid issues when checking for sequences.

Kévin Dietrich noreply at git.blender.org
Thu Jul 28 21:12:28 CEST 2016


Commit: 3d14994785ec587586261ecde7607e0b4097b8b2
Author: Kévin Dietrich
Date:   Thu Jul 28 20:07:22 2016 +0200
Branches: alembic_basic_io
https://developer.blender.org/rB3d14994785ec587586261ecde7607e0b4097b8b2

Expose CacheFile.is_sequence to the UI, to avoid issues when checking
for sequences.

===================================================================

M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/io/io_alembic.c

===================================================================

diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 13dd534..93aa043 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -3889,6 +3889,9 @@ void uiTemplateCacheFile(uiLayout *layout, bContext *C, PointerRNA *ptr, const c
 	uiItemO(row, "", ICON_FILE_REFRESH, "cachefile.reload");
 
 	row = uiLayoutRow(layout, false);
+	uiItemR(row, &fileptr, "is_sequence", 0, "Is Sequence", ICON_NONE);
+
+	row = uiLayoutRow(layout, false);
 	uiItemR(row, &fileptr, "override_frame", 0, "Override Frame", ICON_NONE);
 
 	row = uiLayoutRow(layout, false);
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c
index ba178b0..7a7c42e 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -385,6 +385,9 @@ static void ui_alembic_import_settings(uiLayout *layout, PointerRNA *imfptr)
 	uiItemR(row, imfptr, "set_frame_range", 0, NULL, ICON_NONE);
 
 	row = uiLayoutRow(box, false);
+	uiItemR(row, imfptr, "is_sequence", 0, NULL, ICON_NONE);
+
+	row = uiLayoutRow(box, false);
 	uiItemR(row, imfptr, "validate_meshes", 0, NULL, ICON_NONE);
 }
 
@@ -407,12 +410,16 @@ static int wm_alembic_import_exec(bContext *C, wmOperator *op)
 	RNA_string_get(op->ptr, "filepath", filename);
 
 	const float scale = RNA_float_get(op->ptr, "scale");
+	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");
 
 	int offset = 0;
-	int sequence_len = get_sequence_len(filename, &offset);
-	const bool is_sequence = (sequence_len > 1);
+	int sequence_len = 1;
+
+	if (is_sequence) {
+		sequence_len = get_sequence_len(filename, &offset);
+	}
 
 	ABC_import(C, filename, scale, is_sequence, set_frame_range, sequence_len, offset, validate_meshes);
 
@@ -443,6 +450,9 @@ void WM_OT_alembic_import(wmOperatorType *ot)
 
 	RNA_def_boolean(ot->srna, "validate_meshes", 0,
 	                "Validate Meshes", "Check imported mesh objects for invalid data (slow)");
+
+	RNA_def_boolean(ot->srna, "is_sequence", false, "Is Sequence",
+	                "Set to true if the cache is split into separate files");
 }
 
 #endif




More information about the Bf-blender-cvs mailing list