# Lock a background image from being easily deleted?

The hide/show background image button is just a few pixels to the left of the delete background image button.

When I need to toggle hiding and showing the image (my eyes go off the hide/show button and watch the image alignment with my model), I sometimes hit the delete because my mouse will creep a few pixels to the right. Then I have to load, align, resize, move and rotate the image all over again every time this happens!

Is there an image lock add on, feature or any workaround to stop or prevent this?

• I don't think they can be locked; they could be saved to frame with addon, but that isn't going to change your situation. I think you better off sticking to empty images. Dec 8 '16 at 21:14

There is a way if you are willing to edit Python files in the Blender installation... Go to to the directory Blender/2.78/scripts/startup/bl_ui and edit the file space_view3d.py in a text editor (after you made a backup)

Search for the line

row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i


This is the code that adds the delete button. Add the following line in the front of it:

row.label(text="  ")


This line adds an (invisible) text consisting of two spaces between the eye icon and the delete button. You can change the number of spaces as you like. Result:

And in the future when you upgrade your Blender version, repeat the procedure. Not very convenient, I know :)

• I'm using Blender 2.78a on Elementary OS Loki. I don't have that directory tree you mention. I created startup/bl_ui in scripts and created that file with that code and restarted blender, but it didn't work. Any ideas? Dec 9 '16 at 3:09
• Nevermind, I found it with the help of this question. blender.stackexchange.com/questions/30467/… That tweak works. Thanks. Dec 9 '16 at 3:19