2
$\begingroup$

I am following this tutorial for a custom GUI, accessible in the Object Mode, working in Blender 2.8.0. There, I have a several collections with one object comprised of one mesh each. Currently, I hide a whole object cubes_0 via a boolean property show_0_cubes as follows:

bpy.data.collections['cubes_0'].hide_viewport = not mytool.show_0_cubes

Now, I want to hide all faces of the mesh/object that have more than a certain distance from the origin. However, calling face.hide = True does not have any effect in object, but only in edit mode. There, I don't see my GUI. How do I hide certain faces, edges, vertices in Object Mode?

$\endgroup$

2 Answers 2

2
$\begingroup$

Create vertex group of vertices/edges/faces you want to hide. Add Mask modifier, there select vertex group from list and press invert button (<->)

$\endgroup$
1
$\begingroup$

Edit:

To answer your question as far as a know you can't hide faces in object mode, you would need to separate the faces as a separate object and hide that instead and join it again later.

An alternative would be to try to make your GUI visible in edit mode or maybe use a material to represent "hidden", you may even be able to make it transparent and in certain view modes it would essential be hidden.

I'm sorry I couldn't be more helpful.

-

bpy.ops.mesh.hide(unselected=False)

works copy and pasted, just make sure you have your faces, edges or vertices already selected and you're in editmode.

Edit: might also be useful bpy.ops.mesh.reveal(select=True)

$\endgroup$
2
  • 1
    $\begingroup$ ... question does stipulate object mode. $\endgroup$
    – batFINGER
    May 30, 2021 at 14:17
  • $\begingroup$ thank you I missed that, sorry! $\endgroup$ Jun 1, 2021 at 0:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .