Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_walk.c
| Context not available. | |||||
| * (this would need to un-key all previous frames). | * (this would need to un-key all previous frames). | ||||
| */ | */ | ||||
| bool anim_playing; | bool anim_playing; | ||||
| bool need_rotation_keyframe; | |||||
| bool need_translation_keyframe; | |||||
| /** Previous 2D mouse values. */ | /** Previous 2D mouse values. */ | ||||
| int prev_mval[2]; | int prev_mval[2]; | ||||
| Context not available. | |||||
| #endif | #endif | ||||
| walk->anim_playing = ED_screen_animation_playing(wm); | walk->anim_playing = ED_screen_animation_playing(wm); | ||||
| walk->need_rotation_keyframe = false; | |||||
| walk->need_translation_keyframe = false; | |||||
| walk->time_lastdraw = PIL_check_seconds_timer(); | walk->time_lastdraw = PIL_check_seconds_timer(); | ||||
| Context not available. | |||||
| /* we only consider autokeying on playback or if user confirmed walk on the same frame | /* we only consider autokeying on playback or if user confirmed walk on the same frame | ||||
| * otherwise we get a keyframe even if the user cancels. */ | * otherwise we get a keyframe even if the user cancels. */ | ||||
| const bool use_autokey = is_confirm || walk->anim_playing; | const bool use_autokey = is_confirm || walk->anim_playing; | ||||
| ED_view3d_cameracontrol_update( | ED_view3d_cameracontrol_update( | ||||
| walk->v3d_camera_control, use_autokey, C, do_rotate, do_translate); | walk->v3d_camera_control, use_autokey, C, do_rotate, do_translate); | ||||
| if (use_autokey) { | |||||
| walk->need_rotation_keyframe = false; | |||||
| walk->need_translation_keyframe = false; | |||||
| } | |||||
| } | } | ||||
| static float getFreeFallDistance(const float gravity, const float time) | static float getFreeFallDistance(const float gravity, const float time) | ||||
| Context not available. | |||||
| add_v3_v3(rv3d->ofs, dvec_tmp); | add_v3_v3(rv3d->ofs, dvec_tmp); | ||||
| if (rv3d->persp == RV3D_CAMOB) { | if (rv3d->persp == RV3D_CAMOB) { | ||||
| walk->need_rotation_keyframe |= (moffset[0] || moffset[1]); | const bool do_rotate = (moffset[0] || moffset[1]); | ||||
| walk->need_translation_keyframe |= (len_squared_v3(dvec_tmp) > FLT_EPSILON); | const bool do_translate = (walk->speed != 0.0f); | ||||
| walkMoveCamera( | walkMoveCamera(C, walk, do_rotate, do_translate, is_confirm); | ||||
| C, walk, walk->need_rotation_keyframe, walk->need_translation_keyframe, is_confirm); | |||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
| walk->redraw = true; | walk->redraw = true; | ||||
| if (walk->rv3d->persp == RV3D_CAMOB) { | if (walk->rv3d->persp == RV3D_CAMOB) { | ||||
| walk->need_rotation_keyframe |= has_rotate; | walkMoveCamera(C, walk, has_rotate, has_translate, is_confirm); | ||||
| walk->need_translation_keyframe |= has_translate; | |||||
| walkMoveCamera( | |||||
| C, walk, walk->need_rotation_keyframe, walk->need_translation_keyframe, is_confirm); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||