Walk Navigation: Controls to adjust jump height interactively #109827

Merged
Pratik Borhade merged 5 commits from Andras-Borsanyi/blender:interactive-jump-height into main 2023-07-28 13:43:45 +02:00
Contributor

In Walk Navigation mode with gravity enabled, the jump height is often inappropriate for the scene that you are viewing and it is annoying to go into preferences and change it there every time. This is a small feature that lets you change the jump height in modal walk navigation as you go, i.e. if there are varying elevation changes across the scene.

Pressing '.' increases, ',' decreases the jump height (because these keys are the same for most layouts). The setting in preferences is still loaded as default when starting walk navigation.

In Walk Navigation mode with gravity enabled, the jump height is often inappropriate for the scene that you are viewing and it is annoying to go into preferences and change it there every time. This is a small feature that lets you change the jump height in modal walk navigation as you go, i.e. if there are varying elevation changes across the scene. Pressing '.' increases, ',' decreases the jump height (because these keys are the same for most layouts). The setting in preferences is still loaded as default when starting walk navigation.
Andras-Borsanyi added 1 commit 2023-07-07 16:44:54 +02:00
06186ba5e5 Walk Navigation: Controls to adjust jump height interactively
Pressing '.' increases, ',' decreases the jump height in modal walk navigation.
Before, you could only change the global height in the preferences, this change
allows you to do so interactively (the setting in preferences is still loaded as default
when starting walk navigation). This is useful when different parts of the scene
have varying elevation changes.
Iliya Katushenock added the
Module
Modeling
label 2023-07-07 17:10:31 +02:00
Pratik Borhade added
Module
EEVEE & Viewport
and removed
Module
Modeling
labels 2023-07-08 06:57:29 +02:00
Pratik Borhade requested changes 2023-07-10 12:54:41 +02:00
Pratik Borhade left a comment
Member

Hi, thanks for working on this. Looks good so far. Small change requested:

@dfelinto , agree with this improvement? AFAIK you are the original author of walk/flg navigation :)

Hi, thanks for working on this. Looks good so far. Small change requested: @dfelinto , agree with this improvement? AFAIK you are the original author of walk/flg navigation :)
@ -898,0 +906,4 @@
#define JUMP_HEIGHT_MIN 0.1f
case WALK_MODAL_INCREASE_JUMP:
walk->jump_height *= JUMP_HEIGHT_FACTOR;
Member

keep jump_height value within finite range.
Without upper bound, jump will be way too high.

keep `jump_height` value within finite range. Without upper bound, jump will be way too high.
Member

Hi, this file is now moved to c++: 093a4d63f3
So, merge the main branch into your working branch, refer wiki

