Alembic export: fix frame range values being reset at every update, draw
call.
This commit is contained in:
parent
8a1b38f071
commit
0c13792437
|
@ -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, "", "");
|
||||
}
|
||||
|
||||
/* ************************************************************************** */
|
||||
|
|
Loading…
Reference in New Issue