2008-12-23 19:47:33 +00:00
|
|
|
/**
|
2010-03-21 01:14:04 +00:00
|
|
|
* $Id$
|
2008-12-23 19:47:33 +00:00
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2008-12-23 19:47:33 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
#ifndef ED_VIEW3D_H
|
|
|
|
|
#define ED_VIEW3D_H
|
|
|
|
|
|
|
|
|
|
/* ********* exports for space_view3d/ module ********** */
|
2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
2008-12-29 01:41:28 +00:00
|
|
|
struct ARegion;
|
2010-03-09 07:41:04 +00:00
|
|
|
struct bContext;
|
|
|
|
|
struct BezTriple;
|
2009-02-20 20:39:27 +00:00
|
|
|
struct bglMats;
|
2010-03-09 07:41:04 +00:00
|
|
|
struct BoundBox;
|
2008-12-30 16:03:29 +00:00
|
|
|
struct BPoint;
|
|
|
|
|
struct EditEdge;
|
|
|
|
|
struct EditFace;
|
2010-03-09 07:41:04 +00:00
|
|
|
struct EditVert;
|
2009-01-01 19:18:03 +00:00
|
|
|
struct ImBuf;
|
2009-10-26 12:42:25 +00:00
|
|
|
struct Main;
|
2010-03-09 07:41:04 +00:00
|
|
|
struct Nurb;
|
|
|
|
|
struct Object;
|
2009-10-27 19:53:34 +00:00
|
|
|
struct rcti;
|
2010-03-09 07:41:04 +00:00
|
|
|
struct RegionView3D;
|
|
|
|
|
struct Scene;
|
|
|
|
|
struct View3D;
|
|
|
|
|
struct ViewContext;
|
|
|
|
|
|
2008-12-23 19:47:33 +00:00
|
|
|
|
2009-01-05 15:19:31 +00:00
|
|
|
/* for derivedmesh drawing callbacks, for view3d_select, .... */
|
|
|
|
|
typedef struct ViewContext {
|
2010-08-10 05:41:51 +00:00
|
|
|
struct Scene *scene;
|
2010-03-09 07:41:04 +00:00
|
|
|
struct Object *obact;
|
|
|
|
|
struct Object *obedit;
|
2009-01-05 15:19:31 +00:00
|
|
|
struct ARegion *ar;
|
|
|
|
|
struct View3D *v3d;
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
struct RegionView3D *rv3d;
|
2009-01-05 15:19:31 +00:00
|
|
|
struct EditMesh *em;
|
|
|
|
|
short mval[2];
|
|
|
|
|
} ViewContext;
|
|
|
|
|
|
2009-01-24 13:45:24 +00:00
|
|
|
typedef struct ViewDepths {
|
|
|
|
|
unsigned short w, h;
|
|
|
|
|
float *depths;
|
|
|
|
|
double depth_range[2];
|
|
|
|
|
|
|
|
|
|
char damaged;
|
|
|
|
|
} ViewDepths;
|
|
|
|
|
|
2009-01-05 15:19:31 +00:00
|
|
|
|
|
|
|
|
float *give_cursor(struct Scene *scene, struct View3D *v3d);
|
2008-12-23 19:47:33 +00:00
|
|
|
|
2010-08-06 03:52:13 +00:00
|
|
|
int initgrabz(struct RegionView3D *rv3d, float x, float y, float z);
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
void window_to_3d(struct ARegion *ar, float *vec, short mx, short my);
|
2009-01-20 18:31:11 +00:00
|
|
|
void window_to_3d_delta(struct ARegion *ar, float *vec, short mx, short my);
|
2009-08-19 21:24:52 +00:00
|
|
|
void view3d_unproject(struct bglMats *mats, float out[3], const short x, const short y, const float z);
|
2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
2008-12-29 01:41:28 +00:00
|
|
|
|
2009-01-17 03:31:56 +00:00
|
|
|
/* Depth buffer */
|
2009-01-16 01:56:11 +00:00
|
|
|
float read_cached_depth(struct ViewContext *vc, int x, int y);
|
2009-01-30 18:27:25 +00:00
|
|
|
void request_depth_update(struct RegionView3D *rv3d);
|
2009-01-17 03:31:56 +00:00
|
|
|
|
|
|
|
|
/* Projection */
|
2009-01-24 13:45:24 +00:00
|
|
|
#define IS_CLIPPED 12000
|
2009-01-16 01:56:11 +00:00
|
|
|
|
2009-10-27 19:53:34 +00:00
|
|
|
void view3d_calculate_clipping(struct BoundBox *bb, float planes[4][4], struct bglMats *mats, struct rcti *rect);
|
|
|
|
|
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
void project_short(struct ARegion *ar, float *vec, short *adr);
|
|
|
|
|
void project_short_noclip(struct ARegion *ar, float *vec, short *adr);
|
2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
2008-12-29 01:41:28 +00:00
|
|
|
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
void project_int(struct ARegion *ar, float *vec, int *adr);
|
|
|
|
|
void project_int_noclip(struct ARegion *ar, float *vec, int *adr);
|
2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
2008-12-29 01:41:28 +00:00
|
|
|
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
void project_float(struct ARegion *ar, float *vec, float *adr);
|
|
|
|
|
void project_float_noclip(struct ARegion *ar, float *vec, float *adr);
|
2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
2008-12-29 01:41:28 +00:00
|
|
|
|
2009-12-28 22:40:52 +00:00
|
|
|
void viewvector(struct RegionView3D *rv3d, float coord[3], float vec[3]);
|
|
|
|
|
|
2009-10-12 22:33:32 +00:00
|
|
|
void viewline(struct ARegion *ar, struct View3D *v3d, float mval[2], float ray_start[3], float ray_end[3]);
|
|
|
|
|
void viewray(struct ARegion *ar, struct View3D *v3d, float mval[2], float ray_start[3], float ray_normal[3]);
|
2.5
Transform:
First working port of the transform code:
- Object mode only (other conversions need to be ported)
- Contraints (global and local only) working
- Snap (no edit mode, obviously) working
- Numinput working
- Gears (Ctrl and Shift) working
- Only grap, rotate, scale, shear, warp and to sphere have been added as hotkey, but the rest should work too once accessible
- No manipulator
- No drawn feedback other than moving stuff and header print (no constraint line, snap circle, ...)
- No NDOF support
I've only tested Scons support, though Makefil *should* work, I *think*.
Misc:
-QuatIsNull function in arith
-Exporting project_* and view[line|ray] functions from view3d
2008-12-29 01:41:28 +00:00
|
|
|
|
2010-03-06 19:46:21 +00:00
|
|
|
int get_view3d_cliprange(struct View3D *v3d, struct RegionView3D *rv3d, float *clipsta, float *clipend);
|
2009-01-20 11:09:26 +00:00
|
|
|
int get_view3d_viewplane(struct View3D *v3d, struct RegionView3D *rv3d, int winxi, int winyi, rctf *viewplane, float *clipsta, float *clipend, float *pixsize);
|
2009-03-17 21:44:58 +00:00
|
|
|
int get_view3d_ortho(struct View3D *v3d, struct RegionView3D *rv3d);
|
2009-05-18 16:42:34 +00:00
|
|
|
void view3d_get_object_project_mat(struct RegionView3D *v3d, struct Object *ob, float pmat[4][4]);
|
2009-02-19 19:03:53 +00:00
|
|
|
void view3d_project_float(struct ARegion *a, float *vec, float *adr, float mat[4][4]);
|
2009-01-20 11:09:26 +00:00
|
|
|
|
2008-12-30 16:03:29 +00:00
|
|
|
/* drawobject.c itterators */
|
|
|
|
|
void mesh_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct EditVert *eve, int x, int y, int index), void *userData, int clipVerts);
|
|
|
|
|
void mesh_foreachScreenEdge(struct ViewContext *vc, void (*func)(void *userData, struct EditEdge *eed, int x0, int y0, int x1, int y1, int index), void *userData, int clipVerts);
|
|
|
|
|
void mesh_foreachScreenFace(struct ViewContext *vc, void (*func)(void *userData, struct EditFace *efa, int x, int y, int index), void *userData);
|
|
|
|
|
void nurbs_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct Nurb *nu, struct BPoint *bp, struct BezTriple *bezt, int beztindex, int x, int y), void *userData);
|
|
|
|
|
void lattice_foreachScreenVert(struct ViewContext *vc, void (*func)(void *userData, struct BPoint *bp, int x, int y), void *userData);
|
|
|
|
|
|
2009-11-21 16:44:05 +00:00
|
|
|
void ED_view3d_local_clipping(struct RegionView3D *rv3d, float mat[][4]);
|
|
|
|
|
int view3d_test_clipping(struct RegionView3D *rv3d, float *vec, int local);
|
2.5
View3D has been split now in a local part (RegionView3D) and a
per-area part (old View3D). Currently local is:
- view transform
- camera zoom/offset
- gpencil (todo)
- custom clipping planes
Rest is in Area still, like active camera, draw type, layers,
localview, custom centers, around-settings, transform widget,
gridlines, and so on (mostly stuff as available in header).
To see it work; also added new feature for region split,
press SHIFT+ALT+CTRL+S for four-split.
The idea is to make a preset 4-split, configured to stick
to top/right/front views for three views.
Another cool idea to explore is to then box-clip all drawing
based on these 3 views.
Note about the code:
- currently view3d still stores some depricated settings, to
convert from older files. Not all settings are copied over
though, like custom clip planes or the 'lock view to object'.
- since some view3d ops are now on area level, the operators
for it should keep track of that.
Bugfix in transform: quat initialize in operator-invoke missed
one zero.
Als brought back GE to compile for missing Ipos and channels.
2009-01-19 16:54:41 +00:00
|
|
|
void view3d_align_axis_to_vector(struct View3D *v3d, struct RegionView3D *rv3d, int axisidx, float vec[3]);
|
2008-12-30 16:03:29 +00:00
|
|
|
|
2009-01-10 18:33:16 +00:00
|
|
|
void drawcircball(int mode, float *cent, float rad, float tmat[][4]);
|
|
|
|
|
|
2009-01-01 19:18:03 +00:00
|
|
|
/* backbuffer select and draw support */
|
2009-01-15 15:01:39 +00:00
|
|
|
void view3d_validate_backbuf(struct ViewContext *vc);
|
2009-01-01 19:18:03 +00:00
|
|
|
struct ImBuf *view3d_read_backbuf(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
|
2009-01-15 15:01:39 +00:00
|
|
|
unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, short mval[2], int size, unsigned int min, unsigned int max, int *dist, short strict,
|
|
|
|
|
void *handle, unsigned int (*indextest)(void *handle, unsigned int index));
|
2009-01-01 19:18:03 +00:00
|
|
|
unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y);
|
2008-12-30 16:03:29 +00:00
|
|
|
|
2009-11-30 01:13:46 +00:00
|
|
|
/* draws and does a 4x4 sample */
|
2009-02-19 23:53:40 +00:00
|
|
|
int view_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, short *mval, float mouse_worldloc[3]);
|
|
|
|
|
|
2009-11-30 01:13:46 +00:00
|
|
|
/* only draw so view_autodist_simple can be called many times after */
|
2010-01-01 16:46:27 +00:00
|
|
|
int view_autodist_init(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, int mode);
|
2010-01-01 17:48:48 +00:00
|
|
|
int view_autodist_simple(struct ARegion *ar, short *mval, float mouse_worldloc[3], int margin, float *force_depth);
|
|
|
|
|
int view_autodist_depth(struct ARegion *ar, short *mval, int margin, float *depth);
|
2009-11-30 01:13:46 +00:00
|
|
|
|
2009-01-05 15:19:31 +00:00
|
|
|
/* select */
|
|
|
|
|
#define MAXPICKBUF 10000
|
|
|
|
|
short view3d_opengl_select(struct ViewContext *vc, unsigned int *buffer, unsigned int bufsize, rcti *input);
|
2009-01-17 03:31:56 +00:00
|
|
|
|
2009-01-13 15:18:41 +00:00
|
|
|
void view3d_set_viewcontext(struct bContext *C, struct ViewContext *vc);
|
2009-01-17 03:31:56 +00:00
|
|
|
void view3d_operator_needs_opengl(const struct bContext *C);
|
2009-02-13 17:37:01 +00:00
|
|
|
void view3d_get_view_aligned_coordinate(struct ViewContext *vc, float *fp, short mval[2]);
|
2009-10-27 19:53:34 +00:00
|
|
|
void view3d_get_transformation(struct ARegion *ar, struct RegionView3D *rv3d, struct Object *ob, struct bglMats *mats);
|
2009-01-15 15:01:39 +00:00
|
|
|
|
2009-01-14 16:13:50 +00:00
|
|
|
/* XXX should move to arithb.c */
|
|
|
|
|
int edge_inside_circle(short centx, short centy, short rad, short x1, short y1, short x2, short y2);
|
2009-02-25 19:29:58 +00:00
|
|
|
int lasso_inside(short mcords[][2], short moves, short sx, short sy);
|
|
|
|
|
int lasso_inside_edge(short mcords[][2], short moves, int x0, int y0, int x1, int y1);
|
2009-01-05 15:19:31 +00:00
|
|
|
|
2009-06-26 15:48:09 +00:00
|
|
|
/* get 3d region from context, also if mouse is in header or toolbar */
|
|
|
|
|
struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C);
|
2.5
Vertex Paint back!
Added WM level "paint cursor" system, which manages a custom painting
cursor for tools or modes.
- Activate it with WM_paint_cursor_activate(). That function wants two
callbacks, a poll(C) to check whether there's a cursor in given context
and ARegion, and a draw(C, x, y) which gets called when appropriate.
- While paintcursor is active, the WM handles necessary redrawing events
for all regions, also to nicely clear the cursor on region exit.
- WM_paint_cursor_activate returns a handle, which you have to use to
end the paint cursor. This handle also means you can register as many
custom cursors as you want.
At the moment, vertex paint mode registers only a mousemove handler,
all other events are still normally handled. This is stuff for the
future todo.
2009-01-09 13:55:45 +00:00
|
|
|
|
2009-10-11 19:57:56 +00:00
|
|
|
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d);
|
|
|
|
|
|
2010-06-04 01:39:34 +00:00
|
|
|
int ED_view3d_scene_layer_set(int lay, const int *values, int *active);
|
2009-10-26 12:42:25 +00:00
|
|
|
|
2009-10-28 18:03:04 +00:00
|
|
|
int ED_view3d_context_activate(struct bContext *C);
|
|
|
|
|
void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct ARegion *ar,
|
|
|
|
|
int winx, int winy, float viewmat[][4], float winmat[][4]);
|
|
|
|
|
|
2010-03-08 20:08:04 +00:00
|
|
|
struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey);
|
2010-03-16 17:37:34 +00:00
|
|
|
struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, int drawtype);
|
2010-03-08 20:08:04 +00:00
|
|
|
|
2009-11-21 16:44:05 +00:00
|
|
|
void view3d_clipping_local(struct RegionView3D *rv3d, float mat[][4]);
|
|
|
|
|
|
Drag and drop 2.5 integration! Finally, slashdot regulars can use
Blender too now! :)
** Drag works as follows:
- drag-able items are defined by the standard interface ui toolkit
- each button can get this feature, via uiButSetDragXXX(but, ...).
There are calls to define drag-able images, ID blocks, RNA paths,
file paths, and so on. By default you drag an icon, exceptionally
an ImBuf
- Drag items are registered centrally in the WM, it allows more drag
items simultaneous too, but not implemented
** Drop works as follows:
- On mouse release, and if drag items exist in the WM, it converts
the mouse event to an EVT_DROP type. This event then gets the full
drag info as customdata
- drop regions are defined with WM_dropbox_add(), similar to keymaps
you can make a "drop map" this way, which become 'drop map handlers'
in the queues.
- next to that the UI kit handles some common button types (like
accepting ID or names) to be catching a drop event too.
- Every "drop box" has two callbacks:
- poll() = check if the event drag data is relevant for this box
- copy() = fill in custom properties in the dropbox to initialize
an operator
- The dropbox handler then calls its standard Operator with its
dropbox properties.
** Currently implemented
Drag items:
- ID icons in browse buttons
- ID icons in context menu of properties region
- ID icons in outliner and rna viewer
- FileBrowser icons
- FileBrowser preview images
Drag-able icons are subtly visualized by making them brighter a bit
on mouse-over. In case the icon is a button or UI element too (most
cases), the drag-able feature will make the item react to
mouse-release instead of mouse-press.
Drop options:
- UI buttons: ID and text buttons (paste name)
- View3d: Object ID drop copies object
- View3d: Material ID drop assigns to object under cursor
- View3d: Image ID drop assigns to object UV texture under cursor
- Sequencer: Path drop will add either Image or Movie strip
- Image window: Path drop will open image
** Drag and drop Notes:
- Dropping into another Blender window (from same application) works
too. I've added code that passes on mousemoves and clicks to other
windows, without activating them though. This does make using multi-window
Blender a bit friendler.
- Dropping a file path to an image, is not the same as dropping an
Image ID... keep this in mind. Sequencer for example wants paths to
be dropped, textures in 3d window wants an Image ID.
- Although drop boxes could be defined via Python, I suggest they're
part of the UI and editor design (= how we want an editor to work), and
not default offered configurable like keymaps.
- At the moment only one item can be dragged at a time. This is for
several reasons.... For one, Blender doesn't have a well defined
uniform way to define "what is selected" (files, outliner items, etc).
Secondly there's potential conflicts on what todo when you drop mixed
drag sets on spots. All undefined stuff... nice for later.
- Example to bypass the above: a collection of images that form a strip,
should be represented in filewindow as a single sequence anyway.
This then will fit well and gets handled neatly by design.
- Another option to check is to allow multiple options per drop... it
could show the operator as a sort of menu, allowing arrow or scrollwheel
to choose. For time being I'd prefer to try to design a singular drop
though, just offer only one drop action per data type on given spots.
- What does work already, but a tad slow, is to use a function that
detects an object (type) under cursor, so a drag item's option can be
further refined (like drop object on object = parent). (disabled)
** More notes
- Added saving for Region layouts (like split points for toolbar)
- Label buttons now handle mouse over
- File list: added full path entry for drop feature.
- Filesel bugfix: wm_operator_exec() got called there and fully handled,
while WM event code tried same. Added new OPERATOR_HANDLED flag for this.
Maybe python needs it too?
- Cocoa: added window move event, so multi-win setups work OK (didnt save).
- Interface_handlers.c: removed win->active
- Severe area copy bug: area handlers were not set to NULL
- Filesel bugfix: next/prev folder list was not copied on area copies
** Leftover todos
- Cocoa windows seem to hang on cases still... needs check
- Cocoa 'draw overlap' swap doesn't work
- Cocoa window loses focus permanently on using Spotlight
(for these reasons, makefile building has Carbon as default atm)
- ListView templates in UI cannot become dragged yet, needs review...
it consists of two overlapping UI elements, preventing handling icon clicks.
- There's already Ghost library code to handle dropping from OS
into Blender window. I've noticed this code is unfinished for Macs, but
seems to be complete for Windows. Needs test... currently, an external
drop event will print in console when succesfully delivered to Blender's WM.
2010-01-26 18:18:21 +00:00
|
|
|
Base *ED_view3d_give_base_under_cursor(struct bContext *C, short *mval);
|
2010-01-30 03:22:22 +00:00
|
|
|
void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *ar);
|
Drag and drop 2.5 integration! Finally, slashdot regulars can use
Blender too now! :)
** Drag works as follows:
- drag-able items are defined by the standard interface ui toolkit
- each button can get this feature, via uiButSetDragXXX(but, ...).
There are calls to define drag-able images, ID blocks, RNA paths,
file paths, and so on. By default you drag an icon, exceptionally
an ImBuf
- Drag items are registered centrally in the WM, it allows more drag
items simultaneous too, but not implemented
** Drop works as follows:
- On mouse release, and if drag items exist in the WM, it converts
the mouse event to an EVT_DROP type. This event then gets the full
drag info as customdata
- drop regions are defined with WM_dropbox_add(), similar to keymaps
you can make a "drop map" this way, which become 'drop map handlers'
in the queues.
- next to that the UI kit handles some common button types (like
accepting ID or names) to be catching a drop event too.
- Every "drop box" has two callbacks:
- poll() = check if the event drag data is relevant for this box
- copy() = fill in custom properties in the dropbox to initialize
an operator
- The dropbox handler then calls its standard Operator with its
dropbox properties.
** Currently implemented
Drag items:
- ID icons in browse buttons
- ID icons in context menu of properties region
- ID icons in outliner and rna viewer
- FileBrowser icons
- FileBrowser preview images
Drag-able icons are subtly visualized by making them brighter a bit
on mouse-over. In case the icon is a button or UI element too (most
cases), the drag-able feature will make the item react to
mouse-release instead of mouse-press.
Drop options:
- UI buttons: ID and text buttons (paste name)
- View3d: Object ID drop copies object
- View3d: Material ID drop assigns to object under cursor
- View3d: Image ID drop assigns to object UV texture under cursor
- Sequencer: Path drop will add either Image or Movie strip
- Image window: Path drop will open image
** Drag and drop Notes:
- Dropping into another Blender window (from same application) works
too. I've added code that passes on mousemoves and clicks to other
windows, without activating them though. This does make using multi-window
Blender a bit friendler.
- Dropping a file path to an image, is not the same as dropping an
Image ID... keep this in mind. Sequencer for example wants paths to
be dropped, textures in 3d window wants an Image ID.
- Although drop boxes could be defined via Python, I suggest they're
part of the UI and editor design (= how we want an editor to work), and
not default offered configurable like keymaps.
- At the moment only one item can be dragged at a time. This is for
several reasons.... For one, Blender doesn't have a well defined
uniform way to define "what is selected" (files, outliner items, etc).
Secondly there's potential conflicts on what todo when you drop mixed
drag sets on spots. All undefined stuff... nice for later.
- Example to bypass the above: a collection of images that form a strip,
should be represented in filewindow as a single sequence anyway.
This then will fit well and gets handled neatly by design.
- Another option to check is to allow multiple options per drop... it
could show the operator as a sort of menu, allowing arrow or scrollwheel
to choose. For time being I'd prefer to try to design a singular drop
though, just offer only one drop action per data type on given spots.
- What does work already, but a tad slow, is to use a function that
detects an object (type) under cursor, so a drag item's option can be
further refined (like drop object on object = parent). (disabled)
** More notes
- Added saving for Region layouts (like split points for toolbar)
- Label buttons now handle mouse over
- File list: added full path entry for drop feature.
- Filesel bugfix: wm_operator_exec() got called there and fully handled,
while WM event code tried same. Added new OPERATOR_HANDLED flag for this.
Maybe python needs it too?
- Cocoa: added window move event, so multi-win setups work OK (didnt save).
- Interface_handlers.c: removed win->active
- Severe area copy bug: area handlers were not set to NULL
- Filesel bugfix: next/prev folder list was not copied on area copies
** Leftover todos
- Cocoa windows seem to hang on cases still... needs check
- Cocoa 'draw overlap' swap doesn't work
- Cocoa window loses focus permanently on using Spotlight
(for these reasons, makefile building has Carbon as default atm)
- ListView templates in UI cannot become dragged yet, needs review...
it consists of two overlapping UI elements, preventing handling icon clicks.
- There's already Ghost library code to handle dropping from OS
into Blender window. I've noticed this code is unfinished for Macs, but
seems to be complete for Windows. Needs test... currently, an external
drop event will print in console when succesfully delivered to Blender's WM.
2010-01-26 18:18:21 +00:00
|
|
|
|
2008-12-23 19:47:33 +00:00
|
|
|
#endif /* ED_VIEW3D_H */
|
|
|
|
|
|