Page MenuHome

[Scr-ops] Join any two areas
Needs ReviewPublic

Authored by Ilya Shurupov (Hto-Ya) on Tue, Jun 9, 4:52 PM.
Subscribers
None
Tokens
"Love" token, awarded by ruthwikrao."Yellow Medal" token, awarded by aabrany."Love" token, awarded by johnsyed."Love" token, awarded by akshayxw69."Like" token, awarded by Fracture128.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

That patch joins any two adjacent areas.

How it works:
consider:


join_area func(ar1, ar2) {
First, we see if edges of ar->edge[top] and ar2->edge[top] can align.
If they can we align them and skip to the next two edges, if not we have to make an additional split in order to align.

After the split, we have one new area that we don't want, so we join the new area with any neighbor (ar4 on the picture) right of the new area in range (ar3->v4.y; ar3->v2.y). How do we do that? we call collapse_at_edge()
After that first two edges are aligned and we don't have any additional areas.
So, we do the same procedure with the other two edges (ar1->edge[bottom & ar2->edge[bottom]).

And now we have two perfectly aligned areas ar1 and ar2, so we just join em calling join aligned_areas(ar1, ar2)
}

ALL "//COMMENTED CODE" REQUIRE THAT PATCH https://developer.blender.org/D8114

Diff Detail

Event Timeline

Ilya Shurupov (Hto-Ya) requested review of this revision.Tue, Jun 9, 4:52 PM
Ilya Shurupov (Hto-Ya) created this revision.

Updated patch its just implementation of test

Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)Tue, Jun 9, 5:30 PM
This comment was removed by Ilya Shurupov (Hto-Ya).
source/blender/editors/screen/screen_geometry.c
401

No need in that function anymore, since there is already the same one.
screen_geom_edge_is_movable would be also used by drag resize operator, see https://developer.blender.org/D7946

505

this assignment will fail in terms of the rule "joining all cases that user can join by moving edges" by restricting join. Will be modified soon

527

Select connected edge will be able to mark all verts edit flag, so 'true' means mark, '1' - with value 1

Ilya Shurupov (Hto-Ya) retitled this revision from Area Join: Test if areas can join to Join all areas.Sun, Jun 14, 7:08 PM
Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)

Ok, now u can join all areas. And all areas means any two adjacent areas.
That is all test function

Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)Mon, Jun 15, 10:40 AM
Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)Mon, Jun 15, 12:22 PM
Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)Mon, Jun 15, 3:04 PM
Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)Mon, Jun 15, 3:41 PM
Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)
Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)Wed, Jun 24, 6:23 PM
Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)

No more recursion. That is the whole join function

. Will update patch soon

Now here is just join and align algorithm

Ilya Shurupov (Hto-Ya) retitled this revision from Join all areas to [Scr-ops] Join any two areas.Wed, Jun 24, 11:23 PM
Ilya Shurupov (Hto-Ya) edited the summary of this revision. (Show Details)