Merge branch 'blender-v2.91-release'

This commit is contained in:
Bastien Montagne 2020-11-17 17:39:47 +01:00
commit 75dbbaeda6
2 changed files with 20 additions and 11 deletions

View File

@ -52,16 +52,25 @@ static void image_free_gpu(Image *ima, const bool immediate);
/* Is the alpha of the `GPUTexture` for a given image/ibuf premultiplied. */
bool BKE_image_has_gpu_texture_premultiplied_alpha(Image *image, ImBuf *ibuf)
{
const bool type_is_premultiplied = (image == NULL) || ELEM(image->type,
IMA_TYPE_R_RESULT,
IMA_TYPE_COMPOSITE,
IMA_TYPE_UV_TEST);
const bool store_premultiplied =
type_is_premultiplied ||
((ibuf != NULL) &&
(ibuf->rect_float ? (image ? (image->alpha_mode != IMA_ALPHA_STRAIGHT) : false) :
(image ? (image->alpha_mode == IMA_ALPHA_PREMUL) : true)));
return store_premultiplied;
if (image) {
/* Render result and compositor output are always premultiplied */
if (ELEM(image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) {
return true;
}
/* Generated images use pre multiplied float buffer, but straight alpha for byte buffers. */
if (image->type == IMA_TYPE_UV_TEST && ibuf) {
return ibuf->rect_float != NULL;
}
}
else if (ibuf) {
if (ibuf->rect_float) {
return image ? (image->alpha_mode != IMA_ALPHA_STRAIGHT) : false;
}
else {
return image ? (image->alpha_mode == IMA_ALPHA_PREMUL) : true;
}
}
return false;
}
/* -------------------------------------------------------------------- */

View File

@ -1160,7 +1160,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop)
RNA_def_property_pointer_funcs(
prop, "rna_NlaTrack_active_get", "rna_NlaTrack_active_set", NULL, NULL);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Active Constraint", "Active Object constraint");
RNA_def_property_ui_text(prop, "Active Track", "Active NLA Track");
/* XXX: should (but doesn't) update the active track in the NLA window */
RNA_def_property_update(prop, NC_ANIMATION | ND_NLA | NA_SELECTED, NULL);
}