I want to create a function that:
- checks if a file test.txt is in a location from filepath variable
- if it is not the displays the dialog again
I've got this:
class FileBrowserOperator(bpy.types.Operator):
bl_idname = "object.file_browser_operator"
bl_label = "File browser Operator"
filepath = bpy.props.StringProperty(subtype="DIR_PATH")
def execute(self, context):
while not os.path.isfile(
context.scene.content_path + '/test.txt'):
context.scene.content_path = self.filepath
print("Path:")
print(context.scene.content_path)
return {'FINISHED'}
[...]
But it shows the dialog only once. I assume, that at the beginning of the loop I've got to clear this value somehow, but I do not know how. Thank You in advence