When generating enums for the image node render layers, replace empty strings with a simple space character. This little hack allows the enum item to be selected from the dropdown list.

This commit is contained in:
Lukas Toenne
2012-05-18 10:00:28 +00:00
parent ef87676262
commit e74de72b96

View File

@@ -512,7 +512,11 @@ static EnumPropertyItem *renderresult_layers_add_enum(RenderLayer *rl)
while (rl) {
tmp.identifier = rl->name;
tmp.name = rl->name;
/* little trick: using space char instead empty string makes the item selectable in the dropdown */
if (rl->name[0] == '\0')
tmp.name = " ";
else
tmp.name = rl->name;
tmp.value = i++;
RNA_enum_item_add(&item, &totitem, &tmp);
rl = rl->next;