user: Show practical ways to work with Wm Operators in a Blender add-on or script – include code.

assistant: ttps://projects.blender.org/blender/blender/src/branch/main/scripts/startup/bl_operators/wm.py#L1167)

bpy.ops.wm.ply_export(*\**, *filepath=''*, *check_existing=True*, *filter_blender=False*, *filter_backup=False*, *filter_image=False*, *filter_movie=False*, *filter_python=False*, *filter_font=False*, *filter_sound=False*, *filter_text=False*, *filter_archive=False*, *filter_btx=False*, *filter_alembic=False*, *filter_usd=False*, *filter_obj=False*, *filter_volume=False*, *filter_folder=True*, *filter_blenlib=False*, *filemode=8*, *display_type='DEFAULT'*, *sort_method=''*, *forward_axis='Y'*, *up_axis='Z'*, *global_scale=1.0*, *apply_modifiers=True*, *export_selected_objects=False*, *collection=''*, *export_uv=True*, *export_normals=False*, *export_colors='SRGB'*, *export_attributes=True*, *export_triangulated_mesh=False*, *ascii_format=False*, *filter_glob='\*.ply'*)
:   Save the scene to a PLY file

    Parameters:
    :   - **filepath** (*string**,* *(**optional**,* *never None**)*) – File Path, Path to file
        - **check_existing** (*boolean**,* *(**optional**)*) – Check Existing, Check and warn on overwriting existing files
        - **filter_blender** (*boolean**,* *(**optional**)*) – Filter .blend files
        - **filter_backup** (*boolean**,* *(**optional**)*) – Filter .blend files
        - **filter_image** (*boolean**,* *(**optional**)*) – Filter image files
        - **filter_movie** (*boolean**,* *(**optional**)*) – Filter movie files
        - **filter_python** (*boolean**,* *(**optional**)*) – Filter Python files
        - **filter_font** (*boolean**,* *(**optional**)*) – Filter font files
        - **filter_sound** (*boolean**,* *(**optional**)*) – Filter sound files
        - **filter_text** (*boolean**,* *(**optional**)*) – Filter text files
        - **filter_archive** (*boolean**,* *(**optional**)*) – Filter archive files
        - **filter_btx** (*boolean**,* *(**optional**)*) – Filter btx files
        - **filter_alembic** (*boolean**,* *(**optional**)*) – Filter Alembic files
        - **filter_usd** (*boolean**,* *(**optional**)*) – Filter USD files
        - **filter_obj** (*boolean**,* *(**optional**)*) – Filter OBJ files
        - **filter_volume** (*boolean**,* *(**optional**)*) – Filter OpenVDB volume files
        - **filter_folder** (*boolean**,* *(**optional**)*) – Filter folders
        - **filter_blenlib** (*boolean**,* *(**optional**)*) – Filter Blender IDs
        - **filemode** (*int in* *[**1**,* *9**]**,* *(**optional**)*) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
        - **display_type** (enum in [`'DEFAULT'`, `'LIST_VERTICAL'`, `'LIST_HORIZONTAL'`, `'THUMBNAIL'`], (optional)) –

          Display Type

          - `DEFAULT`
            Default – Automatically determine display type for files.
          - `LIST_VERTICAL`
            Short List – Display files as short list.
          - `LIST_HORIZONTAL`
            Long List – Display files as a detailed list.
          - `THUMBNAIL`
            Thumbnails – Display files as thumbnails.
        - **sort_method** (*enum in* *[**]**,* *(**optional**)*) – File sorting mode
        - **forward_axis** (enum in [`'X'`, `'Y'`, `'Z'`, `'NEGATIVE_X'`, `'NEGATIVE_Y'`, `'NEGATIVE_Z'`], (optional)) –

          Forward Axis

          - `X`
            X – Positive X axis.
          - `Y`
            Y – Positive Y axis.
          - `Z`
            Z – Positive Z axis.
          - `NEGATIVE_X`
            -X – Negative X axis.
          - `NEGATIVE_Y`
            -Y – Negative Y axis.
          - `NEGATIVE_Z`
            -Z – Negative Z axis.
        - **up_axis** (enum in [`'X'`, `'Y'`, `'Z'`, `'NEGATIVE_X'`, `'NEGATIVE_Y'`, `'NEGATIVE_Z'`], (optional)) –

          Up Axis

          - `X`
            X – Positive X axis.
          - `Y`
            Y – Positive Y axis.
          - `Z`
            Z – Positive Z axis.
          - `NEGATIVE_X`
            -X – Negative X axis.
          - `NEGATIVE_Y`
            -Y – Negative Y axis.
          - `NEGATIVE_Z`
            -Z – Negative Z axis.
        - **global_scale** (*float in* *[**0.0001**,* *10000**]**,* *(**optional**)*) – Scale, Value by which to enlarge or shrink the objects with respect to the world’s origin
        - **apply_modifiers** (*boolean**,* *(**optional**)*) – Apply Modifiers, Apply modifiers to exported meshes
        - **export_selected_objects** (*boolean**,* *(**optional**)*) – Export Selected Objects, Export only selected objects instead of all supported objects
        - **collection** (*string**,* *(**optional**,* *never None**)*) – Source Collection, Export only objects from this collection (and its children)
        - **export_uv** (*boolean**,* *(**optional**)*) – Export UVs
        - **export_normals** (*boolean**,* *(**optional**)*) – Export Vertex Normals, Export specific vertex normals if available, export calculated normals otherwise
        - **export_colors** (enum in [`'NONE'`, `'SRGB'`, `'LINEAR'`], (optional)) –

          Export Vertex Colors, Export vertex color attributes

          - `NONE`
            None – Do not import/export color attributes.
          - `SRGB`
            sRGB – Vertex colors in the file are in sRGB color space.
          - `LINEAR`
            Linear – Vertex colors in the file are in linear color space.
        - **export_attributes** (*boolean**,* *(**optional**)*) – Export Vertex Attributes, Export custom vertex attributes
        - **export_triangulated_mesh** (*boolean**,* *(**optional**)*) – Export Triangulated Mesh, All ngons with four or more vertices will be triangulated. Meshes in the scene will not be affected. Behaves like Triangulate Modifier with ngon-method: “Beauty”, quad-method: “Shortest Diagonal”, min vertices: 4
        - **ascii_format** (*boolean**,* *(**optional**)*) – ASCII Format, Export file in ASCII format, export as binary otherwise
        - **filter_glob** (*string**,* *(**optional**,* *never None**)*) – Extension Filter

