Handle no sounds found
This commit is contained in:
@@ -16,6 +16,9 @@ class SoundBank:
|
||||
return [sound for sound in bpy.data.sounds if sound.name.startswith(self.prefix)]
|
||||
|
||||
def random_sound(self) -> Sound:
|
||||
if len(self.sounds()) == 0:
|
||||
return None
|
||||
else:
|
||||
return choice(self.sounds())
|
||||
|
||||
def get_audiofile_info(self, sound, fps) -> (int, int):
|
||||
|
||||
Reference in New Issue
Block a user