Passepartout N-Panel Slider

Add a Passepartout Slider in the N-Panel

Here a little start-up script that'll add a passepartout slider to the N-panel in the 3d view workspace. This is a lot faster than digging through menus and finally realizing its part of the camera options. Save yourself time.

bl_info = {
    "name": "Passepartout Slider in 3D View N-Panel",
    "author": "Richard Bourque",
    "version": (1, 0),
    "blender": (3, 0, 0),
    "location": "3D View > N-panel > View",
    "category": "3D View",
}

import bpy


def draw_passepartout_slider(self, context):
    layout = self.layout
    space = context.space_data

    # use local camera if set, otherwise scene camera
    cam = getattr(space, "camera", None) or context.scene.camera
    if not cam or cam.type != 'CAMERA':
        return

    camd = cam.data
    col = layout.column(align=True)
    col.prop(camd, "passepartout_alpha", text="Passepartout", slider=True)


def register():
    bpy.types.VIEW3D_PT_view3d_properties.append(draw_passepartout_slider)


def unregister():
    bpy.types.VIEW3D_PT_view3d_properties.remove(draw_passepartout_slider)


if __name__ == "__main__":
    register()

You CAN paste this into the text editor in Blender and hit the run button. But a better method is to add it directly to the start-up folder of Blender and it'll automatically run this script on every time you start Blender. You Can find that here:

%APPDATA%\Blender Foundation\Blender\<blender version>\scripts\startup\

You might need to create the scripts and startup folder yourself.

You'll need to paste this text into a text editor. Notepad is fine. Or Visual Code Studio. You then save the file and change the file extension to ".py". Put the file in the above mentioned folder and Bob's your uncle.

For the sake of transparency, this was made entirely with ChatGPT. I DO NOT HOW TO CODE.


Or skip copy and pasting and just download the .py file below.