[Addon] Backface hiding

@Bracer Just so you know, when it comes to the usual character retopology, there are better add-ons, although not completely free. For example mine doesn’t play well with the mirror modifier, which is something that would require a different approach in how the add-on works.
Also, depending on your situation, not all geometry behind the area you’re working on may be turning its back from you (e.g. a finger behind another finger), so “Hide Backfacing” won’t be of much help on it.

Draw X-ray has that other approach. It addresses both of these issues and works in a continuous way (no refresh needed). It costs a minimum of 0$. However, it doesn’t support multi-object editing and while hiding everything you don’t want to see, it doesn’t prevent you from selecting it accidentally and moving it without realizing it. So there’s a compromise to make.

Then there is the awesome Retopoflow which still has to be updated to work on Blender 2.8 but when it’s out it will probably be the best retopology add-on for blender.

My add-on can however be more useful in other modeling situations, such as :

  • modeling without a high-poly reference
  • seeing the parts of a mesh where you should not bother adding details if your camera is fixed, since you can move around while keeping the same geometry hidden.

Sorry I’m discovering blender 2.8 and currently hating it…
I installed your needed addon but don’t find how to use it, where is the menu located ?

Hi,
as for any other add-on, the location is indicated when you expand its properties:

:information_source: Note: Sidebar means the region on the right that you open and close with “N”

:information_source: Other note: You have to be in Edit mode for it to appear since that’s the only mode in which the add-on operates

I hope you get to like Blender more as you learn.

I like blender, but 2.8 not really currently…
OK, it seems that I don’t have the good version of you plugin (0.3)…

1 Like

Ok, I found the 0.4 version, and now it appears, thank you for this tool !

1 Like

Hi, would you mind creating a small custom version for me ?
You don’t have to remove any code, just comment out the buttons.
I don’t need the “Hide Occluded”, it’s annoying that it is there and I might click it.
I don’t need the “Reveal & Restore Selection.”

The whole idea of using this add-on is to be able to enter into this mode to select what I want, to accidentally click on that button to return to some useless selection BEFORE I go into this mode to select what I actually want to select which is the whole point of me going into this mode in the first place is incomprehensible.

So all in all, please keep only “Hide Backfacing” and “Reveal and Keep Selection” remove the other two, thanks :smiley:

@Bracer Let’s see a few things:

  • Did you know the add-on has customizable keyboard shortcuts for these buttons? They are in the add-on’s preferences. Maybe this could help you avoid accidental clicks and improve efficiency in the process.
  • Did you also know that all of these operators/buttons have the Undo function enabled? If you accidentally click on the wrong one, you can hit Ctrl+Z (I will give you that it can be slow on large scenes and Blender’s Undo system is in dire need of revamping)

That doesn’t mean you never want to get your previous selection back.

I’d rather make an official update that would prevent anyone else from having the same problem as you than make custom versions for different people, so right now I added a space between those 2 categories of buttons.
For some reason there is either a delay between my update and the zip file update or a bug on Gitlab’s side preventing my update to be propagated to the zip download. So right now I recommend you just download this file and put it in replacement of the existing one and I will check later if the zip got updated on Gitlab.
sidePanel.py (821 Bytes)
After replacing the file, you should see the separator in the side panel. If that separator is too small for you, you can enlarge it by opening sidePanel.py and setting the factor to a higher value, such as:

layout.separator(factor=5.0)

If you really prefer to remove the 2 reveal buttons, you can simply delete the 2 lines below the separator.
The buttons will be gone but their associated operators will still be accessible through their keyboard shortcut or an F3 search.

it should.
Also I confirm it was just a delay and not a bug on Gitlab, so now you can download the zip and install it from Blender directly (make sure to remove your already installed version).

If it still doesn’t work, can you provide me your Blender version and OS ?

Hi, I have managed to download and install the new version, I don’t think I get my point across, let me show a diagram here:
ewrwer
Especially the offensive third button.
If I really want to do that I will just press undo until that happens, the whole reason I use this addon is to be able to select front facing.
The third button basically says “Hey you want to select what you previously selected before you enter this mode to select a new selection ? Ok…oh by the way…let me give you a hint, why not not use this add-on in the first place so that you do not have to go into this add-on to select something only to not select it when you are out of it ?”

I understand your point. There is an issue with the “Restore Selection” button which I’ve mentioned a while ago and it’s in my todo list:

