[Bf-blender-cvs] [0c13792] master: Alembic export: fix frame range values being reset at every update, draw call.

Kévin Dietrich noreply at git.blender.org
Sat Oct 29 12:25:12 CEST 2016


Commit: 0c13792437b3e501c06605876a0396e187c0f7da
Author: Kévin Dietrich
Date:   Sat Oct 29 11:04:51 2016 +0200
Branches: master
https://developer.blender.org/rB0c13792437b3e501c06605876a0396e187c0f7da

Alembic export: fix frame range values being reset at every update, draw
call.

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

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

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

diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c
index 65af052..a991f59 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -68,6 +68,8 @@
 
 static int wm_alembic_export_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
+	RNA_boolean_set(op->ptr, "init_scene_frame_range", true);
+
 	if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
 		Main *bmain = CTX_data_main(C);
 		char filepath[FILE_MAX];
@@ -240,9 +242,11 @@ static void wm_alembic_export_draw(bContext *C, wmOperator *op)
 	/* Conveniently set start and end frame to match the scene's frame range. */
 	Scene *scene = CTX_data_scene(C);
 
-	if (scene != NULL) {
+	if (scene != NULL && RNA_boolean_get(&ptr, "init_scene_frame_range")) {
 		RNA_int_set(&ptr, "start", SFRA);
 		RNA_int_set(&ptr, "end", EFRA);
+
+		RNA_boolean_set(&ptr, "init_scene_frame_range", false);
 	}
 
 	ui_alembic_export_settings(op->layout, &ptr);
@@ -343,6 +347,11 @@ void WM_OT_alembic_export(wmOperatorType *ot)
 
 	RNA_def_enum(ot->srna, "ngon_method", rna_enum_modifier_triangulate_quad_method_items,
 	             MOD_TRIANGULATE_NGON_BEAUTY, "Polygon Method", "Method for splitting the polygons into triangles");
+
+	/* This dummy prop is used to check whether we need to init the start and
+     * end frame values to that of the scene's, otherwise they are reset at
+     * every change, draw update. */
+	RNA_def_boolean(ot->srna, "init_scene_frame_range", false, "", "");
 }
 
 /* ************************************************************************** */




More information about the Bf-blender-cvs mailing list