diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2016-10-29 12:04:51 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2016-10-29 12:04:51 +0300 |
commit | 0c13792437b3e501c06605876a0396e187c0f7da (patch) | |
tree | a68ce5a51b74e7c1109ae9d6773f4775551bc421 /source | |
parent | 8a1b38f071dea64567fa9e3dac5ad98d7b2dc6a2 (diff) |
Alembic export: fix frame range values being reset at every update, draw
call.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/io/io_alembic.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c index 65af052dc5e..a991f59e8e2 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, "", ""); } /* ************************************************************************** */ |