bpy.ops.wm.ply_import(*\**, *filepath=''*, *directory=''*, *files=None*, *check_existing=False*, *filter_blender=False*, *filter_backup=False*, *filter_image=False*, *filter_movie=False*, *filter_python=False*, *filter_font=False*, *filter_sound=False*, *filter_text=False*, *filter_archive=False*, *filter_btx=False*, *filter_alembic=False*, *filter_usd=False*, *filter_obj=False*, *filter_volume=False*, *filter_folder=True*, *filter_blenlib=False*, *filemode=8*, *display_type='DEFAULT'*, *sort_method=''*, *global_scale=1.0*, *use_scene_unit=False*, *forward_axis='Y'*, *up_axis='Z'*, *merge_verts=False*, *import_colors='SRGB'*, *import_attributes=True*, *filter_glob='\*.ply'*)
:   Import an PLY file as an object

    Parameters:
    :   - **filepath** (*string**,* *(**optional**,* *never None**)*) – File Path, Path to file
        - **directory** (*string**,* *(**optional**,* *never None**)*) – Directory, Directory of the file
        - **files** (`bpy_prop_collection` of `OperatorFileListElement`, (optional)) – Files
        - **check_existing** (*boolean**,* *(**optional**)*) – Check Existing, Check and warn on overwriting existing files
        - **filter_blender** (*boolean**,* *(**optional**)*) – Filter .blend files
        - **filter_backup** (*boolean**,* *(**optional**)*) – Filter .blend files
        - **filter_image** (*boolean**,* *(**optional**)*) – Filter image files
        - **filter_movie** (*boolean**,* *(**optional**)*) – Filter movie files
        - **filter_python** (*boolean**,* *(**optional**)*) – Filter Python files
        - **filter_font** (*boolean**,* *(**optional**)*) – Filter font files
        - **filter_sound** (*boolean**,* *(**optional**)*) – Filter sound files
        - **filter_text** (*boolean**,* *(**optional**)*) – Filter text files
        - **filter_archive** (*boolean**,* *(**optional**)*) – Filter archive files
        - **filter_btx** (*boolean**,* *(**optional**)*) – Filter btx files
        - **filter_alembic** (*boolean**,* *(**optional**)*) – Filter Alembic files
        - **filter_usd** (*boolean**,* *(**optional**)*) – Filter USD files
        - **filter_obj** (*boolean**,* *(**optional**)*) – Filter OBJ files
        - **filter_volume** (*boolean**,* *(**optional**)*) – Filter OpenVDB volume files
        - **filter_folder** (*boolean**,* *(**optional**)*) – Filter folders
        - **filter_blenlib** (*boolean**,* *(**optional**)*) – Filter Blender IDs
        - **filemode** (*int in* *[**1**,* *9**]**,* *(**optional**)*) – File Browser Mode, The setting for the file browser mode to load a .blend file, a library or a special file
        - **display_type** (enum in [`'DEFAULT'`, `'LIST_VERTICAL'`, `'LIST_HORIZONTAL'`, `'THUMBNAIL'`], (optional)) –

          Display Type

          - `DEFAULT`
            Default – Automatically determine display type for files.
          - `LIST_VERTICAL`
            Short List – Display files as short list.
          - `LIST_HORIZONTAL`
            Long List – Display files as a detailed list.
          - `THUMBNAIL`
            Thumbnails – Display files as thumbnails.
        - **sort_method** (*enum in* *[**]**,* *(**optional**)*) – File sorting mode
        - **global_scale** (*float in* *[**1e-06**,* *1e+06**]**,* *(**optional**)*) – Scale
        - **use_scene_unit** (*boolean**,* *(**optional**)*) – Scene Unit, Apply current scene’s unit (as defined by unit scale) to imported data
        - **forward_axis** (enum in [`'X'`, `'Y'`, `'Z'`, `'NEGATIVE_X'`, `'NEGATIVE_Y'`, `'NEGATIVE_Z'`], (optional)) –

          Forward Axis

          - `X`
            X – Positive X axis.
          - `Y`
            Y – Positive Y axis.
          - `Z`
            Z – Positive Z axis.
          - `NEGATIVE_X`
            -X – Negative X axis.
          - `NEGATIVE_Y`
            -Y – Negative Y axis.
          - `NEGATIVE_Z`
            -Z – Negative Z axis.
        - **up_axis** (enum in [`'X'`, `'Y'`, `'Z'`, `'NEGATIVE_X'`, `'NEGATIVE_Y'`, `'NEGATIVE_Z'`], (optional)) –

          Up Axis

          - `X`
            X – Positive X axis.
          - `Y`
            Y – Positive Y axis.
          - `Z`
            Z – Positive Z axis.
          - `NEGATIVE_X`
            -X – Negative X axis.
          - `NEGATIVE_Y`
            -Y – Negative Y axis.
          - `NEGATIVE_Z`
            -Z – Negative Z axis.
        - **merge_verts** (*boolean**,* *(**optional**)*) – Merge Vertices, Merges vertices by distance
        - **import_colors** (enum in [`'NONE'`, `'SRGB'`, `'LINEAR'`], (optional)) –

          Vertex Colors, Import vertex color attributes

          - `NONE`
            None – Do not import/export color attributes.
          - `SRGB`
            sRGB – Vertex colors in the file are in sRGB color space.
          - `LINEAR`
            Linear – Vertex colors in the file are in linear color space.
        - **import_attributes** (*boolean**,* *(**optional**)*) – Vertex Attributes, Import custom vertex attributes
        - **filter_glob** (*string**,* *(**optional**,* *never None**)*) – Extension Filter

