Merge branch 'blender-v2.83-release'

This commit is contained in:
Brecht Van Lommel 2020-05-14 03:09:33 +02:00
commit db1099c0ae
7 changed files with 86 additions and 56 deletions

View File

@ -5726,6 +5726,13 @@ RenderSlot *BKE_image_add_renderslot(Image *ima, const char *name)
bool BKE_image_remove_renderslot(Image *ima, ImageUser *iuser, int index)
{
if (index == ima->last_render_slot) {
/* Don't remove render slot while rendering to it. */
if (G.is_rendering) {
return false;
}
}
int num_slots = BLI_listbase_count(&ima->renderslots);
if (index >= num_slots || num_slots == 1) {
return false;

View File

@ -85,6 +85,7 @@ NodeGroup *BlenderFileLoader::Load()
#endif
int id = 0;
const eEvaluationMode eval_mode = DEG_get_mode(_depsgraph);
DEG_OBJECT_ITER_BEGIN (_depsgraph,
ob,
@ -99,6 +100,10 @@ NodeGroup *BlenderFileLoader::Load()
continue;
}
if (!(BKE_object_visibility(ob, eval_mode) & OB_VISIBLE_SELF)) {
continue;
}
Mesh *mesh = BKE_object_to_mesh(NULL, ob, false);
if (mesh) {

View File

@ -177,12 +177,6 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
return 0;
}
if (setjmp(png_jmpbuf(png_ptr))) {
png_destroy_write_struct(&png_ptr, &info_ptr);
printf("imb_savepng: Cannot setjmp for file: '%s'\n", name);
return 0;
}
/* copy image data */
num_bytes = ((size_t)ibuf->x) * ibuf->y * bytesperpixel;
if (is_16bit) {
@ -191,15 +185,39 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
else {
pixels = MEM_mallocN(num_bytes * sizeof(unsigned char), "png 8bit pixels");
}
if (pixels == NULL && pixels16 == NULL) {
png_destroy_write_struct(&png_ptr, &info_ptr);
printf(
"imb_savepng: Cannot allocate pixels array of %dx%d, %d bytes per pixel for file: '%s'\n",
"imb_savepng: Cannot allocate pixels array of %dx%d, %d bytes per pixel for file: "
"'%s'\n",
ibuf->x,
ibuf->y,
bytesperpixel,
name);
}
/* allocate memory for an array of row-pointers */
row_pointers = (png_bytepp)MEM_mallocN(ibuf->y * sizeof(png_bytep), "row_pointers");
if (row_pointers == NULL) {
printf("imb_savepng: Cannot allocate row-pointers array for file '%s'\n", name);
}
if ((pixels == NULL && pixels16 == NULL) || (row_pointers == NULL) ||
setjmp(png_jmpbuf(png_ptr))) {
/* On error jump here, and free any resources. */
png_destroy_write_struct(&png_ptr, &info_ptr);
if (pixels) {
MEM_freeN(pixels);
}
if (pixels16) {
MEM_freeN(pixels16);
}
if (row_pointers) {
MEM_freeN(row_pointers);
}
if (fp) {
fflush(fp);
fclose(fp);
}
return 0;
}
@ -457,23 +475,6 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags)
png_set_swap(png_ptr);
#endif
/* allocate memory for an array of row-pointers */
row_pointers = (png_bytepp)MEM_mallocN(ibuf->y * sizeof(png_bytep), "row_pointers");
if (row_pointers == NULL) {
printf("imb_savepng: Cannot allocate row-pointers array for file '%s'\n", name);
png_destroy_write_struct(&png_ptr, &info_ptr);
if (pixels) {
MEM_freeN(pixels);
}
if (pixels16) {
MEM_freeN(pixels16);
}
if (fp) {
fclose(fp);
}
return 0;
}
/* set the individual row-pointers to point at the correct offsets */
if (is_16bit) {
for (i = 0; i < ibuf->y; i++) {
@ -576,6 +577,7 @@ ImBuf *imb_loadpng(const unsigned char *mem, size_t size, int flags, char colors
png_set_read_fn(png_ptr, (void *)&ps, ReadData);
if (setjmp(png_jmpbuf(png_ptr))) {
/* On error jump here, and free any resources. */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
if (pixels) {
MEM_freeN(pixels);

View File

@ -441,7 +441,7 @@ static void rna_def_volume_render(BlenderRNA *brna)
RNA_def_property_ui_range(prop, 0.0, 100.0, 1, 3);
RNA_def_property_ui_text(prop,
"Step Size",
"Distance between volume samples. Higher values render more detail at "
"Distance between volume samples. Lower values render more detail at "
"the cost of performance. If set to zero, the step size is "
"automatically determined based on voxel size");
RNA_def_property_update(prop, 0, "rna_Volume_update_display");

View File

@ -605,9 +605,11 @@ bool RE_bake_engine(Render *re,
engine->resolution_x = re->winx;
engine->resolution_y = re->winy;
BLI_rw_mutex_lock(&re->partsmutex, THREAD_LOCK_WRITE);
RE_parts_init(re);
engine->tile_x = re->r.tilex;
engine->tile_y = re->r.tiley;
BLI_rw_mutex_unlock(&re->partsmutex);
if (type->bake) {
engine->depsgraph = depsgraph;

View File

@ -1819,42 +1819,42 @@ bool RE_is_rendering_allowed(Scene *scene,
}
}
if (scemode & R_DOCOMP) {
if (scene->use_nodes) {
if (!scene->nodetree) {
BKE_report(reports, RPT_ERROR, "No node tree in scene");
return 0;
}
if (!check_composite_output(scene)) {
BKE_report(reports, RPT_ERROR, "No render output node in scene");
return 0;
}
if (scemode & R_FULL_SAMPLE) {
if (composite_needs_render(scene, 0) == 0) {
BKE_report(reports, RPT_ERROR, "Full sample AA not supported without 3D rendering");
return 0;
}
}
}
}
/* check valid camera, without camera render is OK (compo, seq) */
if (!check_valid_camera(scene, camera_override, reports)) {
return 0;
}
if (RE_seq_render_active(scene, &scene->r)) {
/* Sequencer */
if (scene->r.mode & R_BORDER) {
BKE_report(reports, RPT_ERROR, "Border rendering is not supported by sequencer");
return false;
}
}
else if ((scemode & R_DOCOMP) && scene->use_nodes) {
/* Compositor */
if (!scene->nodetree) {
BKE_report(reports, RPT_ERROR, "No node tree in scene");
return 0;
}
/* layer flag tests */
if (!render_scene_has_layers_to_render(scene, single_layer)) {
BKE_report(reports, RPT_ERROR, "All render layers are disabled");
if (!check_composite_output(scene)) {
BKE_report(reports, RPT_ERROR, "No render output node in scene");
return 0;
}
if (scemode & R_FULL_SAMPLE) {
if (composite_needs_render(scene, 0) == 0) {
BKE_report(reports, RPT_ERROR, "Full sample AA not supported without 3D rendering");
return 0;
}
}
}
else {
/* Regular Render */
if (!render_scene_has_layers_to_render(scene, single_layer)) {
BKE_report(reports, RPT_ERROR, "All render layers are disabled");
return 0;
}
}
/* check valid camera, without camera render is OK (compo, seq) */
if (!check_valid_camera(scene, camera_override, reports)) {
return 0;
}

View File

@ -1369,6 +1369,7 @@ static int arg_handle_output_set(int argc, const char **argv, void *data)
Scene *scene = CTX_data_scene(C);
if (scene) {
BLI_strncpy(scene->r.pic, argv[1], sizeof(scene->r.pic));
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
}
else {
printf("\nError: no blend loaded. cannot use '-o / --render-output'.\n");
@ -1402,6 +1403,7 @@ static int arg_handle_engine_set(int argc, const char **argv, void *data)
if (scene) {
if (BLI_findstring(&R_engines, argv[1], offsetof(RenderEngineType, idname))) {
BLI_strncpy_utf8(scene->r.engine, argv[1], sizeof(scene->r.engine));
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
}
else {
printf("\nError: engine not found '%s'\n", argv[1]);
@ -1447,6 +1449,7 @@ static int arg_handle_image_type_set(int argc, const char **argv, void *data)
}
else {
scene->r.im_format.imtype = imtype_new;
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
}
}
else {
@ -1532,9 +1535,11 @@ static int arg_handle_extension_set(int argc, const char **argv, void *data)
if (scene) {
if (argv[1][0] == '0') {
scene->r.scemode &= ~R_EXTENSION;
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
}
else if (argv[1][0] == '1') {
scene->r.scemode |= R_EXTENSION;
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
}
else {
printf("\nError: Use '-x 1 / -x 0' To set the extension option or '--use-extension'\n");
@ -1693,6 +1698,9 @@ static int arg_handle_frame_start_set(int argc, const char **argv, void *data)
&err_msg)) {
printf("\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]);
}
else {
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
}
return 1;
}
else {
@ -1727,6 +1735,9 @@ static int arg_handle_frame_end_set(int argc, const char **argv, void *data)
&err_msg)) {
printf("\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]);
}
else {
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
}
return 1;
}
else {
@ -1754,6 +1765,9 @@ static int arg_handle_frame_skip_set(int argc, const char **argv, void *data)
if (!parse_int_clamp(argv[1], NULL, 1, MAXFRAME, &scene->r.frame_step, &err_msg)) {
printf("\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]);
}
else {
DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
}
return 1;
}
else {