70 if (visible_objects_only) {
86 data->was_canceled =
false;
88 G.is_rendering =
true;
97 if (!
data->params.apply_subdiv) {
104 const int orig_frame =
CFRA;
105 const bool export_animation = (
data->params.frame_start !=
data->params.frame_end);
108 std::unique_ptr<ABCArchive> abc_archive;
110 abc_archive = std::make_unique<ABCArchive>(
113 catch (
const std::exception &ex) {
114 std::stringstream error_message_stream;
115 error_message_stream <<
"Error writing to " <<
data->filename;
116 const std::string &error_message = error_message_stream.str();
120 CLOG_ERROR(&
LOG,
"%s: %s", error_message.c_str(), ex.what());
122 data->export_ok =
false;
127 std::stringstream error_message_stream;
128 error_message_stream <<
"Unknown error writing to " <<
data->filename;
130 data->export_ok =
false;
136 if (export_animation) {
140 const float progress_per_frame = 1.0f /
std::max(
size_t(1), abc_archive->total_frame_count());
141 ABCArchive::Frames::const_iterator frame_it = abc_archive->frames_begin();
142 const ABCArchive::Frames::const_iterator frames_end = abc_archive->frames_end();
144 for (; frame_it != frames_end; frame_it++) {
145 double frame = *frame_it;
147 if (
G.is_break || (stop !=
nullptr && *stop)) {
157 ExportSubset export_subset = abc_archive->export_subset_for_frame(frame);
161 *progress += progress_per_frame;
173 if (
CFRA != orig_frame) {
178 data->export_ok = !
data->was_canceled;
194 G.is_rendering =
false;
202 const char *filepath,
204 bool as_background_job)
219 bool export_ok =
false;
220 if (as_background_job) {
237 short stop = 0, do_update = 0;
238 float progress = 0.0f;
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct ViewLayer * CTX_data_view_layer(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
void BKE_scene_graph_update_tagged(struct Depsgraph *depsgraph, struct Main *bmain)
void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph)
File and directory operations.
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int BLI_delete(const char *file, bool dir, bool recursive) ATTR_NONNULL()
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
#define CLOG_ERROR(clg_ref,...)
#define CLOG_INFO(clg_ref, level,...)
Depsgraph * DEG_graph_new(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, eEvaluationMode mode)
struct Depsgraph Depsgraph
void DEG_graph_free(Depsgraph *graph)
void DEG_graph_build_from_view_layer(struct Depsgraph *graph)
void DEG_graph_build_for_all_objects(struct Depsgraph *graph)
struct Scene * DEG_get_input_scene(const Depsgraph *graph)
Read Guarded memory(de)allocation.
bool ABC_export(Scene *scene, bContext *C, const char *filepath, const AlembicExportParams *params, bool as_background_job)
void set_export_subset(ExportSubset export_subset_)
virtual void iterate_and_write() override
const Depsgraph * depsgraph
void(* MEM_freeN)(void *vmemh)
void *(* MEM_mallocN)(size_t len, const char *str)
static void export_startjob(void *customdata, short *stop, short *do_update, float *progress)
static void export_endjob(void *customdata)
static void build_depsgraph(Depsgraph *depsgraph, const bool visible_objects_only)
AlembicExportParams params
void WM_report(ReportType type, const char *message)
void WM_set_locked_interface(wmWindowManager *wm, bool lock)
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, void *owner, const char *name, int flag, int job_type)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *))
void WM_jobs_timer(wmJob *wm_job, double timestep, unsigned int note, unsigned int endnote)