Commit: 18f0caa6c1173510f3569bcdd60c2c6796fb26b7
Author: Pratik Borhade
Date:   Wed Oct 19 18:20:47 2022 +0530
Branches: blender-v2.93-release
https://developer.blender.org/rB18f0caa6c1173510f3569bcdd60c2c6796fb26b7

Fix T99997: Calling teleport without waiting for the previous event disables 
gravity

During teleport event, gravity is disabled and WalkMethod
is stored in `teleport.navigation_mode` which is used later to reset
the status after execution. Calling teleport events consecutively
will change the initial WalkMethod value. So update it only on the
first call. Also remove `else condition` as it stops the previously running
teleport when the new teleport call fails to find a hit point.

Reviewed by: dfelinto, mano-wii

Differential Revision: https://developer.blender.org/D15574

===================================================================

M       source/blender/editors/space_view3d/view3d_walk.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_walk.c 
b/source/blender/editors/space_view3d/view3d_walk.c
index cbd65e3175d..ee9fc21175e 100644
--- a/source/blender/editors/space_view3d/view3d_walk.c
+++ b/source/blender/editors/space_view3d/view3d_walk.c
@@ -916,11 +916,15 @@ static void walkEvent(bContext *C, WalkInfo *walk, const 
wmEvent *event)
 
         if (ret) {
           WalkTeleport *teleport = &walk->teleport;
+
+          /* Store the current navigation mode if we are not already 
teleporting. */
+          if (teleport->state == WALK_TELEPORT_STATE_OFF) {
+            teleport->navigation_mode = walk->navigation_mode;
+          }
           teleport->state = WALK_TELEPORT_STATE_ON;
           teleport->initial_time = PIL_check_seconds_timer();
           teleport->duration = U.walk_navigation.teleport_time;
 
-          teleport->navigation_mode = walk->navigation_mode;
           walk_navigation_mode_set(walk, WALK_MODE_FREE);
 
           copy_v3_v3(teleport->origin, walk->rv3d->viewinv[3]);
@@ -931,9 +935,7 @@ static void walkEvent(bContext *C, WalkInfo *walk, const 
wmEvent *event)
 
           sub_v3_v3v3(teleport->direction, loc, teleport->origin);
         }
-        else {
-          walk->teleport.state = WALK_TELEPORT_STATE_OFF;
-        }
+
         break;
       }

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to