Fix T90866: Python operator templates are not accessible from menus
Python Operator templates made accessible from respective menus (required to also use F3 search for quick access) Also fixed Modal Draw Operator id_name (had duplicate name from other template) Maniphest Tasks: T90866 Differential Revision: https://developer.blender.org/D13182
This commit is contained in:
@@ -57,13 +57,18 @@ class ViewOperator(bpy.types.Operator):
|
||||
self.report({'WARNING'}, "Active space must be a View3d")
|
||||
return {'CANCELLED'}
|
||||
|
||||
def menu_func(self, context):
|
||||
self.layout.operator(ViewOperator.bl_idname, text = "Simple View Modal Operator")
|
||||
|
||||
# Register and add to the "view" menu (required to also use F3 search "Simple View Modal Operator" for quick access)
|
||||
def register():
|
||||
bpy.utils.register_class(ViewOperator)
|
||||
bpy.types.VIEW3D_MT_view.append(menu_func)
|
||||
|
||||
|
||||
def unregister():
|
||||
bpy.utils.unregister_class(ViewOperator)
|
||||
bpy.types.VIEW3D_MT_view.remove(menu_func)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user