Commit: aa46a67634930786dd721e4cc8b140c7055118bc
Author: Lukas Stockner
Date:   Fri Apr 8 11:51:31 2022 +0200
Branches: master
https://developer.blender.org/rBaa46a67634930786dd721e4cc8b140c7055118bc

Fix lightgroup creation without a specified name

===================================================================

M       source/blender/editors/render/render_shading.cc

===================================================================

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) {

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to