Skip to main content
2 of 2
edited title
Gorgious
  • 33.3k
  • 2
  • 54
  • 107

How can I copy builtin enum items in a new property?

A problem I often encounter when making a custom operator is that I must create properties that mirror properties already in Blender. If these properties are floats or ints or strings, it's no big deal, but if they are enums, it's a pain (literally, I've got arthritis).

For example, if I want to create a cube and then add a bevel modifier, the bevel modifier has an "offset_type" property, which is an enum.

I can of course create an enum that mirrors the options in the native enum, but is it possible to somehow to access the enum that must already exist somewhere in Blender? I would have an "register/undo" properties panel populated by a draw function.

# in my draw function, # instead of this: layout.prop(self, 'my_offset_enum') # I'd like to do something like: layout.prop(bpy.some_class_in_blender, "blenders_offset_enum")