From 575600d54018c9361de95fd71fffd03a8285a222 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 25 Apr 2025 10:27:01 +1000 Subject: [PATCH] Docs: correct use of FILE_PATH for directories Also correct own error in recent doc-update regarding the expected return value for fileselect_add. --- doc/python_api/examples/bpy.types.FileHandler.2.py | 4 ++-- .../examples/bpy.types.WindowManager.fileselect_add.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/python_api/examples/bpy.types.FileHandler.2.py b/doc/python_api/examples/bpy.types.FileHandler.2.py index 85c860bef76..1c8caa0c6a9 100644 --- a/doc/python_api/examples/bpy.types.FileHandler.2.py +++ b/doc/python_api/examples/bpy.types.FileHandler.2.py @@ -7,7 +7,7 @@ but for this it is require to define the following properties: .. code-block:: python - directory: StringProperty(subtype='FILE_PATH') + directory: StringProperty(subtype='DIR_PATH') files: CollectionProperty(type=bpy.types.OperatorFileListElement) This ``directory`` and ``files`` properties now will be used by the @@ -29,7 +29,7 @@ class ShaderScriptImport(bpy.types.Operator, ImportHelper): This Operator can import multiple .txt files, we need following directory and files properties that the file handler will use to set files path data """ - directory: bpy.props.StringProperty(subtype='FILE_PATH', options={'SKIP_SAVE', 'HIDDEN'}) + directory: bpy.props.StringProperty(subtype='DIR_PATH', options={'SKIP_SAVE', 'HIDDEN'}) files: bpy.props.CollectionProperty(type=bpy.types.OperatorFileListElement, options={'SKIP_SAVE', 'HIDDEN'}) """Allow the user to select if the node's label is set or not""" diff --git a/doc/python_api/examples/bpy.types.WindowManager.fileselect_add.py b/doc/python_api/examples/bpy.types.WindowManager.fileselect_add.py index 4aa2144ed43..138301ef43a 100644 --- a/doc/python_api/examples/bpy.types.WindowManager.fileselect_add.py +++ b/doc/python_api/examples/bpy.types.WindowManager.fileselect_add.py @@ -1,6 +1,6 @@ """ -This method is used from the operators ``invoke`` callback. -On success they should return ``{'RUNNING_MODAL'}`` otherwise ``{'CANCELLED'}``. +This method is used from the operators ``invoke`` callback +which must then return ``{'RUNNING_MODAL'}``. Accepting the file selector will run the operators ``execute`` callback.