bpy.ops.wm.previews_batch_clear(*\**, *files=None*, *directory=''*, *filter_blender=True*, *filter_folder=True*, *use_scenes=True*, *use_collections=True*, *use_objects=True*, *use_intern_data=True*, *use_trusted=False*, *use_backups=True*)
:   Clear selected .blend file’s previews

    Parameters:
    :   - **files** (`bpy_prop_collection` of `OperatorFileListElement`, (optional)) – files
        - **directory** (*string**,* *(**optional**,* *never None**)*) – directory
        - **filter_blender** (*boolean**,* *(**optional**)*) – filter_blender
        - **filter_folder** (*boolean**,* *(**optional**)*) – filter_folder
        - **use_scenes** (*boolean**,* *(**optional**)*) – Scenes, Clear scenes’ previews
        - **use_collections** (*boolean**,* *(**optional**)*) – Collections, Clear collections’ previews
        - **use_objects** (*boolean**,* *(**optional**)*) – Objects, Clear objects’ previews
        - **use_intern_data** (*boolean**,* *(**optional**)*) – Materials & Textures, Clear ‘internal’ previews (materials, textures, images, etc.)
        - **use_trusted** (*boolean**,* *(**optional**)*) – Trusted Blend Files, Enable Python evaluation for selected files
        - **use_backups** (*boolean**,* *(**optional**)*) – Save Backups, Keep a backup (.blend1) version of the files when saving with cleared previews

    File:
    :   [startup/bl_operators/file.py:204](https://projects.blender.org/blender/blender/src/branch/main/scripts/startup/bl_operators/file.py#L204)

bpy.ops.wm.previews_batch_generate(*\**, *files=None*, *directory=''*, *filter_blender=True*, *filter_folder=True*, *use_scenes=True*, *use_collections=True*, *use_objects=True*, *use_intern_data=True*, *use_trusted=False*, *use_backups=True*)
:   Generate selected .blend file’s previews

    Parameters:
    :   - **files** (`bpy_prop_collection` of `OperatorFileListElement`, (optional)) – Collection of file paths with common `directory` root
        - **directory** (*string**,* *(**optional**,* *never None**)*) – Root path of all files listed in `files` collection
        - **filter_blender** (*boolean**,* *(**optional**)*) – Show Blender files in the File Browser
        - **filter_folder** (*boolean**,* *(**optional**)*) – Show folders in the File Browser
        - **use_scenes** (*boolean**,* *(**optional**)*) – Scenes, Generate scenes’ previews
        - **use_collections** (*boolean**,* *(**optional**)*) – Collections, Generate collections’ previews
        - **use_objects** (*boolean**,* *(**optional**)*) – Objects, Generate objects’ previews
        - **use_intern_data** (*boolean**,* *(**optional**)*) – Materials & Textures, Generate ‘internal’ previews (materials, textures, images, etc.)
        - **use_trusted** (*boolean**,* *(**optional**)*) – Trusted Blend Files, Enable Python evaluation for selected files
        - **use_backups** (*boolean**,* *(**optional**)*) – Save Backups, Keep a backup (.blend1) version of the files when saving with generated previews

    File:
    :   [startup/bl_operators/file.py:95](https://projects.blender.org/blender/blender/src/branch/main/scripts/startup/bl_operators/file.py#L95)

bpy.ops.wm.previews_clear(*\**, *id_type={}*)
:   Clear data-block previews (only for some types like objects, materials, textures, etc.)

    Parameters:
    :   **id_type** (enum set in {`'ALL'`, `'GEOMETRY'`, `'SHADING'`, `'SCENE'`, `'COLLECTION'`, `'OBJECT'`, `'MATERIAL'`, `'LIGHT'`, `'WORLD'`, `'TEXTURE'`, `'IMAGE'`}, (optional)) –

        Data-Block Type, Which data-block previews to clear

        - `ALL`
          All Types.
        - `GEOMETRY`
          All Geometry Types – Clear previews for scenes, collections and objects.
        - `SHADING`
          All Shading Types – Clear previews for materials, lights, worlds, textures and images.
        - `SCENE`
          Scenes.
        - `COLLECTION`
          Collections.
        - `OBJECT`
          Objects.
        - `MATERIAL`
          Materials.
        - `LIGHT`
          Lights.
        - `WORLD`
          Worlds.
        - `TEXTURE`
          Textures.
        - `IMAGE`
          Images.

bpy.ops.wm.previews_ensure()
:   Ensure data-block previews are available and up-to-date (to be saved in .blend file, only for some types like materials, textures, etc.)

bpy.ops.wm.properties_add(*\**, *data_path=''*)
:   Add your own property to the data-block

    Parameters:
    :   **data_path** (*string**,* *(**optional**,* *never None**)*) – Property Edit, Property data_path edit

    File:
    :   [startup/bl_operators/wm.py:2136](https://projects.blender.org/blender/blender/src/branch/main/scripts/startup/bl_operators/wm.py#L2136)

bpy.ops.wm.properties_context_change(*\**, *context=''*)
:   Jump to a different tab inside the properties editor

    Parameters:
    :   **context** (*string**,* *(**optional**,* *never None**)*) – Context

    File:
    :   [startup/bl_operators/wm.py:2179](https://projects.blender.org/blender/blender/src/branch/main/scripts/startup/bl_operators/wm.py#L2179)

bpy.ops.wm.properties_edit(*\**, *data_path=''*, *property_name=''*, *property_type='FLOAT'*, *is_overridable_library=False*, *description=''*, *use_soft_limits=False*, *array_length=3*, *default_int=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)*, *min_int=-10000*, *max_int=10000*, *soft_min_int=-10000*, *soft_max_int=10000*, *step_int=1*, *default_bool=(False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False)*, *default_float=(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)*, *min_float=-10000.0*, *max_float=-10000.0*, *soft_min_float=-10000.0*, *soft_max_float=-10000.0*, *precision=3*, *step_float=0.1*, *subtype=''*, *default_string=''*, *id_type='OBJECT'*, *eval_string=''*)
:   Change a custom property’s type, or adjust how it is displayed in the interface

    Parameters:
    :   - **data_path** (*string**,* *(**optional**,* *never None**)*) – Property Edit, Property data_path edit
        - **property_name** (*string**,* *(**optional**,* *never None**)*) – Property Name, Property name edit
        - **property_type** (enum in [`'FLOAT'`, `'FLOAT_ARRAY'`, `'INT'`, `'INT_ARRAY'`, `'BOOL'`, `'BOOL_ARRAY'`, `'STRING'`, `'DATA_BLOCK'`, `'PYTHON'`], (optional)) –

          Type

          - `FLOAT`
            Float – A single floating-point value.
          - `FLOAT_ARRAY`
            Float Array – An array of floating-point values.
          - `INT`
            Integer – A single integer.
          - `INT_ARRAY`
            Integer Array – An array of integers.
          - `BOOL`