Animation: Vertically locking the NLA so it doesn't scroll to infinity #109473

Merged
Nate Rupsis merged 10 commits from NLA-clamp-scroll into main 2023-07-19 16:12:22 +02:00
Member

Jonathan Lampel mentioned in the 3.6 feature release video that the dope sheet / timeline now vertically lock, preventing accidentally scrolling to infinity. He hopes this change will make it to the NLA. This is that change.


Applying the Clamp V2D from 104516 (thanks @ChrisLend) to the NLA.

Before:

After:

Jonathan Lampel mentioned in the [3.6 feature release](https://www.youtube.com/watch?v=0-LiGWgKRgk&t=615s) video that the dope sheet / timeline now vertically lock, preventing accidentally scrolling to infinity. He hopes this change will make it to the NLA. This is _that_ change. --- Applying the Clamp V2D from [104516](https://projects.blender.org/blender/blender/pulls/104516) (thanks @ChrisLend) to the NLA. Before: <video controls src="https://projects.blender.org/attachments/ce0a2f36-38fe-4937-bce4-b5507f84436e"></video> After: <video controls src="https://projects.blender.org/attachments/09faa50c-66cb-4431-b206-2dfc7964facc"></video>
Nate Rupsis added the
Module
Animation & Rigging
label 2023-06-28 21:35:47 +02:00
Nate Rupsis added 1 commit 2023-06-28 21:35:55 +02:00
Nate Rupsis requested review from Sybren A. Stüvel 2023-06-28 21:36:48 +02:00
Nate Rupsis requested review from Christoph Lendenfeld 2023-06-28 21:36:59 +02:00
Nate Rupsis requested review from Brad Clark 2023-06-28 21:37:07 +02:00
Nate Rupsis added this to the Animation & Rigging project 2023-06-28 21:37:22 +02:00
Brad Clark approved these changes 2023-06-28 23:19:30 +02:00
Brad Clark left a comment
Member

Approve, just tried it for the other editors and yes, need this in the NLA!

Approve, just tried it for the other editors and yes, need this in the NLA!
Nate Rupsis reviewed 2023-06-29 01:37:34 +02:00
@ -153,0 +163,4 @@
v2d->cur.ymin = v2d->tot.ymin;
v2d->cur.ymax = v2d->cur.ymin + cur_height_y;
}
}
Author
Member

Since this functionality is duplicated, it should probably be moved into it's own function...

@dr.sybren / @Harley Do you guys agree? and/or do you know where the best location for said function should live?

Since this functionality is duplicated, it should _probably_ be moved into it's own function... @dr.sybren / @Harley Do you guys agree? and/or do you know where the best location for said function should live?
Member

@nrupsis - -do you know where the best location for said function should live?

Without looking too deeply I'd guess that this would be declared in UI_view2d.h, defined in view2d.cc, and be something like...

void UI_view2d_curRect_clamp_y(struct View2D *v2d);

And yes we have some camelCase in there for some reason.

> @nrupsis - -do you know where the best location for said function should live? Without looking too deeply I'd guess that this would be declared in `UI_view2d.h`, defined in `view2d.cc`, and be something _like_... void UI_view2d_curRect_clamp_y(struct View2D *v2d); And yes we have some camelCase in there _for some reason_.
Christoph Lendenfeld approved these changes 2023-07-07 16:41:09 +02:00
Christoph Lendenfeld left a comment
Member

functionality looks good. I'll let you decide where to move the logic of clamping the v2d. Harleys suggestions sounds reasonable though

functionality looks good. I'll let you decide where to move the logic of clamping the v2d. Harleys suggestions sounds reasonable though
Nate Rupsis requested review from Harley Acheson 2023-07-12 20:52:21 +02:00
Nate Rupsis added 5 commits 2023-07-12 20:55:33 +02:00
Christoph Lendenfeld reviewed 2023-07-13 08:46:26 +02:00
@ -849,1 +849,4 @@
void UI_view2d_curRect_clamp_y(struct View2D *v2d)
{
/* V2D_KEEPTOT_STRICT cannot be used to clamp scrolling

I think now that the function has moved the comment doesn't make sense here anymore. Especially because you also have it in nla_main_region_view2d_changed

I think now that the function has moved the comment doesn't make sense here anymore. Especially because you also have it in `nla_main_region_view2d_changed`
Nate Rupsis added 2 commits 2023-07-13 13:38:13 +02:00
Harley Acheson reviewed 2023-07-19 03:06:10 +02:00
@ -174,0 +174,4 @@
/**
* Clamp view2d area to what's visible, preventing
* scrolling vertically to infinity.
*/
Member

Both comment lines above end with extra trailing spaces.

Both comment lines above end with extra trailing spaces.
Harley Acheson approved these changes 2023-07-19 03:39:15 +02:00
Harley Acheson left a comment
Member

Works well and make sense. Minor formatting issues noted.

Works well and make sense. Minor formatting issues noted.
Nate Rupsis added 2 commits 2023-07-19 15:56:10 +02:00
Nate Rupsis merged commit 7146371964 into main 2023-07-19 16:12:22 +02:00
Nate Rupsis deleted branch NLA-clamp-scroll 2023-07-19 16:12:23 +02:00
Sign in to join this conversation.
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 Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#109473
No description provided.