2f10db23779d519df8d771031ea14653518aa24a
Text strip along with other effect strips draws into buffer, which is defined by common render size. However this makes selection, snapping and other features not work correctly from user perspective. There are 2 ways to remedy this: - Draw text into buffer which size is defined by text boundbox - Just draw the correct size boundbox and make UI use it correctly This PR implements second option, as there are multiple difficulties asociated with first option. Main problem is, that one would need to calculate boundboxes for all individual text effects(blur, shadow, ...), but many of these effects need to know the size of buffer we are trying to calculate. Big question here was: What the boundox should look like? For selection it is best, if it encapsulates the text itself along with its effects like shadow, blur or box. However for snapping and pivot range it seems, that encapsulating only the text without any effects applied is the best solution. This was discussed with UI module and we agreed, that encapsulating only the text would provide better usability. The implementation: Most of the features are on "preview side", where all dimensions are related to scene render size. Temporary `TextVarsRuntime` is created to calculate apparent text strip image size. This allows boundbox of correct size to be drawn. However to draw boundbox and do transformations correctly, it is necessary to remap origin point to the subset of image defined by the boundbox. Since recalculated origin is relative, this function is used for image transformation during rendering as well. Main drawback of this method is, that boundbox and origin point calculation may be needed from multiple places, and `TextVarsRuntime` may be recalculated about 10x on redraw. `text_effect_calc_runtime` function can be executed from ~5us for single character to 0.5ms with 512 characters with default font(not sure if that matters). Drawing origin only during transformation would help with general UI responsiveness. During playback, these overlays are not drawn, so there should be no change in performance. Pull Request: https://projects.blender.org/blender/blender/pulls/140420
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline—modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
