Blender  V3.3
IO_wavefront_obj.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "BLI_path_util.h"
8 #include "BLI_timeit.hh"
9 
10 #include "IO_wavefront_obj.h"
11 
12 #include "obj_exporter.hh"
13 #include "obj_importer.hh"
14 
15 using namespace blender::timeit;
16 
17 static void report_duration(const char *job, const TimePoint &start_time, const char *path)
18 {
19  Nanoseconds duration = Clock::now() - start_time;
20  std::cout << "OBJ " << job << " of '" << BLI_path_basename(path) << "' took ";
21  print_duration(duration);
22  std::cout << '\n';
23 }
24 
25 void OBJ_export(bContext *C, const OBJExportParams *export_params)
26 {
27  TimePoint start_time = Clock::now();
28  blender::io::obj::exporter_main(C, *export_params);
29  report_duration("export", start_time, export_params->filepath);
30 }
31 
32 void OBJ_import(bContext *C, const OBJImportParams *import_params)
33 {
34  TimePoint start_time = Clock::now();
35  blender::io::obj::importer_main(C, *import_params);
36  report_duration("import", start_time, import_params->filepath);
37 }
const char * BLI_path_basename(const char *path) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
Definition: path_util.c:1653
static void report_duration(const char *job, const TimePoint &start_time, const char *path)
void OBJ_import(bContext *C, const OBJImportParams *import_params)
void OBJ_export(bContext *C, const OBJExportParams *export_params)
#define C
Definition: RandGen.cpp:25
void exporter_main(bContext *C, const OBJExportParams &export_params)
void importer_main(bContext *C, const OBJImportParams &import_params)
Definition: obj_importer.cc:94
Clock::time_point TimePoint
Definition: BLI_timeit.hh:14
void print_duration(Nanoseconds duration)
Definition: timeit.cc:10
std::chrono::nanoseconds Nanoseconds
Definition: BLI_timeit.hh:15
char filepath[FILE_MAX]
char filepath[FILE_MAX]