I can't understand how to get the value of an EnumProperty outside this operator. This is an example with the panel where I would like to show the current value of this EnumProperty:
class SearchEnumOperator(bpy.types.Operator):
bl_idname = "object.search_enum_operator"
bl_label = "Search Enum Operator"
bl_property = "my_search"
my_search: EnumProperty(
name="My Search",
items=(
('FOO', "Foo", ""),
('BAR', "Bar", ""),
('BAZ', "Baz", ""),
),
)
def execute(self, context):
self.report({'INFO'}, "Selected:" + self.my_search)
return {'FINISHED'}
def invoke(self, context, event):
context.window_manager.invoke_search_popup(self)
return {'RUNNING_MODAL'}
class CustomMenu(bpy.types.Menu):
bl_label = "Custom Menu"
bl_idname = "OBJECT_MT_custom_menu"
def draw(self, context):
layout = self.layout
###Noob example:
#layout.label(text = SearchEnumOperator.my_search)<---------?
layout.operator_menu_enum(or whatever it's called consult docs) as shown somewhat in https://blender.stackexchange.com/a/102157/15543 Might also need to have REGISTER in operator bl_options for it to show up in last operator used. – batFINGER May 25 '20 at 10:23