It looks like that view3d_fly.c is missing in the last svn update. jms
Selon Nicholas Bishop <nicholasbis...@gmail.com>: > Looks like view3d_fly.c wasn't added. > > -Nicholas > > On Sun, Oct 24, 2010 at 10:30 PM, Campbell Barton <ideasma...@gmail.com> > wrote: > > Revision: 32689 > > > http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32689 > > Author: campbellbarton > > Date: 2010-10-25 04:30:16 +0200 (Mon, 25 Oct 2010) > > > > Log Message: > > ----------- > > move fly mode operator into its own file. > > > > Modified Paths: > > -------------- > > trunk/blender/source/blender/editors/space_view3d/CMakeLists.txt > > trunk/blender/source/blender/editors/space_view3d/view3d_edit.c > > trunk/blender/source/blender/editors/space_view3d/view3d_intern.h > > trunk/blender/source/blender/editors/space_view3d/view3d_view.c > > > > Modified: trunk/blender/source/blender/editors/space_view3d/CMakeLists.txt > > =================================================================== > > --- trunk/blender/source/blender/editors/space_view3d/CMakeLists.txt > 2010-10-24 16:10:45 UTC (rev 32688) > > +++ trunk/blender/source/blender/editors/space_view3d/CMakeLists.txt > 2010-10-25 02:30:16 UTC (rev 32689) > > @@ -44,6 +44,7 @@ > > view3d_buttons.c > > view3d_draw.c > > view3d_edit.c > > + view3d_fly.c > > view3d_header.c > > view3d_ops.c > > view3d_select.c > > > > Modified: trunk/blender/source/blender/editors/space_view3d/view3d_edit.c > > =================================================================== > > --- trunk/blender/source/blender/editors/space_view3d/view3d_edit.c > 2010-10-24 16:10:45 UTC (rev 32688) > > +++ trunk/blender/source/blender/editors/space_view3d/view3d_edit.c > 2010-10-25 02:30:16 UTC (rev 32689) > > @@ -3051,6 +3051,21 @@ > > // XXX scrarea_do_windraw(curarea); > > } > > > > - > > - > > - > > +/* give a 4x4 matrix from a perspective view, only needs viewquat, ofs and > dist > > + * basically the same as... > > + * rv3d->persp= RV3D_PERSP > > + * setviewmatrixview3d(scene, v3d, rv3d); > > + * setcameratoview3d(v3d, rv3d, v3d->camera); > > + * ...but less of a hassle > > + * */ > > +void view3d_persp_mat4(RegionView3D *rv3d, float mat[][4]) > > +{ > > + float qt[4], dvec[3]; > > + copy_qt_qt(qt, rv3d->viewquat); > > + qt[0]= -qt[0]; > > + quat_to_mat4(mat, qt); > > + mat[3][2] -= rv3d->dist; > > + translate_m4(mat, rv3d->ofs[0], rv3d->ofs[1], rv3d->ofs[2]); > > + mul_v3_v3fl(dvec, mat[2], -rv3d->dist); > > + sub_v3_v3v3(mat[3], dvec, rv3d->ofs); > > +} > > > > Modified: trunk/blender/source/blender/editors/space_view3d/view3d_intern.h > > =================================================================== > > --- trunk/blender/source/blender/editors/space_view3d/view3d_intern.h > 2010-10-24 16:10:45 UTC (rev 32688) > > +++ trunk/blender/source/blender/editors/space_view3d/view3d_intern.h > 2010-10-25 02:30:16 UTC (rev 32689) > > @@ -91,7 +91,11 @@ > > void VIEW3D_OT_drawtype(struct wmOperatorType *ot); > > > > void view3d_boxview_copy(ScrArea *sa, ARegion *ar); > > +void view3d_persp_mat4(struct RegionView3D *rv3d, float mat[][4]); > > > > +/* view3d_fly.c */ > > +void VIEW3D_OT_fly(struct wmOperatorType *ot); > > + > > /* drawanim.c */ > > void draw_motion_paths_init(View3D *v3d, struct ARegion *ar); > > void draw_motion_path_instance(Scene *scene, > > @@ -150,7 +154,6 @@ > > void VIEW3D_OT_object_as_camera(struct wmOperatorType *ot); > > void VIEW3D_OT_localview(struct wmOperatorType *ot); > > void VIEW3D_OT_game_start(struct wmOperatorType *ot); > > -void VIEW3D_OT_fly(struct wmOperatorType *ot); > > > > > > int boundbox_clip(RegionView3D *rv3d, float obmat[][4], struct BoundBox > *bb); > > > > Modified: trunk/blender/source/blender/editors/space_view3d/view3d_view.c > > =================================================================== > > --- trunk/blender/source/blender/editors/space_view3d/view3d_view.c > 2010-10-24 16:10:45 UTC (rev 32688) > > +++ trunk/blender/source/blender/editors/space_view3d/view3d_view.c > 2010-10-25 02:30:16 UTC (rev 32689) > > @@ -26,12 +26,6 @@ > > * ***** END GPL LICENSE BLOCK ***** > > */ > > > > -#include <string.h> > > -#include <stdio.h> > > -#include <math.h> > > -#include <float.h> > > - > > -#include "DNA_anim_types.h" > > #include "DNA_camera_types.h" > > #include "DNA_lamp_types.h" > > #include "DNA_scene_types.h" > > @@ -40,9 +34,6 @@ > > #include "MEM_guardedalloc.h" > > > > #include "BLI_math.h" > > -#include "BLI_blenlib.h" > > -#include "BLI_editVert.h" > > -#include "BLI_rand.h" > > > > #include "BKE_anim.h" > > #include "BKE_action.h" > > @@ -51,26 +42,16 @@ > > #include "BKE_global.h" > > #include "BKE_main.h" > > #include "BKE_report.h" > > -#include "BKE_scene.h" > > -#include "BKE_depsgraph.h" /* for fly mode updating */ > > > > - > > #include "BIF_gl.h" > > #include "BIF_glutil.h" > > > > #include "WM_api.h" > > #include "WM_types.h" > > > > -#include "ED_keyframing.h" > > #include "ED_screen.h" > > #include "ED_armature.h" > > -#include "ED_space_api.h" > > > > -#include "GPU_draw.h" > > - > > - > > -#include "PIL_time.h" /* smoothview */ > > - > > #if GAMEBLENDER == 1 > > #include "SYS_System.h" > > #endif > > @@ -1175,25 +1156,6 @@ > > } > > } > > > > -/* give a 4x4 matrix from a perspective view, only needs viewquat, ofs and > dist > > - * basically the same as... > > - * rv3d->persp= RV3D_PERSP > > - * setviewmatrixview3d(scene, v3d, rv3d); > > - * setcameratoview3d(v3d, rv3d, v3d->camera); > > - * ...but less of a hassle > > - * */ > > -static void view3d_persp_mat4(RegionView3D *rv3d, float mat[][4]) > > -{ > > - float qt[4], dvec[3]; > > - copy_qt_qt(qt, rv3d->viewquat); > > - qt[0]= -qt[0]; > > - quat_to_mat4(mat, qt); > > - mat[3][2] -= rv3d->dist; > > - translate_m4(mat, rv3d->ofs[0], rv3d->ofs[1], rv3d->ofs[2]); > > - mul_v3_v3fl(dvec, mat[2], -rv3d->dist); > > - sub_v3_v3v3(mat[3], dvec, rv3d->ofs); > > -} > > - > > /* dont set windows active in in here, is used by renderwin too */ > > void setviewmatrixview3d(Scene *scene, View3D *v3d, RegionView3D *rv3d) > > { > > @@ -1850,897 +1812,6 @@ > > ot->poll= game_engine_poll; > > } > > > > - > > -/* NOTE: these defines are saved in keymap files, do not change values but > just add new ones */ > > -#define FLY_MODAL_CANCEL 1 > > -#define FLY_MODAL_CONFIRM 2 > > -#define FLY_MODAL_ACCELERATE 3 > > -#define FLY_MODAL_DECELERATE 4 > > -#define FLY_MODAL_PAN_ENABLE 5 > > -#define FLY_MODAL_PAN_DISABLE 6 > > -#define FLY_MODAL_DIR_FORWARD 7 > > -#define FLY_MODAL_DIR_BACKWARD 8 > > -#define FLY_MODAL_DIR_LEFT 9 > > -#define FLY_MODAL_DIR_RIGHT 10 > > -#define FLY_MODAL_DIR_UP 11 > > -#define FLY_MODAL_DIR_DOWN 12 > > -#define FLY_MODAL_AXIS_LOCK_X 13 > > -#define FLY_MODAL_AXIS_LOCK_Z 14 > > -#define FLY_MODAL_PRECISION_ENABLE 15 > > -#define FLY_MODAL_PRECISION_DISABLE 16 > > - > > -/* called in transform_ops.c, on each regeneration of keymaps */ > > -void fly_modal_keymap(wmKeyConfig *keyconf) > > -{ > > - static EnumPropertyItem modal_items[] = { > > - {FLY_MODAL_CANCEL, "CANCEL", 0, "Cancel", ""}, > > - {FLY_MODAL_CONFIRM, "CONFIRM", 0, "Confirm", ""}, > > - {FLY_MODAL_ACCELERATE, "ACCELERATE", 0, "Accelerate", ""}, > > - {FLY_MODAL_DECELERATE, "DECELERATE", 0, "Decelerate", ""}, > > - > > - {FLY_MODAL_PAN_ENABLE, "PAN_ENABLE", 0, "Pan Enable", ""}, > > - {FLY_MODAL_PAN_DISABLE, "PAN_DISABLE", 0, "Pan Disable", ""}, > > - > > - {FLY_MODAL_DIR_FORWARD, "FORWARD", 0, "Fly Forward", ""}, > > - {FLY_MODAL_DIR_BACKWARD,"BACKWARD", 0, "Fly Backward", ""}, > > - {FLY_MODAL_DIR_LEFT, "LEFT", 0, "Fly Left", ""}, > > - {FLY_MODAL_DIR_RIGHT, "RIGHT", 0, "Fly Right", ""}, > > - {FLY_MODAL_DIR_UP, "UP", 0, "Fly Up", ""}, > > - {FLY_MODAL_DIR_DOWN, "DOWN", 0, "Fly Down", ""}, > > - > > - {FLY_MODAL_AXIS_LOCK_X, "AXIS_LOCK_X", 0, "X Axis Correction", "X > axis correction (toggle)"}, > > - {FLY_MODAL_AXIS_LOCK_Z, "AXIS_LOCK_Z", 0, "X Axis Correction", "Z > axis correction (toggle)"}, > > - > > - {FLY_MODAL_PRECISION_ENABLE, "PRECISION_ENABLE", 0, "Precision > Enable", ""}, > > - {FLY_MODAL_PRECISION_DISABLE, "PRECISION_DISABLE", 0, "Precision > Disable", ""}, > > - > > - {0, NULL, 0, NULL, NULL}}; > > - > > - wmKeyMap *keymap= WM_modalkeymap_get(keyconf, "View3D Fly Modal"); > > - > > - /* this function is called for each spacetype, only needs to add > map once */ > > - if(keymap) return; > > - > > - keymap= WM_modalkeymap_add(keyconf, "View3D Fly Modal", > modal_items); > > - > > - /* items for modal map */ > > - WM_modalkeymap_add_item(keymap, ESCKEY, KM_PRESS, KM_ANY, 0, > FLY_MODAL_CANCEL); > > - WM_modalkeymap_add_item(keymap, RIGHTMOUSE, KM_ANY, KM_ANY, 0, > FLY_MODAL_CANCEL); > > - > > - WM_modalkeymap_add_item(keymap, LEFTMOUSE, KM_ANY, KM_ANY, 0, > FLY_MODAL_CONFIRM); > > - WM_modalkeymap_add_item(keymap, RETKEY, KM_PRESS, KM_ANY, 0, > FLY_MODAL_CONFIRM); > > - WM_modalkeymap_add_item(keymap, SPACEKEY, KM_PRESS, KM_ANY, 0, > FLY_MODAL_CONFIRM); > > - WM_modalkeymap_add_item(keymap, PADENTER, KM_PRESS, KM_ANY, 0, > FLY_MODAL_CONFIRM); > > - > > - WM_modalkeymap_add_item(keymap, PADPLUSKEY, KM_PRESS, 0, 0, > FLY_MODAL_ACCELERATE); > > - WM_modalkeymap_add_item(keymap, PADMINUS, KM_PRESS, 0, 0, > FLY_MODAL_DECELERATE); > > - WM_modalkeymap_add_item(keymap, WHEELUPMOUSE, KM_PRESS, 0, 0, > FLY_MODAL_ACCELERATE); > > - WM_modalkeymap_add_item(keymap, WHEELDOWNMOUSE, KM_PRESS, 0, 0, > FLY_MODAL_DECELERATE); > > - > > - WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_PRESS, KM_ANY, 0, > FLY_MODAL_PAN_ENABLE); > > - WM_modalkeymap_add_item(keymap, MIDDLEMOUSE, KM_RELEASE, KM_ANY, 0, > FLY_MODAL_PAN_DISABLE); /* XXX - Bug in the event system, middle mouse > release doesnt work */ > > - > > - /* WASD */ > > - WM_modalkeymap_add_item(keymap, WKEY, KM_PRESS, 0, 0, > FLY_MODAL_DIR_FORWARD); > > - WM_modalkeymap_add_item(keymap, SKEY, KM_PRESS, 0, 0, > FLY_MODAL_DIR_BACKWARD); > > - WM_modalkeymap_add_item(keymap, AKEY, KM_PRESS, 0, 0, > FLY_MODAL_DIR_LEFT); > > - WM_modalkeymap_add_item(keymap, DKEY, KM_PRESS, 0, 0, > FLY_MODAL_DIR_RIGHT); > > - WM_modalkeymap_add_item(keymap, RKEY, KM_PRESS, 0, 0, > FLY_MODAL_DIR_UP); > > - WM_modalkeymap_add_item(keymap, FKEY, KM_PRESS, 0, 0, > FLY_MODAL_DIR_DOWN); > > - > > - WM_modalkeymap_add_item(keymap, XKEY, KM_PRESS, 0, 0, > FLY_MODAL_AXIS_LOCK_X); > > - WM_modalkeymap_add_item(keymap, ZKEY, KM_PRESS, 0, 0, > FLY_MODAL_AXIS_LOCK_Z); > > - > > - WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_PRESS, KM_ANY, 0, > FLY_MODAL_PRECISION_ENABLE); > > - WM_modalkeymap_add_item(keymap, LEFTSHIFTKEY, KM_RELEASE, KM_ANY, > 0, FLY_MODAL_PRECISION_DISABLE); > > - > > - /* assign map to operators */ > > - WM_modalkeymap_assign(keymap, "VIEW3D_OT_fly"); > > - > > -} > > - > > -typedef struct FlyInfo { > > - /* context stuff */ > > - RegionView3D *rv3d; > > - View3D *v3d; > > - ARegion *ar; > > - Scene *scene; > > - > > - wmTimer *timer; /* needed for redraws */ > > - > > - short state; > > - short use_precision; > > - short redraw; > > - short mval[2]; > > - > > - /* fly state state */ > > - float speed; /* the speed the view is moving per redraw */ > > - short axis; /* Axis index to move allong by default Z to move > allong the view */ > > - short pan_view; /* when true, pan the view instead of rotating */ > > - > > - /* relative view axis locking - xlock, zlock > > - 0; disabled > > - 1; enabled but not checking because mouse hasnt moved outside the > margin since locking was checked an not needed > > - when the mouse moves, locking is set to 2 so checks are done. > > - 2; mouse moved and checking needed, if no view altering is donem > its changed back to 1 */ > > - short xlock, zlock; > > - float xlock_momentum, zlock_momentum; /* nicer dynamics */ > > - float grid; /* world scale 1.0 default */ > > - > > - /* root most parent */ > > - Object *root_parent; > > - > > - /* backup values */ > > - float dist_backup; /* backup the views distance since we use a zero > dist for fly mode */ > > - float ofs_backup[3]; /* backup the views offset incase the user > cancels flying in non camera mode */ > > - float rot_backup[4]; /* backup the views quat incase the user > cancels flying in non camera mode. (quat for view, eul for camera) */ > > - short persp_backup; /* remember if were ortho or not, only used for > restoring the view if it was a ortho view */ > > - > > - void *obtfm; /* backup the objects transform */ > > - > > - /* compare between last state */ > > > > @@ Diff output truncated at 10240 characters. @@ > > > > _______________________________________________ > > Bf-blender-cvs mailing list > > bf-blender-...@blender.org > > http://lists.blender.org/mailman/listinfo/bf-blender-cvs > > > _______________________________________________ > Bf-committers mailing list > Bf-committers@blender.org > http://lists.blender.org/mailman/listinfo/bf-committers > _______________________________________________ Bf-committers mailing list Bf-committers@blender.org http://lists.blender.org/mailman/listinfo/bf-committers