CGCookie / retopoflow

A suite of retopology tools for Blender
2.48k stars 249 forks source link

Add support or Triangle > Quad when single vert is selected, clicking to edge #215

Closed carter2422 closed 8 years ago

carter2422 commented 8 years ago

When creating an initial triangle we are left with the face and the last vert selected, typically one more CTRL+Click will give us a quad. However, in the below scenario we should support clicking on either edge or the vert of the adjacent face, but only the vert is supported.

http://cl.ly/fFqw

http://cl.ly/fFet

Clicking on the edge, like shown in the first screenshot gives this error:

EXCEPTION (<class 'ValueError'>): faces.new(...): found the same (BMVert) used multiple times
         /Users/jonathanwilliamson/Dropbox (Personal)/blenderDev/addons/cgCookie/scripts/addons/retopoFlow/op_polypen/polypen_modal.py
000 0594:create_face() bmf = self.tar_bmesh.faces.new(lbmv)
001 1012:handle_bridge_nearest() bmf = self.create_face([bmv0, bmv1, bmv2, bmv3])
002 0903:handle_action_selface() return self.handle_bridge_nearest(context, eventd)
003 0710:handle_action() return self.handle_action_selface(context, eventd)
004 0369:modal_wait() return self.handle_action(context, eventd)
         /Users/jonathanwilliamson/Dropbox (Personal)/blenderDev/addons/cgCookie/scripts/addons/retopoFlow/modaloperator.py
005 0223:modal_main() nmode = self.FSM['wait'](context, eventd)
006 0276:modal() nmode = self.FSM[self.fsm_mode](context, eventd)
carter2422 commented 8 years ago

@vxlcoder that works quite well!

The only issue I find is the final selection: http://cl.ly/fH5T

The problem is that after filling the face all edges connected to the vert become selected.

http://cl.ly/fH0J http://cl.ly/fGxV http://cl.ly/fGWP

Based on current testing I think we should only select the new edge (and the vert); this one: http://cl.ly/fGbI

This would then make it consistent with other operations, whereby we select the new geometry, but leave old unselected.

carter2422 commented 8 years ago

@gfx this seems to be working great now! I'll test a bit more thoroughly but seems very promising (including the fix for the double edges).