I still think this would be a more logical way to approach the reveal feature (feel free to give your opinion on it) but I won’t have time to code this idea until my next holidays (in may).

As for the “Hide occluded”, I find it useful sometimes. It’s true that it’s not actually using face normals but the effect is similar, yet sometimes better adapted to a situation, sometimes less. If you find yourself accidentally clicking on that one, maybe I should add a separator there too. I gave them different icons to better differentiate them but monochromatic and minimalistic icons are not so differentiable, so I guess I’ll space out the buttons some more.

In the mean time, you can remove whichever button you want by opening sidePanel.py and commenting the corresponding layout.operator line with a # at the beginning and you can add a separator just like I did between any 2 buttons and give it any factor value.

Pablo made an interesting feature in sculpt mode, to auto hide/show faces off screen for performance.

I wonder if there’s a way to use that, but do it for backfacing, so that it calculates, not necessarily in realtime, but near realtime/still automatic as u rotate/move the model. So the user doesn’t have to constantly be hiding/showing stuff/etc.

Edit: I wonder if can use a Timer, and check which face normals are within a certain angle of view from projected view/camera direction… Or within certain threshold facing the view/camera… Altho, for highpoly meshes, I wonder how that will perform, or how Pablo does it. Might be easier in his case, since is sorta clipping off from the projected view frustum or whatever, and not checking face normals. But who knows. Also that’s C/C++ so much faster than Python I’m sure.

I tried searching for the keyword “layout.operator” and I couldn’t find it.
I just want this add-on to have only two buttons, hide to clean up the visuals, and restore KEEPING the selection that was selected while I enter into this add-on.

The fact that there are four buttons makes one have to “stop and think” everytime to make sure the correct button is press, if only it was straight forward and no nonsense…better yet if the two buttons are named “hide” and “show”.

If only it could be that straight forward…

There are only 22 lines of code in that file. Again, they’re in sidePanel.py.
If you don’t know where your add-on files are, find the add-on directory that corresponds to your OS.

So, normally:

  • Windows:
    C:\User\YourName\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons
  • Linux:
    ~/.config/blender/2.82/scripts/addons
  • Mac:
    /Users/$USER/Library/Application Support/Blender/2.82/scripts/addons

Thank you Thank you Thank you !
Now I have edited it so that it just works !
This add-on now just works without the visual bloat, thank you ! It just works now and get out of your way ! No third fourth and future fifth button, just two, simple, straight to the point and it just works.
THANK YOU @ChameleonScales !!!

If anyone want this modified two button no nonsense version, download it here:
BackfaceHiding.zip (6.5 KB)

When you click show, all hidden polygons will be shown and the selection made while you are in the mode will still retain, the original four button configuration have an option that…wait a minute…nobody cares or ask for it, so here, the only two buttons that we all wish it to be.

3 Likes

The “Hide Occluded” button hides everything that’s off-screen (and onscreen but occluded, obviously), and it performs faster than the backfacing one, although I could improve the latter to catch up on it.
As for real-time or semi real-time, I honestly don’t know if it can be done with python and that’s the only language I know anything about.

1 Like

Hey I found a simple way to achieve this. Just use instance copy, put in front and hide backfaces

Sorry I don’t get it. Can you explain in more detail?
What did you achieve?
What kind of instance are you talking about? There are many kinds and they behave differently.
What do you mean by “putting in front” and by “hiding backfaces”? There are several ways to do those things.

https://www.youtube.com/watch?v=MeWTLwXr2VQ&feature=youtu.be

First 2 minutes I show here. Its not perfect, but its much better than having backfaces visible.
I couldn’t find anything on the net that would solve this issue, but not sure, maybe this is a known fact

Tested on Blender 2.83.5 and Blender 2.91 alpha with Backface Hiding 0.4:

After pressing F5 :

Python: Traceback (most recent call last):
File “C:\Users\Sebastien\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\Backface_Hiding-master\operatorsList.py”, line 97, in execute
bpy.ops.mesh.store_selection()
File “E:\blender_dailybuild\bin\2.91\scripts\modules\bpy\ops.py”, line 201, in call
ret = op_call(self.idname_py(), None, kw)
RuntimeError: Operator bpy.ops.mesh.store_selection.poll() failed, context is incorrect>
location: :-1

Duly noted. I’ll fix it asap.