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:
Diffstat (limited to 'source/blender/io/alembic/intern/alembic_capi.cc')
-rw-r--r--source/blender/io/alembic/intern/alembic_capi.cc24
1 files changed, 18 insertions, 6 deletions
diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc
index 1fb535a57f2..27df23b38c6 100644
--- a/source/blender/io/alembic/intern/alembic_capi.cc
+++ b/source/blender/io/alembic/intern/alembic_capi.cc
@@ -50,6 +50,7 @@
#include "BLI_math.h"
#include "BLI_path_util.h"
#include "BLI_string.h"
+#include "BLI_timeit.hh"
#include "WM_api.h"
#include "WM_types.h"
@@ -434,8 +435,17 @@ struct ImportJobData {
bool was_cancelled;
bool import_ok;
bool is_background_job;
+ blender::timeit::TimePoint start_time;
};
+static void report_job_duration(const ImportJobData *data)
+{
+ blender::timeit::Nanoseconds duration = blender::timeit::Clock::now() - data->start_time;
+ std::cout << "Alembic import of '" << data->filename << "' took ";
+ blender::timeit::print_duration(duration);
+ std::cout << '\n';
+}
+
static void import_startjob(void *user_data, short *stop, short *do_update, float *progress)
{
SCOPE_TIMER("Alembic import, objects reading and creation");
@@ -445,6 +455,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
data->stop = stop;
data->do_update = do_update;
data->progress = progress;
+ data->start_time = blender::timeit::Clock::now();
WM_set_locked_interface(data->wm, true);
@@ -526,14 +537,14 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
Scene *scene = data->scene;
if (data->settings.is_sequence) {
- SFRA = data->settings.sequence_offset;
- EFRA = SFRA + (data->settings.sequence_len - 1);
- CFRA = SFRA;
+ scene->r.sfra = data->settings.sequence_offset;
+ scene->r.efra = scene->r.sfra + (data->settings.sequence_len - 1);
+ scene->r.cfra = scene->r.sfra;
}
else if (min_time < max_time) {
- SFRA = static_cast<int>(round(min_time * FPS));
- EFRA = static_cast<int>(round(max_time * FPS));
- CFRA = SFRA;
+ scene->r.sfra = static_cast<int>(round(min_time * FPS));
+ scene->r.efra = static_cast<int>(round(max_time * FPS));
+ scene->r.cfra = scene->r.sfra;
}
}
@@ -649,6 +660,7 @@ static void import_endjob(void *user_data)
}
WM_main_add_notifier(NC_SCENE | ND_FRAME, data->scene);
+ report_job_duration(data);
}
static void import_freejob(void *user_data)