Fix #114415: USDZ conversion happens outside of main thread. #114420
|
@ -340,16 +340,6 @@ static void export_startjob(void *customdata,
|
|||
|
||||
usd_stage->GetRootLayer()->Save();
|
||||
|
||||
if (data->targets_usdz()) {
|
||||
bool usd_conversion_success = perform_usdz_conversion(data);
|
||||
if (!usd_conversion_success) {
|
||||
data->export_ok = false;
|
||||
*progress = 1.0f;
|
||||
*do_update = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
data->export_ok = true;
|
||||
*progress = 1.0f;
|
||||
*do_update = true;
|
||||
|
@ -380,6 +370,16 @@ static void export_endjob(void *customdata)
|
|||
DEG_graph_free(data->depsgraph);
|
||||
|
||||
if (data->targets_usdz()) {
|
||||
/* NOTE: call to #perform_usdz_conversion has to be done here instead of the main threaded
|
||||
* worker callback (#export_startjob) because USDZ conversion requires changing the current
|
||||
* working directory. This is not safe to do from a non-main thread. Once the USD library fix
|
||||
* this weird requirement, this call can be moved back at the end of #export_startjob, and not
|
||||
* block the main user interface anymore. */
|
||||
bool usd_conversion_success = perform_usdz_conversion(data);
|
||||
if (!usd_conversion_success) {
|
||||
data->export_ok = false;
|
||||
}
|
||||
|
||||
export_endjob_usdz_cleanup(data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue