this will improve the cloth modeling workflow by allowing you to weld only the edges that are used for the sewing forces.
Details
Diff Detail
- Repository
- rB Blender
Event Timeline
Loose edge is a flag used for drawing, currently it's not used for modifier calculation.
There is a risk generated geometry doesn't set this flag, on the other hand many modifiers do set this flag.
If this becomes a problem the flag could be calculated, so this seems OK.
If the intention is to collapse loose edges, the operation is wrong because in this case neighboring loose edges that are not connected are also merged.
One downside of this patch is that most of the KDTree_3d output is being ignored, so BLI_kdtree_3d_balance and BLI_kdtree_3d_calc_duplicates_fast perform many unnecessary heavy operations.
The ideal would be to create a vert_dest_map from scratch by reading only the loose edges.
fixed the syntax error and changed the order of the if test
the KDTree_3d code is in the MOD_WELD_MODE_ALL path so that should never be calculated for the sewing or regular connected modes.
as for creating a vert_dest_map isn't that exactly what the old code did and i just added an additional filter to only collapse loose edges
Oh, it's true! (I compared it to a wrong part in the code).
In this case, the change appears to be reasonable.
This part of the code was made by Henrik Dick, so I'm adding @Henrik Dick (weasel) as a reviewer in case there is more to add.
Thanks for the patch! This is exactly what I wanted to see in the weld modifier.
Codewise, the filter is added in the right place and should work perfectly (didn't test yet).
Adding the option as a new mode seems weird though. I could imagine there will maybe be more filters for which edges to collapse based on other edge bound data (like seam), so adding this filter as a checkbox to connected mode would make more sense to me. Also it's really just connected with a little filter, so the checkbox would be more clear to the user as well, I think.
You could just add a checkbox "Only Loose" with some tooltip related to sewing and name the flag in the background just MOD_WELD_LOOSE, so someone in the future can come along and rename it to "Use Loose" if that is becomes needed to combine multiple filters in a useful manner.
yeah that makes sense to make it just a checkbox in the regular connected mode instead of a separate mode.
Thanks for the patch.
I also added a release note: https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Modeling
Manual still needs to be updated:
https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/weld.html