I need all modifiers list as my custom enum value, i only know to write this by hand, here for example:

tp_mod = bpy.props.EnumProperty(
    name= "Slect by type",
        ('SUBSURF', "Subdivision", ""),
        ('BEVEL', "Bevel", ""),
        ('MIRROR', "Mirror", ""),
        #AND SO ON..

is there anyway the best way to get all modifier as a enum value? in other word how to make "Add Modifiers" panel as template for enum ?


All available via blenders rna.

The type property of the modifier is an enum, can look up its definition via blenders "rna" system on the class, in this case bpy.types.Modifier.bl_rna

import bpy
from bpy.types import Modifier

for item in Modifier.bl_rna.properties['type'].enum_items:
    print(item.identifier, item.name, item.description, item.icon)


DATA_TRANSFER Data Transfer Transfer several types of data (vertex groups, UV maps, vertex colors, custom normals) from one mesh to another MOD_DATA_TRANSFER
MESH_CACHE Mesh Cache Deform the mesh using an external frame-by-frame vertex transform cache MOD_MESHDEFORM
MESH_SEQUENCE_CACHE Mesh Sequence Cache Deform the mesh or curve using an external mesh cache in Alembic format MOD_MESHDEFORM
NORMAL_EDIT Normal Edit Modify the direction of the surface normals MOD_NORMALEDIT
WEIGHTED_NORMAL Weighted Normal Modify the direction of the surface normals using a weighting method MOD_NORMALEDIT
UV_PROJECT UV Project Project the UV map coordinates from the negative Z axis of another object MOD_UVPROJECT
UV_WARP UV Warp Transform the UV map using the difference between two objects MOD_UVPROJECT
VERTEX_WEIGHT_EDIT Vertex Weight Edit Modify of the weights of a vertex group MOD_VERTEX_WEIGHT
VERTEX_WEIGHT_MIX Vertex Weight Mix Mix the weights of two vertex groups MOD_VERTEX_WEIGHT
VERTEX_WEIGHT_PROXIMITY Vertex Weight Proximity Set the vertex group weights based on the distance to another target object MOD_VERTEX_WEIGHT
ARRAY Array Create copies of the shape with offsets MOD_ARRAY
BEVEL Bevel Generate sloped corners by adding geometry to the mesh's edges or vertices MOD_BEVEL
BOOLEAN Boolean Use another shape to cut, combine or perform a difference operation MOD_BOOLEAN
BUILD Build Cause the faces of the mesh object to appear or disappear one after the other over time MOD_BUILD
DECIMATE Decimate Reduce the geometry density MOD_DECIM

etc, etc

Example of using math node type enum to create operator. How to get custom menu items show up in the search bar?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.