Hi, this file is now moved to c++: 093a4d63f3bac26427028e7a7eecae8e2ab2960a So, merge the main branch into your working branch, [refer wiki](https://wiki.blender.org/wiki/Tools/Pull_Requests#Workflow:~:text=Update%20a%20Pull%20Request)
Author
Contributor

As requested, I capped the jump height (to 10 units).
PS: That is a lot of commits, I hope I did it right.

As requested, I capped the jump height (to 10 units). PS: That is a lot of commits, I hope I did it right.
Member

Unfortunately, merge did not happen correctly :/
Which command you ran for updating the branch to main?
this is expected:

git checkout interactive-jump-height
git merge main
Unfortunately, merge did not happen correctly :/ Which command you ran for updating the branch to main? this is expected: ``` git checkout interactive-jump-height git merge main ```
Author
Contributor

I had to tell git how to merge, I think what I ended up doing was rebasing to the latest version. It was honestly a bunch of convoluted steps I might not have understood entirely. I once had to resolve a conflict and I chose the later version (nullptr instead of NULL in line 175), was that the problem or was it the whole rebasing thing? I might need to go back and just try again.

I had to tell git how to merge, I think what I ended up doing was rebasing to the latest version. It was honestly a bunch of convoluted steps I might not have understood entirely. I once had to resolve a conflict and I chose the later version (nullptr instead of NULL in line 175), was that the problem or was it the whole rebasing thing? I might need to go back and just try again.
Member

Guess rebasing does this, not entirely sure though.
If you're having trouble to revert these changes, feel free to ask in #blender-coders

Guess rebasing does this, not entirely sure though. If you're having trouble to revert these changes, feel free to ask in [#blender-coders](https://blender.chat/channel/blender-coders)
Andras-Borsanyi force-pushed interactive-jump-height from 0241990a3a to 80cca8de7e 2023-07-19 19:57:28 +02:00 Compare
Author
Contributor

This time I did merge --no-rebase and I think it worked.

This time I did `merge --no-rebase` and I think it worked.
Pratik Borhade approved these changes 2023-07-21 13:07:37 +02:00
Pratik Borhade left a comment
Member

Thanks. Looks correct now :D
@dfelinto wrote the walk navigation code so I'll defer the further review to him

Thanks. Looks correct now :D @dfelinto wrote the walk navigation code so I'll defer the further review to him
@ -898,0 +908,4 @@
case WALK_MODAL_INCREASE_JUMP:
walk->jump_height *= JUMP_HEIGHT_FACTOR;
if (walk->jump_height > JUMP_HEIGHT_MAX) {
Member

guess we can use min_ff/max_ff instead of if conditions but fine with current code too :)

guess we can use `min_ff/max_ff` instead of `if` conditions but fine with current code too :)
Pratik Borhade requested review from Dalai Felinto 2023-07-21 13:07:55 +02:00

Indeed better to use min/max functions.

Also, is the jump height being preserved across the session? (similar to how we preserve the speed)

Indeed better to use min/max functions. Also, is the jump height being preserved across the session? (similar to how we preserve the speed)
Andras-Borsanyi added 1 commit 2023-07-21 22:47:17 +02:00
1b9d6f00ca Walk Navigation: Preserve jump height across a session
Similar to walking speed, jump height will be preserved across a session.
Also fixed changing jump height mid-air and switched to using min/max functions
for capping jump height.
Author
Contributor

I have made the requested changes and also fixed some problems with changing the jump height mid-air.

I have made the requested changes and also fixed some problems with changing the jump height mid-air.
Pratik Borhade reviewed 2023-07-24 13:40:17 +02:00
Pratik Borhade left a comment
Member

Thanks :)
just spotted one small change

Thanks :) just spotted one small change
@ -528,0 +539,4 @@
}
walk->jump_height = 0.0f;
Member

Remove trailing whitespace: image

Remove trailing whitespace: [image](/attachments/1c533903-069f-4f41-983c-0d2ce95733d7)
Andras-Borsanyi added 1 commit 2023-07-26 21:26:15 +02:00
Author
Contributor

Removed the whitespace :)

Removed the whitespace :)
Pratik Borhade approved these changes 2023-07-27 10:55:04 +02:00
Pratik Borhade left a comment
Member

Thanks :)

Thanks :)

@PratikPB2123 can you handle the commit + release notes? The code seems fine, so if you tested it, it is good to go.

Thanks @Andras-Borsanyi for the patch :)

@PratikPB2123 can you handle the commit + release notes? The code seems fine, so if you tested it, it is good to go. Thanks @Andras-Borsanyi for the patch :)
Dalai Felinto approved these changes 2023-07-28 10:38:54 +02:00
Member

can you handle the commit + release notes? The code seems fine, so if you tested it, it is good to go.

Sure. Will check once again before committing.

> can you handle the commit + release notes? The code seems fine, so if you tested it, it is good to go. Sure. Will check once again before committing.
Pratik Borhade merged commit f418e4f648 into main 2023-07-28 13:43:45 +02:00
Member

Thanks, merged into master :D
Also added to release notes: https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/User_Interface#General
(I hope release notes changes are correct)

Thanks, merged into master :D Also added to release notes: https://wiki.blender.org/wiki/Reference/Release_Notes/4.0/User_Interface#General (I hope release notes changes are correct)
Andras-Borsanyi deleted branch interactive-jump-height 2023-07-30 17:05:34 +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 project
No Assignees
3 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#109827
No description provided.