I'm developing a script where I need to retrieve the available values of some EnumProperties
in Blender. I found a similar question already answered here. However, for some reason, this approach does not work with the property bpy.context.scene.render.engine
.
Here is the code I am using, based on the provided answer by @ideasman42:
import bpy
def enum_members_from_type(rna_type, prop_str):
prop = rna_type.bl_rna.properties[prop_str]
return [e.identifier for e in prop.enum_items]
def enum_members_from_instance(rna_item, prop_str):
return enum_members_from_type(type(rna_item), prop_str)
# Test the functions above:
enum = enum_members_from_instance(bpy.context.scene.render, "engine")
print(enum)
The problem is that it returns only this value:
['BLENDER_EEVEE']
I am expecting to get all possible render engine values like CYCLES
, BLENDER_EEVEE
, etc. Could anyone help me understand why this is happening and how I can retrieve all possible values for bpy.context.scene.render.engine
?
Thank you!
Additional Information:
- Blender Version: 4.1.0 (also tried 3.5)
- OS: Windows 11