I'm writing an addon that generates a list of categories that I want to set in an enum property. The enum property is defined as such:
class PipelineProperties(bpy.types.PropertyGroup):
asset_categories = bpy.props.EnumProperty(
name="Asset Categories",
description="Categories for Project Specific Assets",
items=[
('init', 'init', 'test', 0)
]
)
def register():
bpy.types.Scene.pipe = bpy.props.PointerProperty(name='Pipeline Properties', type=PipelineProperties)
bpy.utils.register_module(__name__)
def unregister():
bpy.utils.unregister_module(__name__)
del bpy.types.Scene.pipe
The enum property is accessed by:
bpy.context.scene.pipe.asset_categories
Here is the code where I assign a new value to this enum property:
scn = bpy.context.scene
scn.pipe.asset_categories = bpy.props.EnumProperty(
name='Asset Categories',
description='Testing',
items=[('new', 'new', 'test value', 0)]
)
Here is the error message:
scn.pipe.asset_categories = bpy.props.EnumProperty(as_name_list)
TypeError: bpy_struct: item.attr = val: expected a string enum, not tuple
What is this error and why am I getting it? How would I go about setting the value of the enum property I have defined to something else?