I'm using the background image from the camera settings, and the back/front + alpha settings make it reasonably easy to see how I match the reference image. But it'd be much nicer if I could toggle while sculpting (here I need to select the camera first to play with the visibility). Is there a blender 2.8 equivalent to the neat trick with the layers?
I don't know if it's the best way, but it will achieve what you are trying to do.
Use collections. Create a new collection called Background Images. When you create the background image, it will show in you file browser. Put it in you new collection.
Now pull up an info panel. Toggle the background image off. The image toggle will show you the python code to toggle it on and off.
Now this guy shows you how to use that code to make your own custom button which I think you could tie a hot key to. https://www.youtube.com/watch?v=IUkofDrGd9o
Here is an alternative way to do this:
Like kkeenan18 said, put the Background Image in a separate Collection.
Now, in Object Mode there is a shortcut to hide/un-hide a Collection. You want to add that functionality in Sculpt Mode.
Go to Edit > Preferences > Keymap > 3D View > Object Mode > Object Mode (Global) > Hide Collection. Open that:
Now scroll down to Sculpt > Sculpt (Global) and at the bottom click + Add New.
Open that and in the black field, where it says none, write 'object.hide_collection'.
Assign any shortcut you like there, as long as it's not in use yet in Sculpt Mode...
This looks like a better answer, but I'm having some problems.
1. I'm not sure why I'm opening object mode above. I don't see that any editing of the preferences there.
2. In the sculpting section I've made those changes, except a problem occurs when I try to use the shortcut. It hides the wrong collection. Although I pick the collection with the image in the shortcut popup window it hides the collection with the default cube.
I set up my test blend file this way:
a. I use the default cube in the default collection.
b. I add a new collection and switch to it. I add the background image in that new collection.
c. I edit the preferences according to your instructions above.
As to problem 1; You don't actually need to open the object mode, that was just to show you how it is done there;)
And 2: Look at the field with the Collection Index, where it says 2 in the example. That means that the second collection will be hidden. (See also in the Object Mode are, where there are several entries called 'Hide Collection'.
I created three collections to test this. Each I renamed to Red, Blue, and Green. Each contains a cube colored red, blue and green respectively. When I press the hot key that gives the menu I choose the collection to hide. It does not hide the chosen collection. In fact it hides all other collections instead.
I understand you point that a collection can be targeted for a hot key, but the same behaviour persists. Is this how it supposed to work? Hide all other collections not the one chosen from menu or the collection with the hot key assigned to it?
Even in factory settings in object mode if I press Ctrl H and choose from three collections it does not hide the chosen one but instead all others.
kkeenan18 it does have some strange behavior, but if you check 'Toggle' it toggles the visibility of the chosen collection.
Except if one of the objects in that collection is the one in sculpt mode (which won't be the case for you, as you only have background image(s) in there), then it just hides that collection, but doesn't turn the visibility back on.
@keeenan18Yes, that was very helpful!
You set the shortcut to CTRL numpad 2 and then tried to access it through ALT numpad 2.
As far as I can tell, you did everything right otherwise.
spikeyxxx thanks for this alternative, I'll definitely use it as well, as soon as I get it to work fully :)
When I configure the key with collection index -1, I get a popup asking for the collection to hide, but I need to click Shift to actually hide it. Also once hidden, the shortcut doesn't summon the popup anymore :/
When I configure the collection to a different value than -1, nothing happens as far as I can tell.
spikeyxxx Heh, we agree on the theory :) Could it be caused by interactions with plugins & such? Is there a way to open blender in "defaut settings" mode and still being able to go back to the settings I currently have?
Sorry for the confusion. Ok, so I changed it to Alt+Numpad 2 and still getting an unexpected result.
kkeenan18 Maybe if you try a different hotkey, something without ALT?
(F5 to F8 are 'free' unless you are already using them.)
I noticed that you are using a Linux distro and I have experienced that some ALT combinations don't work as hotkeys in Blender, because they are already being used by the OS.
Can't think of anything else;)