Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when drawing C shape stroke #1352

Closed
jlampel opened this issue Nov 25, 2024 · 3 comments
Closed

Error when drawing C shape stroke #1352

jlampel opened this issue Nov 25, 2024 · 3 comments
Labels
Milestone

Comments

@jlampel
Copy link
Member

jlampel commented Nov 25, 2024

I don't necessarily expect this stroke shape to be supported, but when trying it out I got a freeze and an error:

image

The extra little straight line at the end of the stroke near the brush was added during the error and was not part of the initial gesture. I started at the bottom left vertex and moved right and up. Doing the same gesture in the opposite direction does not produce the error.

Python: Traceback (most recent call last):
  File "C:\Users\Jonathan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\retopoflow\retopoflow\rfcore.py", line 422, in modal
    RFCore.handle_update(context, event)
  File "C:\Users\Jonathan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\retopoflow\retopoflow\rfcore.py", line 234, in handle_update
    if brush: brush.update(context, event)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Jonathan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\retopoflow\retopoflow\rfbrushes\strokes_brush.py", line 179, in update
    self.operator.process_stroke(context, self.stroke, self.stroke_cycle, self.snap_bmv0, self.snap_bmv1)
  File "C:\Users\Jonathan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\retopoflow\retopoflow\rftool_strokes\strokes.py", line 116, in process_stroke
    logic = Strokes_Logic(context, stroke, cycle, snap_bmv0, snap_bmv1, self.span_insert_mode, self.initial_cut_count, RFTool_Strokes.rf_brush.radius)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Jonathan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\retopoflow\retopoflow\rftool_strokes\strokes_logic.py", line 234, in __init__
    self.insert()
  File "C:\Users\Jonathan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\retopoflow\retopoflow\rftool_strokes\strokes_logic.py", line 260, in insert
    self.insert_equals()
  File "C:\Users\Jonathan\AppData\Roaming\Blender Foundation\Blender\4.2\scripts\addons\retopoflow\retopoflow\rftool_strokes\strokes_logic.py", line 511, in insert_equals
    bmf = self.bm.faces.new((bmv00, bmv01, bmv11, bmv10))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: faces.new(...): 0 BMVert has been removed
@jlampel jlampel added bug v4 Applies to RF version 4x labels Nov 25, 2024
@jlampel jlampel changed the title Error when drawing L shape stroke Error when drawing C shape stroke Nov 25, 2024
@jlampel jlampel added this to the v4.0 milestone Dec 5, 2024
@vxlcoder
Copy link
Contributor

I haven't implemented C-shapes, yet, but it's not crashing now.

Question: you seem to have edges selected at top and a single vert at bottom-left. Do you think this is how Strokes should determine if it is a C-shape fill?

detecting corners is always a bit tricky, especially with stroke smoothing enabled. But we could potentially detect if one end of stroke hovers the selected edges (top-right) and one end of stroke hovers another vert (bottom-left), which doesn't necessarily need to be selected but could be along an edge strip that connects to an opposite end that was hovered and selected... then we could find the sharpest corner in the stroke and declare it the corner. (so, in other words, first detect how things are connected to selected based on hover first, then find the corner)

@vxlcoder
Copy link
Contributor

commit fdb29be should have this working now!

note: only select either the top edge or the left edge

@jlampel
Copy link
Member Author

jlampel commented Dec 19, 2024

Even better than not crashing, this works great!

@jlampel jlampel closed this as completed Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants