user: What is Bpy.Types.Filehandler and how is it used in Blender Python scripting?

assistant: llectionProperty ( type = bpy . types . OperatorFileListElement , options = { &#39;SKIP_SAVE&#39; , &#39;HIDDEN&#39; }) # Allow the user to choose whether the node&#39;s label is set or not set_label : bpy . props . BoolProperty ( name = "Set Label" , default = False ) @classmethod def poll ( cls , context ): return ( context . region and context . region . type == &#39;WINDOW&#39; and context . area and context . area . ui_type == &#39;ShaderNodeTree&#39; and context . object and context . object . type == &#39;MESH&#39; and context . material ) def execute ( self , context ): # The directory property must be set. if not self . directory : return { &#39;CANCELLED&#39; } x = 0.0 y = 0.0 for file in self . files : # Direct calls to this Operator may use unsupported file-paths. Ensure the incoming # files are ones that are supported. if file . name . endswith ( ".txt" ): import os filepath = os . path . join ( self . directory , file . name ) node_tree = context . material . node_tree text_node = node_tree . nodes . new ( type = "ShaderNodeScript" ) text_node . mode = &#39;EXTERNAL&#39; text_node . filepath = filepath text_node . location = Vector (( x , y )) # Set the node&#39;s title to the file name. if self . set_label : text_node . label = file . name x += 20.0 y -= 20.0 return { &#39;FINISHED&#39; } # Use ImportHelper&#39;s invoke_popup() to handle the invocation so that this operator&#39;s properties # are shown in a popup. This allows the user to configure additional settings on the operator # like the `set_label` property. Consider having a draw() method on the operator in order to # layout the properties in the UI appropriately. # # If filepath information is not provided the file select window will be invoked instead. def invoke ( self , context , event ): return self . invoke_popup ( context ) # Define a file handler that supports the following set of conditions: # - Execute the `shader.script_import` operator # - When `.txt` files are dropped in the Shader Editor class SHADER_FH_script_import ( bpy . types . FileHandler ): bl_idname = "SHADER_FH_script_import" bl_label = "File handler for shader script node import" bl_import_operator = "shader.script_import" bl_file_extensions = ".txt" @classmethod def poll_drop ( cls , context ): return ( context . region and context . region . type == &#39;WINDOW&#39; and context . area and context . area . ui_type == &#39;ShaderNodeTree&#39; ) bpy . utils . register_class ( ShaderScriptImport ) bpy . utils . register_class ( SHADER_FH_script_import ) base class — bpy_struct subclasses — IMAGE_FH_drop_handler , IO_FH_gltf2 , IO_FH_svg_as_curves , NODE_FH_image_node , SEQUENCER_FH_image_strip , SEQUENCER_FH_movie_strip , SEQUENCER_FH_sound_strip , VIEW3D_FH_camera_background_image , VIEW3D_FH_empty_image , VIEW3D_FH_vdb_volume class bpy.types. FileHandler ( bpy_struct ) ¶ Extends functionality to operators that manages files, such as adding drag and drop support bl_export_operator ¶ Operator that can handle export for files with the extensions given in bl_file_extensions Type : string, default “”, (never None) bl_file_extensions ¶ Formatted string of file extensions supported by the file handler, each extension should start with a “.” and be separated by “;”. For Example: ".blend;.ble" Type : string, default “”, (never None) bl_idname ¶ If this is set, the file handler gets a custom ID, otherwise it takes the name of the class used to define the file handler (for example, if the class name is “OBJECT_FH_hello”, and bl_idname is not set by the script, then bl_idname = “OBJECT_FH_hello”) Type : string, default “”, (never None) bl_import_operator ¶ Operator that can handle import for files with the extensions given in bl_file_extensions Type : string, default “”, (never None) bl_label ¶ The file handler label Type : string, default “”, (never None) classmethod poll_drop ( context ) ¶ If this method returns True, can be used to handle the drop of a drag-and-drop action Return type : boolean classmethod bl_rna_get_subclass ( id , default = None , / ) ¶ Parameters : id ( str ) – The RNA type identifier. Returns : The RNA type or default when not found. Return type : bpy.types.Struct subclass classmethod bl_rna_get_subclass_py ( id , default = None , / ) ¶ Parameters : id ( str ) – The RNA type identifier. Returns : The class or default when not found. Return type : type Inherited Properties ¶ bpy_struct.id_data Inherited Functions ¶ bpy_struct.as_pointer bpy_struct.driver_add bpy_struct.driver_remove bpy_struct.get bpy_struct.id_properties_clear bpy_struct.id_properties_ensure bpy_struct.id_properties_ui bpy_struct.is_property_hidden bpy_struct.is_property_overridable_library bpy_struct.is_property_readonly bpy_struct.is_property_set bpy_struct.items bpy_struct.keyframe_delete bpy_struct.keyframe_insert bpy_struct.keys bpy_struct.path_from_id bpy_struct.path_from_module bpy_struct.path_resolve bpy_struct.pop bpy_struct.property_overridable_library_set bpy_struct.property_unset bpy_struct.rna_ancestors bpy_struct.type_recast bpy_struct.values Next FileSelectEntry(bpy_struct) Previous FileBrowserFSMenuEntry(bpy_struct) Copyright &#169; Blender Authors Made with Furo Report issue on this page On this page FileHandler(bpy_struct) Basic FileHandler for importing a single file FileHandler for Importing multiple files and exposing Operator options FileHandler FileHandler.bl_export_operator FileHandler.bl_file_extensions FileHandler.bl_idname FileHandler.bl_import_operator FileHandler.bl_label FileHandler.poll_drop() FileHandler.bl_rna_get_subclass() FileHandler.bl_rna_get_subclass_py() Inherited Properties Inherited Functions