I want the user to be able to select some data from a CollectionProperty
audioFiles = CollectionProperty(type=AudioFileNameGroup)
holding data of a custom PropertyGroup
type:
class AudioFileNameGroup(types.PropertyGroup):
fileName = StringProperty(name="File Name", subtype='FILE_NAME')
To enable the selection for the user, in a panel I'm using prop_search
on that:
navStateCol.prop_search(obj, "audioAction", context.scene.frameworkReferences, 'audioFiles', translate=False,
icon='PLAY_AUDIO')
but I can't get it to work:
If the obj.audioAction
property is a StringProperty
audioAction = StringProperty(name="Audio Effect", subtype='FILE_NAME')
i don't get anything to select from:
This makes sense, as the system has no way of knowing, that it should refer to the fileName
StringProperty inside the AudioFileNameGroup
.
If the obj.audioAction
property is
audioAction = PointerProperty(type=AudioFileNameGroup, name="AudioAction")
it is not editable, and the ui is disabled:
How can I use prop_search
on the audioFiles
collectionproperty?
bpy.path.extensions_audio
is a set of audio file extensions supported by the user's blender. $\endgroup$ – batFINGER Jun 12 '18 at 15:40