I was just wondering if this should assert BLI_assert(size_ > 0)
. That's because, if the range was empty, it's not well defined what extend_back
does.
Overall looks good. Should be fine to commit once all tests succeed.
Seems fine for now. I guess it would also be nice to solve this more generally and to make retrieving context faster in these common cases? It feels like it should be fairly straight forward to cache the main/scene/... on the context when it has been retrieved the first time. Changes to the context could just invalidate the cache.
The node name thing seems unrelated. I could imagine this causing problems if there are other uiBlock
that happen to have the same name as a node. Better don't include this change here.
Think this could be called extend_back
(similar to drop_back
and take_back
).
I indeed would highly recommend not just setting an area type and hoping for the best. This seems better indeed. One should still make sure that there actually is a valid node tree of course.