[Bf-blender-cvs] [149e912b1fa] blender2.8: Special enum item when no sound is found
Dalai Felinto
noreply at git.blender.org
Fri Oct 5 17:37:19 CEST 2018
Commit: 149e912b1fa84b2d008c52c1ed13334fa7eeb7b5
Author: Dalai Felinto
Date: Fri Oct 5 11:51:04 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB149e912b1fa84b2d008c52c1ed13334fa7eeb7b5
Special enum item when no sound is found
This happens when you build without sound libraries and such.
Without that the console is spammed with tons of RNA messages because
the enum is empty.
===================================================================
M source/blender/makesrna/intern/rna_userdef.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index a2840b0443c..5eee0ccec37 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -486,6 +486,13 @@ static const EnumPropertyItem *rna_userdef_audio_device_itemf(bContext *UNUSED(C
RNA_enum_item_add(&item, &totitem, &new_item);
}
+#ifndef NDEBUG
+ if (i == 0) {
+ EnumPropertyItem new_item = {i, "SOUND_NONE", 0, "No Sound", ""};
+ RNA_enum_item_add(&item, &totitem, &new_item);
+ }
+#endif
+
/* may be unused */
UNUSED_VARS(index, audio_device_items);
More information about the Bf-blender-cvs
mailing list