Refactoring: Corrections and unifications in mathematics vfont gizmos #107193
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#107193
Loading…
Reference in New Issue
No description provided.
Delete Branch "mod_moder/blender:tmp_fix_text_cursor_transform"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goals:
Changes:
textcurs[4][2]
.loc
,size
,rot
for all transforms.Comparison:
More aboud context-depend align cursore:
This looks to be a nice start, but needs more testing.
At first glance this appears to nicely improve many issues with the size, placement, and rotation with "Text on Curve".
But try it with regular text that is not on a curve and it is worse than now. Try it with a text string like "MiMiMi" and you'll notice the placement is way out. There are also horizontal placement issues if you test with text that wraps to multiple lines.
Hey, that is working way better now.
Although a bit picky, current code shows the text cursor (caret) lining up vertically perfectly with the selection boxes (left), but are out by a bit with your PR:
An optionally... just a thought. But wondering if the angle used should actually be the average of the character and the previous (if there is one). Might be nicer with extreme bends? Or might be worse? Not sure.
Although maybe it would make more sense to first better align neighboring select boxes and then see how the mouse cursor fits in.
@Harley Thanks for your testing this
I was not able to determine the real ratios of the high and low points using the old formulas (because it would be difficult to understand what this should mean). But the fact that they are not similar to other gizmos, I did not notice this.
There seem to be 2 options here:
Yes, it looks like I should also take a look at the code for other parts of the gizmo so that all the calculations are more consistent.
VFONT: Fix cursor deforming on transformationto WIP: VFONT: Fix cursor deforming on transformationWow that does work nicely. Is that much change really necessary though?
From what I can tell the fundamental problem in current code is simply that the positions of the text insertion cursor are rotated incorrectly. If you remove the current rotation adjustments you get a perfect cursor on a flat surface. But place it on a curve and the points are rotated incorrectly.
The way the characters are rotated, the bottom-left point is in the correct position, so the cursor needs to be rotated around that point, not the middle of it. I get quite a good result with just doing that:
The main change is the refusal to use a rectangle of points.
As far as I can tell, making a gizmo deform when the text doesn't deform on curve is not very good. In addition, the render itself, at least in the current implementation, does not support this anyway.
So I simplified the logic by just starting to use transform. Otherwise, I just unify the processing of the transformation and its definition.
From your code: A bit unsure of its meaning, the line:
float rot = (ef->pos > 0) ? ((ct->rot + chartransdata[ef->pos].rot) / 2.0f) : ct->rot;
Can be simplified to:
float rot = true ? ((ct->rot + chartransdata[ef->pos].rot) / 2.0f) : ct->rot;
float rot = (ct->rot + chartransdata[ef->pos].rot) / 2.0f
float rot = (ct->rot + ct->rot) / 2.0f
float rot = ct->rot
Which in fact is not so far from the current version.
All symbols, gizmos and cursors have one pivot point. This is {0.5f, 0.0f}, the center of the bottom line. This is where I understand the symbol touches the curve (I could be wrong).
So, the gizmo of the character and the cursor must be in this space.
If the cursor is not next to the selection (that is, there is no selection), then yes, i need to position it in the center, which is similar to your code:
float rot = (ef->pos < size) ? ((ct->rot + chartransdata[ef->pos + 1].rot) / 2.0f) : ct->rot;
But it hasn't been added yet (look for the big commented
else
)Yikes, just a brain-fart. Change that to the following and you'll see I was just wanting to use the average rotation of the two neighboring characters (as long as we have a neighbor). Not sure if it helps much though.
WIP: VFONT: Fix cursor deforming on transformationto Refactoring: Corrections and unifications in mathematics vfont gizmosAdded some more description with examples.
Some issues with this PR fixes look to be resolved in
main
.1d2eab9ab3
5c184525ed
This PR would need to be updated, but I'm not convinced of these changes.
So while I'm not against these changes, they don't seem so important - but I may be missing something.
Pull request closed