Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2022-04-08 12:51:31 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2022-04-08 12:51:31 +0300
commitaa46a67634930786dd721e4cc8b140c7055118bc (patch)
tree64cd78b0936838d39aabb93be54d3bd6b8273369
parenta410cea291a118187efdca8b440c27df69dd7bd5 (diff)
Fix lightgroup creation without a specified name
-rw-r--r--source/blender/editors/render/render_shading.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc
index d9929025c28..4c885d50b4c 100644
--- a/source/blender/editors/render/render_shading.cc
+++ b/source/blender/editors/render/render_shading.cc
@@ -1124,9 +1124,10 @@ static int view_layer_add_lightgroup_exec(bContext *C, wmOperator *op)
ViewLayer *view_layer = CTX_data_view_layer(C);
char name[MAX_NAME];
- RNA_string_get(op->ptr, "name", name);
+ name[0] = '\0';
/* If a name is provided, ensure that it is unique. */
- if (name[0]) {
+ if (RNA_struct_property_is_set(op->ptr, "name")) {
+ RNA_string_get(op->ptr, "name", name);
/* Ensure that there are no dots in the name. */
BLI_str_replace_char(name, '.', '_');
LISTBASE_FOREACH (ViewLayerLightgroup *, lightgroup, &view_layer->lightgroups) {