Welcome to mirror list, hosted at ThFree Co, Russian Federation.

IO_wavefront_obj.cc « wavefront_obj « io « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2fd2973ee73e7631f80192fe75d6d56be7c7003c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/* SPDX-License-Identifier: GPL-2.0-or-later */

/** \file
 * \ingroup obj
 */

#include "BLI_path_util.h"
#include "BLI_timeit.hh"

#include "IO_wavefront_obj.h"

#include "obj_exporter.hh"
#include "obj_importer.hh"

using namespace blender::timeit;

static void report_duration(const char *job, const TimePoint &start_time, const char *path)
{
  Nanoseconds duration = Clock::now() - start_time;
  std::cout << "OBJ " << job << " of '" << BLI_path_basename(path) << "' took ";
  print_duration(duration);
  std::cout << '\n';
}

void OBJ_export(bContext *C, const OBJExportParams *export_params)
{
  TimePoint start_time = Clock::now();
  blender::io::obj::exporter_main(C, *export_params);
  report_duration("export", start_time, export_params->filepath);
}

void OBJ_import(bContext *C, const OBJImportParams *import_params)
{
  TimePoint start_time = Clock::now();
  blender::io::obj::importer_main(C, *import_params);
  report_duration("import", start_time, import_params->filepath);
}