diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-08-11 04:23:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-08-11 04:23:39 +0300 |
commit | 317b8d96690cec6255a1e954ba642b08ef5d54fb (patch) | |
tree | eb2c37bc74d60a00fe5a52a77997c559847361e5 /source/blender/editors/space_view3d/view3d_walk.c | |
parent | d1328feeb125328615bcf832cbc82d9f9a18e023 (diff) |
Transform: Snap used multiple eval contexts
Changes for 2.8x to use EvaluationContext caused some confusion
- Would use scene layer passed from snap context.
- Would generate duplis from Main eval context.
- Would take context argument and use it to create another eval context.
Adding context args all over and filling in a new eval-context
for every ray-cast test isn't ideal either.
Remove the context argument since the purpose of
SnapObjectContext is to avoid this kind of confusion.
Store the EvaluationContext once and re-use.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_walk.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_walk.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index 4ff084129c3..d4642edf084 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -423,7 +423,7 @@ static void walk_navigation_mode_set(bContext *C, wmOperator *op, WalkInfo *walk * \param r_distance Distance to the hit point */ static bool walk_floor_distance_get( - const bContext *C, RegionView3D *rv3d, WalkInfo *walk, const float dvec[3], + RegionView3D *rv3d, WalkInfo *walk, const float dvec[3], float *r_distance) { float ray_normal[3] = {0, 0, -1}; /* down */ @@ -441,7 +441,7 @@ static bool walk_floor_distance_get( add_v3_v3(ray_start, dvec_tmp); ret = ED_transform_snap_object_project_ray( - C, walk->snap_context, + walk->snap_context, &(const struct SnapObjectParams){ .snap_select = SNAP_ALL, }, @@ -459,7 +459,7 @@ static bool walk_floor_distance_get( * \param r_normal Normal of the hit surface, transformed to always face the camera */ static bool walk_ray_cast( - const bContext *C, RegionView3D *rv3d, WalkInfo *walk, + RegionView3D *rv3d, WalkInfo *walk, float r_location[3], float r_normal[3], float *ray_distance) { float ray_normal[3] = {0, 0, -1}; /* forward */ @@ -475,7 +475,7 @@ static bool walk_ray_cast( normalize_v3(ray_normal); ret = ED_transform_snap_object_project_ray( - C, walk->snap_context, + walk->snap_context, &(const struct SnapObjectParams){ .snap_select = SNAP_ALL, }, @@ -921,7 +921,7 @@ static void walkEvent(bContext *C, wmOperator *op, WalkInfo *walk, const wmEvent { float loc[3], nor[3]; float distance; - bool ret = walk_ray_cast(C, walk->rv3d, walk, loc, nor, &distance); + bool ret = walk_ray_cast(walk->rv3d, walk, loc, nor, &distance); /* in case we are teleporting middle way from a jump */ walk->speed_jump = 0.0f; @@ -1201,7 +1201,7 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk) float difference = -100.0f; float fall_distance; - ret = walk_floor_distance_get(C, rv3d, walk, dvec, &ray_distance); + ret = walk_floor_distance_get(rv3d, walk, dvec, &ray_distance); if (ret) { difference = walk->view_height - ray_distance; @@ -1254,7 +1254,7 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk) if (t > walk->teleport.duration) { /* check to see if we are landing */ - ret = walk_floor_distance_get(C, rv3d, walk, dvec, &ray_distance); + ret = walk_floor_distance_get(rv3d, walk, dvec, &ray_distance); if (ret) { difference = walk->view_height - ray_distance; |