I'm trying to make an enum property that just has 3 options. I compared it with the custom node space example that blender has but it still won't work. aside from this, I would like to be able to call what the value of the enum is at any time on a driver that would control an object's visibility. if that is too much for one question then I just need to get the enum to work. my code is below
import bpy
from bpy.types import Panel
class enumTesting(bpy.types.Panel):
bl_space_type = 'VIEW_3D'
bl_region_type = 'UI'
bl_label = "Enum"
bl_idname = "en"
bl_category = 'EnumTest'
mouth=(
('1', '01', 'still 1'),
('2', '02', 'still 2'),
('3', '03', 'still 3'),
)
enum_prop: bpy.props.EnumProperty(
name='enu',
description="ok",
items=mouth,
default='1',
)
def draw(self, context):
layout = self.layout
col = layout.column()
row = col.row()
row.prop(context.scene, 'enum_prop', text="")
classes = [enumTesting]
def register():
for c in classes:
bpy.utils.register_class(c)
def unregister():
for c in classes:
bpy.utils.unregister_class(c)
if __name__ == '__main__':
register()