0
$\begingroup$

I'm working on an addon that works in edit mode. The user must select two faces, and the addon produces a curved, loopy "handle" that connects the faces together. In addition, the user must select two vertices, one adjacent to each face. This determines how the vertices of the two faces are correlated and allows adding a twist to the handle. This is a port of a feature from an obscure research modeling program called TopMod, and you can read more about this feature in the paper "Interactive Construction of Multi-Segment Curved Handles" by V. Srinivasan et al. See also How do I do topmod style loops in Blender?

Blender has modes for selecting faces and for selecting vertices, but you can't have both modes at once. To work around this, my current strategy is to define two operators. The first is called "Select Faces for Handle" and requires exactly two faces to be selected. When run, it stores those two faces in the global state of the addon. The second is called "Make Handle" and requires two vertices to be selected (possibly just one if the faces share a vertex). "Make Handle" reads the two stored and now deselected faces, checks to see that the vertices are adjacent to the faces, and constructs the handle.

I have everything working, but the workflow is pretty awkward, and when deselecting the faces it's easy to lose track of where they were.

Within the constraints of an addon, what would be the most user-friendly way to have a user select both faces and vertices in a single operation?

$\endgroup$
3
  • $\begingroup$ You can certainly have (and use) both modes selected at once although I've no idea how you would do that with Python. Click on the top-left Vertices icon then Shift-click the Faces icon. $\endgroup$
    – John Eason
    Dec 7, 2022 at 22:46
  • $\begingroup$ @JohnEason Didn't know that, but when I select a face it selects all the adjacent vertices as well, when I want the user to pick exactly one per face. $\endgroup$
    – wwww
    Dec 8, 2022 at 0:04
  • $\begingroup$ Yes. It would do if you have both activated. I doubt you can select a face without the associated vertices. $\endgroup$
    – John Eason
    Dec 8, 2022 at 0:42

0

You must log in to answer this question.

Browse other questions tagged .