Changeset View
Changeset View
Standalone View
Standalone View
source/blender/io/usd/intern/usd_capi.cc
| Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | if (data->params.export_animation) { | ||||
| for (float frame = scene->r.sfra; frame <= scene->r.efra; frame++) { | for (float frame = scene->r.sfra; frame <= scene->r.efra; frame++) { | ||||
| if (G.is_break || (stop != nullptr && *stop)) { | if (G.is_break || (stop != nullptr && *stop)) { | ||||
| break; | break; | ||||
| } | } | ||||
| // Update the scene for the next frame to render. | // Update the scene for the next frame to render. | ||||
| scene->r.cfra = static_cast<int>(frame); | scene->r.cfra = static_cast<int>(frame); | ||||
| scene->r.subframe = frame - scene->r.cfra; | scene->r.subframe = frame - scene->r.cfra; | ||||
| BKE_scene_graph_update_for_newframe(data->depsgraph, data->bmain); | BKE_scene_graph_update_for_newframe(data->depsgraph); | ||||
| iter.set_export_frame(frame); | iter.set_export_frame(frame); | ||||
| iter.iterate_and_write(); | iter.iterate_and_write(); | ||||
| *progress += progress_per_frame; | *progress += progress_per_frame; | ||||
| *do_update = true; | *do_update = true; | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| // If we're not animating, a single iteration over all objects is enough. | // If we're not animating, a single iteration over all objects is enough. | ||||
| iter.iterate_and_write(); | iter.iterate_and_write(); | ||||
| } | } | ||||
| iter.release_writers(); | iter.release_writers(); | ||||
| usd_stage->GetRootLayer()->Save(); | usd_stage->GetRootLayer()->Save(); | ||||
| // Finish up by going back to the keyframe that was current before we started. | // Finish up by going back to the keyframe that was current before we started. | ||||
| if (CFRA != orig_frame) { | if (CFRA != orig_frame) { | ||||
| CFRA = orig_frame; | CFRA = orig_frame; | ||||
| BKE_scene_graph_update_for_newframe(data->depsgraph, data->bmain); | BKE_scene_graph_update_for_newframe(data->depsgraph); | ||||
| } | } | ||||
| data->export_ok = true; | data->export_ok = true; | ||||
| *progress = 1.0f; | *progress = 1.0f; | ||||
| *do_update = true; | *do_update = true; | ||||
| } | } | ||||
| static void export_endjob(void *customdata) | static void export_endjob(void *customdata) | ||||
| ▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines | |||||