main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
2 changed files with 9 additions and 2 deletions
Showing only changes of commit 08fd5747d2 - Show all commits

View File

@ -2514,8 +2514,9 @@ ViewLayerAOV *BKE_view_layer_add_aov(ViewLayer *view_layer)
void BKE_view_layer_remove_aov(ViewLayer *view_layer, ViewLayerAOV *aov) void BKE_view_layer_remove_aov(ViewLayer *view_layer, ViewLayerAOV *aov)
{ {
BLI_assert(BLI_findindex(&view_layer->aovs, aov) != -1); if (aov == nullptr || BLI_findindex(&view_layer->aovs, aov) == -1) {
BLI_assert(aov != nullptr); return;
}
if (view_layer->active_aov == aov) { if (view_layer->active_aov == aov) {
if (aov->next) { if (aov->next) {
viewlayer_aov_active_set(view_layer, aov->next); viewlayer_aov_active_set(view_layer, aov->next);

View File

@ -4294,6 +4294,12 @@ static void rna_def_view_layer_aovs(BlenderRNA *brna, PropertyRNA *cprop)
func = RNA_def_function(srna, "add", "BKE_view_layer_add_aov"); func = RNA_def_function(srna, "add", "BKE_view_layer_add_aov");
parm = RNA_def_pointer(func, "aov", "AOV", "", "Newly created AOV"); parm = RNA_def_pointer(func, "aov", "AOV", "", "Newly created AOV");
RNA_def_function_return(func, parm); RNA_def_function_return(func, parm);
func = RNA_def_function(srna, "remove", "BKE_view_layer_remove_aov");
parm = RNA_def_pointer(func, "aov", "AOV", "", "AOV to remove");
RNA_def_function_ui_description(func, "Remove an AOV");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
} }
static void rna_def_view_layer_aov(BlenderRNA *brna) static void rna_def_view_layer_aov(BlenderRNA *brna)