Changeset View
Changeset View
Standalone View
Standalone View
source/creator/creator_args.c
| Show First 20 Lines • Show All 1,356 Lines • ▼ Show 20 Lines | if (argc > 1) { | ||||
| if ((frame_range_arr = parse_int_range_relative_clamp_n( | if ((frame_range_arr = parse_int_range_relative_clamp_n( | ||||
| argv[1], scene->r.sfra, scene->r.efra, MINAFRAME, MAXFRAME, | argv[1], scene->r.sfra, scene->r.efra, MINAFRAME, MAXFRAME, | ||||
| &frames_range_len, &err_msg)) == NULL) | &frames_range_len, &err_msg)) == NULL) | ||||
| { | { | ||||
| printf("\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]); | printf("\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]); | ||||
| return 1; | return 1; | ||||
| } | } | ||||
| re = RE_NewRender(scene->id.name); | re = RE_NewSceneRender(scene); | ||||
| BLI_begin_threaded_malloc(); | BLI_begin_threaded_malloc(); | ||||
| BKE_reports_init(&reports, RPT_STORE); | BKE_reports_init(&reports, RPT_STORE); | ||||
| RE_SetReports(re, &reports); | RE_SetReports(re, &reports); | ||||
| for (int i = 0; i < frames_range_len; i++) { | for (int i = 0; i < frames_range_len; i++) { | ||||
| /* We could pass in frame ranges, | /* We could pass in frame ranges, | ||||
| * but prefer having exact behavior as passing in multiple frames */ | * but prefer having exact behavior as passing in multiple frames */ | ||||
| if ((frame_range_arr[i][0] <= frame_range_arr[i][1]) == 0) { | if ((frame_range_arr[i][0] <= frame_range_arr[i][1]) == 0) { | ||||
| Show All 25 Lines | |||||
| "\n\tRender frames from start to end (inclusive)" | "\n\tRender frames from start to end (inclusive)" | ||||
| ; | ; | ||||
| static int arg_handle_render_animation(int UNUSED(argc), const char **UNUSED(argv), void *data) | static int arg_handle_render_animation(int UNUSED(argc), const char **UNUSED(argv), void *data) | ||||
| { | { | ||||
| bContext *C = data; | bContext *C = data; | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| if (scene) { | if (scene) { | ||||
| Main *bmain = CTX_data_main(C); | Main *bmain = CTX_data_main(C); | ||||
| Render *re = RE_NewRender(scene->id.name); | Render *re = RE_NewSceneRender(scene); | ||||
| ReportList reports; | ReportList reports; | ||||
| BLI_begin_threaded_malloc(); | BLI_begin_threaded_malloc(); | ||||
| BKE_reports_init(&reports, RPT_STORE); | BKE_reports_init(&reports, RPT_STORE); | ||||
| RE_SetReports(re, &reports); | RE_SetReports(re, &reports); | ||||
| RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step); | RE_BlenderAnim(re, bmain, scene, NULL, scene->lay, scene->r.sfra, scene->r.efra, scene->r.frame_step); | ||||
| RE_SetReports(re, NULL); | RE_SetReports(re, NULL); | ||||
| BKE_reports_clear(&reports); | BKE_reports_clear(&reports); | ||||
| BLI_end_threaded_malloc(); | BLI_end_threaded_malloc(); | ||||
| ▲ Show 20 Lines • Show All 494 Lines • Show Last 20 Lines | |||||