Fix #32178, Adding "File Output" node crashes when a video output type is selected.
The image format for the node and sockets were not properly initialized. The file output node only supports image types (not movies), so it needs to check for proper format type after copying from the render settings.
This commit is contained in:
parent
f2d9e2410c
commit
237b8e496a
@ -123,6 +123,8 @@ bNodeSocket *ntreeCompositOutputFileAddSocket(bNodeTree *ntree, bNode *node, con
|
||||
sockdata->format.imtype= R_IMF_IMTYPE_OPENEXR;
|
||||
}
|
||||
}
|
||||
else
|
||||
BKE_imformat_defaults(&sockdata->format);
|
||||
/* use node data format by default */
|
||||
sockdata->use_node_format = TRUE;
|
||||
|
||||
@ -174,10 +176,15 @@ static void init_output_file(bNodeTree *ntree, bNode* node, bNodeTemplate *ntemp
|
||||
RenderData *rd = &ntemp->scene->r;
|
||||
BLI_strncpy(nimf->base_path, rd->pic, sizeof(nimf->base_path));
|
||||
nimf->format = rd->im_format;
|
||||
|
||||
format = &rd->im_format;
|
||||
if (BKE_imtype_is_movie(nimf->format.imtype)) {
|
||||
nimf->format.imtype= R_IMF_IMTYPE_OPENEXR;
|
||||
}
|
||||
|
||||
format = &nimf->format;
|
||||
}
|
||||
else
|
||||
BKE_imformat_defaults(&nimf->format);
|
||||
|
||||
/* add one socket by default */
|
||||
ntreeCompositOutputFileAddSocket(ntree, node, "Image", format);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user