From 92e2f5d3ff269238efa4f1550b9a6661400e95e5 Mon Sep 17 00:00:00 2001 From: Hamnivore Date: Fri, 20 Feb 2026 15:11:54 -0700 Subject: [PATCH] Fix paste as reference for Blender 5.0 `bpy.ops.object.load_reference_image` was removed in Blender 5.0. Replace with `bpy.ops.object.empty_image_add` and manually set the reference image properties (alpha blending and front-only display) to match the original behavior. Co-authored-by: Cursor --- imagepaste/operators.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/imagepaste/operators.py b/imagepaste/operators.py index 6b2e340..23fd6c9 100644 --- a/imagepaste/operators.py +++ b/imagepaste/operators.py @@ -185,7 +185,10 @@ def execute(self, _context): if clipboard.report.type != "INFO": return {"CANCELLED"} for image in clipboard.images: - bpy.ops.object.load_reference_image(filepath=image.filepath) + bpy.ops.object.empty_image_add(filepath=image.filepath) + obj = bpy.context.active_object + obj.use_empty_image_alpha = True + obj.empty_image_side = "FRONT" return {"FINISHED"} @classmethod