bl_info = {
    "name": "Weight Paint Opacity to Header",
    "author": "Amandeep",
    "description": "Move Weight Paint Opacity to the Header",
    "blender": (2, 90, 0),
    "version": (1, 0, 0),
    "warning": "",
    "category": "Object",
}

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTIBILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

import bpy
def drawIntoHeader(self,context):
    layout=self.layout
    layout.separator()
    if context.mode=='PAINT_WEIGHT':
        layout.prop(bpy.context.space_data.overlay,'weight_paint_mode_opacity')

def register():
    bpy.types.VIEW3D_MT_editor_menus.append(drawIntoHeader)
    
def unregister():
    bpy.types.VIEW3D_MT_editor_menus.remove(drawIntoHeader)
if __name__ == "__main__":
    register()

