Walk Navigation: Add local up/down movement with R/F #111682
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111682
Loading…
Reference in New Issue
No description provided.
Delete Branch "aaronfranke/blender:walk-nav-local-up-rf"
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?
This PR is a minor usability enhancement for the walk navigation mode. Currently walk navigation has local movement for forward/back/left/right, but only global movement for up/down. This PR adds local up/down movement, bound to the R and F keys.
Justification:
Why have local up/down movement: This is a common feature in many 3D editors (ex: Unity, Godot) and 6DoF games (ex: Space Engineers, Pioneer, Elite: Dangerous), and it provides feature parity with the forward/back/left/right movement which are local.
Why use R/F for this: R/F are a common choice in 6DoF games (ex: Elite: Dangerous). They are easy to remember because R is above F and therefore R must be up and F must be down. Also, these keys are otherwise unused in walk navigation, so binding them does not negatively affect anyone.
Why keep E/Q for global up/down movement: The simple answer is for preserving the existing behavior in Blender. Also, E/Q for global up/down is the same as Unreal. But even if it wasn't for compatibility or consistency with other development tools, I would argue that E/Q for global and R/F for local is the best choice because of parity with 6DoF games.
This PR also renames the global up/down enums internally (but the keybind names are still the same, and the values are still the same, so compatibility is preserved). This PR also fixes a bug where if you press both up/down at the same time down was taking priority (
direction = 1;
changed todirection += 1;
to match the other code that uses+=
).Documentation: blender/blender-manual#104538
I have compiled and tested this PR to ensure it works correctly. I've attached a screenshot of what the control hints look like.
Walk Navigation: Add local up/down movementto Walk Navigation: Add local up/down movement with R/F@ -1208,2 +1230,3 @@
if (walk->navigation_mode == WALK_MODE_FREE) {
if (walk->navigation_mode == WALK_MODE_FREE) {
if ((walk->active_directions & WALK_BIT_GLOBAL_UP) || (walk->active_directions & WALK_BIT_GLOBAL_DOWN)) {
Maybe use
ELEM(walk->active_directions, WALK_BIT_LOCAL_UP, WALK_BIT_LOCAL_DOWN)
?I don't think these are equivalent,
ELEM
is for checking equality, this is bitwise.For now I am following the existing code style.
Can be
(walk->active_directions & (WALK_BIT_GLOBAL_UP | WALK_BIT_GLOBAL_DOWN))
.Good idea, might be faster that way and it's more readable. I have pushed a change to do this.
Hi, thanks for the PR. Change looks correct to me.
I'll tag @dfelinto for final review (since he is the author of walk/fly nav)
This seems OK, having both global/local directions for all directions makes sense although personally I find it a bit obscure - on a user level. I'd be interested in a second opinion.
@ideasman42 This isn't both global/local for all directions, only up/down.
In 5DoF movement, the vertical axis is special because it's what the camera pivots around. The same cannot be said about the horizontal axes. So it makes sense to have global up/down, but less so global horizontal movement. But regardless, this PR is adding local up/down, which makes sense in all situations and is consistent with the existing local horizontal movement.
3209540f3e
toa5f94f5ff9
a5f94f5ff9
to33781473eb
I rebased and re-tested this pull request on the latest Blender main branch (now 4.1.0 alpha).
I think this feature is ok. I think it is harmless to have it and I could see its use. Let me look at the code quickly, but as far as the feature is concern, my late over-thought +1 :)
For the records, Campbell is the author of fly navigation :) (I was the author of walk navigation though indeed).
The code seems fine. I will wait Campbell for a final review
Hi, This seems to break Gravity option:
Enter Walk > Press g or TAB > view becomes stuck under the grid, keyboard input does nothing, mouse still works.
Thanks for letting me know, this was an error in a following cleanup, corrected:
361bd68f21