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
|
|
|
/**
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* ***** 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,
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef TRANSFORM_H
|
|
|
|
#define TRANSFORM_H
|
|
|
|
|
2009-07-08 16:17:47 +00:00
|
|
|
#include "ED_transform.h"
|
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-09-22 08:41:03 +00:00
|
|
|
#include "BLI_editVert.h"
|
|
|
|
|
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
|
|
|
/* ************************** Types ***************************** */
|
|
|
|
|
|
|
|
struct TransInfo;
|
|
|
|
struct TransData;
|
2009-09-28 19:49:36 +00:00
|
|
|
struct TransformOrientation;
|
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 TransSnap;
|
|
|
|
struct NumInput;
|
|
|
|
struct Object;
|
|
|
|
struct View3D;
|
|
|
|
struct ScrArea;
|
|
|
|
struct Scene;
|
|
|
|
struct bPose;
|
|
|
|
struct bConstraint;
|
|
|
|
struct BezTriple;
|
|
|
|
struct wmOperatorType;
|
2009-01-03 22:15:59 +00:00
|
|
|
struct wmOperator;
|
2.5
Modal keymaps.
I've tried to make it as simple as possible, yet still using sufficient facilities to enable self-documenting UIs, saving/reading in files, and proper Python support.
The simplicity is: the 'modal keymap' just checks an event, uses event matching similarly to other keymap matching, and if there's a match it changes the event type, and sets the event value to what the modal keymap has defined. The event values are being defined using EnumPropertyItem structs, so the UI will be able to show all options in self-documenting way.
This system also allows to still handle hardcoded own events.
Tech doc:
1) define keymap
- Create map with unique name, WM_modalkeymap_add()
- Give map property definitions (EnumPropertyItem *)
This only for UI, so user can get information on available options
2) items
- WM_modalkeymap_add_item(): give it an enum value for events
3) activate
- In keymap definition code, assign the modal keymap to operatortype
WM_modalkeymap_assign()
4) event manager
- The event handler will check for modal keymap, if so:
- If the modal map has a match:
- Sets event->type to EVT_MODAL_MAP
- Sets event->val to the enum value
5) modal handler
- If event type is EVT_MODAL_MAP:
- Check event->val, handle it
- Other events can just be handled still
Two examples added in the code:
editors/transform/transform.c: transform_modal_keymap()
editors/screen/screen_ops.c: keymap_modal_set()
Also: to support 'key release' the define KM_RELEASE now is officially
used in event manager, this is not '0', so don't check key events with
the old convention if(event->val) but use if(event->val==KM_PRESS)
2009-07-21 11:03:07 +00:00
|
|
|
struct wmWindowManager;
|
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 bContext;
|
|
|
|
struct wmEvent;
|
2009-02-16 03:01:56 +00:00
|
|
|
struct wmTimer;
|
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;
|
2009-09-28 19:49:36 +00:00
|
|
|
struct ReportList;
|
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
|
|
|
|
|
|
|
typedef struct NDofInput {
|
|
|
|
int flag;
|
|
|
|
int axis;
|
|
|
|
float fval[7];
|
|
|
|
float factor[3];
|
|
|
|
} NDofInput;
|
|
|
|
|
|
|
|
typedef struct NumInput {
|
|
|
|
short idx;
|
|
|
|
short idx_max;
|
|
|
|
short flag; /* Different flags to indicate different behaviors */
|
2009-01-06 02:27:07 +00:00
|
|
|
char inv[3]; /* If the value is inverted or not */
|
|
|
|
float val[3]; /* Direct value of the input */
|
|
|
|
int ctrl[3]; /* Control to indicate what to do with the numbers that are typed */
|
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
|
|
|
} NumInput ;
|
|
|
|
|
|
|
|
/*
|
|
|
|
The ctrl value has different meaning:
|
|
|
|
0 : No value has been typed
|
2009-07-12 02:01:13 +00:00
|
|
|
|
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
|
|
|
otherwise, |value| - 1 is where the cursor is located after the period
|
|
|
|
Positive : number is positive
|
|
|
|
Negative : number is negative
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct TransSnap {
|
|
|
|
short modePoint;
|
|
|
|
short modeTarget;
|
2009-03-29 19:52:53 +00:00
|
|
|
short mode;
|
|
|
|
short align;
|
|
|
|
short status;
|
2009-03-17 21:26:09 +00:00
|
|
|
float snapPoint[3]; /* snapping from this point */
|
2009-04-20 15:06:46 +00:00
|
|
|
float snapTarget[3]; /* to this point */
|
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
|
|
|
float snapNormal[3];
|
|
|
|
float snapTangent[3];
|
|
|
|
float dist; // Distance from snapPoint to snapTarget
|
|
|
|
double last;
|
|
|
|
void (*applySnap)(struct TransInfo *, float *);
|
|
|
|
void (*calcSnap)(struct TransInfo *, float *);
|
|
|
|
void (*targetSnap)(struct TransInfo *);
|
|
|
|
float (*distance)(struct TransInfo *, float p1[3], float p2[3]); // Get the transform distance between two points (used by Closest snap)
|
|
|
|
} TransSnap;
|
|
|
|
|
|
|
|
typedef struct TransCon {
|
|
|
|
char text[50]; /* Description of the Constraint for header_print */
|
|
|
|
float mtx[3][3]; /* Matrix of the Constraint space */
|
|
|
|
float imtx[3][3]; /* Inverse Matrix of the Constraint space */
|
|
|
|
float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */
|
2009-07-12 02:01:13 +00:00
|
|
|
float center[3]; /* transformation center to define where to draw the view widget
|
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
|
|
|
ALWAYS in global space. Unlike the transformation center */
|
|
|
|
short imval[2]; /* initial mouse value for visual calculation */
|
|
|
|
/* the one in TransInfo is not garanty to stay the same (Rotates change it) */
|
|
|
|
int mode; /* Mode flags of the Constraint */
|
|
|
|
void (*drawExtra)(struct TransInfo *);
|
|
|
|
/* For constraints that needs to draw differently from the other
|
|
|
|
uses this instead of the generic draw function */
|
|
|
|
void (*applyVec)(struct TransInfo *, struct TransData *, float *, float *, float *);
|
|
|
|
/* Apply function pointer for linear vectorial transformation */
|
|
|
|
/* The last three parameters are pointers to the in/out/printable vectors */
|
|
|
|
void (*applySize)(struct TransInfo *, struct TransData *, float [3][3]);
|
|
|
|
/* Apply function pointer for size transformation */
|
|
|
|
void (*applyRot)(struct TransInfo *, struct TransData *, float [3], float *);
|
|
|
|
/* Apply function pointer for rotation transformation */
|
|
|
|
} TransCon;
|
|
|
|
|
|
|
|
typedef struct TransDataExtension {
|
|
|
|
float drot[3]; /* Initial object drot */
|
2009-09-28 10:19:20 +00:00
|
|
|
float dquat[4]; /* Initial object dquat */
|
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
|
|
|
float dsize[3]; /* Initial object dsize */
|
|
|
|
float *rot; /* Rotation of the data to transform (Faculative) */
|
|
|
|
float irot[3]; /* Initial rotation */
|
|
|
|
float *quat; /* Rotation quaternion of the data to transform (Faculative) */
|
|
|
|
float iquat[4]; /* Initial rotation quaternion */
|
|
|
|
float *size; /* Size of the data to transform (Faculative) */
|
|
|
|
float isize[3]; /* Initial size */
|
2009-07-12 02:01:13 +00:00
|
|
|
float obmat[4][4]; /* Object matrix */
|
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
|
|
|
} TransDataExtension;
|
|
|
|
|
|
|
|
typedef struct TransData2D {
|
|
|
|
float loc[3]; /* Location of data used to transform (x,y,0) */
|
|
|
|
float *loc2d; /* Pointer to real 2d location of data */
|
|
|
|
} TransData2D;
|
|
|
|
|
|
|
|
/* we need to store 2 handles for each transdata incase the other handle wasnt selected */
|
|
|
|
typedef struct TransDataCurveHandleFlags {
|
|
|
|
char ih1, ih2;
|
|
|
|
char *h1, *h2;
|
|
|
|
} TransDataCurveHandleFlags;
|
|
|
|
|
2009-01-21 07:01:20 +00:00
|
|
|
/* for sequencer transform */
|
|
|
|
typedef struct TransDataSeq {
|
|
|
|
struct Sequence *seq;
|
2009-01-23 23:14:02 +00:00
|
|
|
int flag; /* a copy of seq->flag that may be modified for nested strips */
|
2009-01-24 05:38:25 +00:00
|
|
|
short start_offset; /* use this so we can have transform data at the strips start, but apply correctly to the start frame */
|
2009-01-21 07:01:20 +00:00
|
|
|
short sel_flag; /* one of SELECT, SEQ_LEFTSEL and SEQ_RIGHTSEL */
|
2009-07-12 02:01:13 +00:00
|
|
|
|
2009-01-21 07:01:20 +00:00
|
|
|
} TransDataSeq;
|
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-06-09 11:26:45 +00:00
|
|
|
/* for NLA transform (stored in td->extra pointer) */
|
|
|
|
typedef struct TransDataNla {
|
2009-07-12 03:42:39 +00:00
|
|
|
ID *id; /* ID-block NLA-data is attached to */
|
|
|
|
|
2009-07-07 05:41:59 +00:00
|
|
|
struct NlaTrack *oldTrack; /* Original NLA-Track that the strip belongs to */
|
|
|
|
struct NlaTrack *nlt; /* Current NLA-Track that the strip belongs to */
|
|
|
|
|
|
|
|
struct NlaStrip *strip; /* NLA-strip this data represents */
|
|
|
|
|
|
|
|
/* dummy values for transform to write in - must have 3 elements... */
|
|
|
|
float h1[3]; /* start handle */
|
|
|
|
float h2[3]; /* end handle */
|
|
|
|
|
|
|
|
int trackIndex; /* index of track that strip is currently in */
|
|
|
|
int handle; /* handle-index: 0 for dummy entry, -1 for start, 1 for end, 2 for both ends */
|
2009-06-09 11:26:45 +00:00
|
|
|
} TransDataNla;
|
|
|
|
|
2009-09-22 08:41:03 +00:00
|
|
|
struct LinkNode;
|
|
|
|
struct EditEdge;
|
|
|
|
struct EditVert;
|
|
|
|
struct GHash;
|
|
|
|
typedef struct TransDataSlideUv {
|
|
|
|
float origuv[2];
|
|
|
|
float *uv_up, *uv_down;
|
|
|
|
//float *fuv[4];
|
|
|
|
struct LinkNode *fuv_list;
|
|
|
|
} TransDataSlideUv;
|
|
|
|
|
|
|
|
typedef struct TransDataSlideVert {
|
|
|
|
struct EditEdge *up, *down;
|
|
|
|
struct EditVert origvert;
|
|
|
|
} TransDataSlideVert;
|
|
|
|
|
|
|
|
typedef struct SlideData {
|
|
|
|
TransDataSlideUv *slideuv, *suv_last;
|
|
|
|
int totuv, uvlay_tot;
|
|
|
|
struct GHash *vhash, **uvhash;
|
|
|
|
struct EditVert *nearest;
|
|
|
|
struct LinkNode *edgelist, *vertlist;
|
|
|
|
short start[2], end[2];
|
|
|
|
} SlideData;
|
|
|
|
|
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
|
|
|
typedef struct TransData {
|
|
|
|
float dist; /* Distance needed to affect element (for Proportionnal Editing) */
|
|
|
|
float rdist; /* Distance to the nearest element (for Proportionnal Editing) */
|
|
|
|
float factor; /* Factor of the transformation (for Proportionnal Editing) */
|
|
|
|
float *loc; /* Location of the data to transform */
|
|
|
|
float iloc[3]; /* Initial location */
|
|
|
|
float *val; /* Value pointer for special transforms */
|
|
|
|
float ival; /* Old value*/
|
|
|
|
float center[3]; /* Individual data center */
|
|
|
|
float mtx[3][3]; /* Transformation matrix from data space to global space */
|
|
|
|
float smtx[3][3]; /* Transformation matrix from global space to data space */
|
|
|
|
float axismtx[3][3];/* Axis orientation matrix of the data */
|
|
|
|
struct Object *ob;
|
|
|
|
struct bConstraint *con; /* for objects/bones, the first constraint in its constraint stack */
|
|
|
|
TransDataExtension *ext; /* for objects, poses. 1 single malloc per TransInfo! */
|
|
|
|
TransDataCurveHandleFlags *hdata; /* for curves, stores handle flags for modification/cancel */
|
|
|
|
void *extra; /* extra data (mirrored element pointer, in editmode mesh to EditVert) (editbone for roll fixing) (...) */
|
|
|
|
short flag; /* Various flags */
|
|
|
|
short protectflag; /* If set, copy of Object or PoseChannel protection */
|
2009-10-08 06:39:45 +00:00
|
|
|
int rotOrder; /* rotation mode, as defined in eRotationModes (DNA_action_types.h) */
|
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
|
|
|
} TransData;
|
|
|
|
|
2008-12-29 20:37:54 +00:00
|
|
|
typedef struct MouseInput {
|
|
|
|
void (*apply)(struct TransInfo *, struct MouseInput *, short [2], float [3]);
|
2009-07-12 02:01:13 +00:00
|
|
|
|
2008-12-29 20:37:54 +00:00
|
|
|
short imval[2]; /* initial mouse position */
|
2009-07-12 02:01:13 +00:00
|
|
|
char precision;
|
2008-12-29 20:37:54 +00:00
|
|
|
short precision_mval[2]; /* mouse position when precision key was pressed */
|
|
|
|
int center[2];
|
|
|
|
float factor;
|
2009-09-21 00:48:36 +00:00
|
|
|
void *data; /* additional data, if needed by the particular function */
|
2008-12-29 20:37:54 +00:00
|
|
|
} MouseInput;
|
|
|
|
|
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
|
|
|
typedef struct TransInfo {
|
|
|
|
int mode; /* current mode */
|
|
|
|
int flag; /* generic flags for special behaviors */
|
2009-01-03 22:15:59 +00:00
|
|
|
int modifiers; /* special modifiers, by function, not key */
|
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
|
|
|
short state; /* current state (running, canceled,...)*/
|
2008-12-29 06:06:59 +00:00
|
|
|
int options; /* current context/options for transform */
|
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
|
|
|
float val; /* init value for some transformations (and rotation angle) */
|
|
|
|
float fac; /* factor for distance based transform */
|
|
|
|
int (*transform)(struct TransInfo *, short *);
|
|
|
|
/* transform function pointer */
|
2008-12-29 20:37:54 +00:00
|
|
|
int (*handleEvent)(struct TransInfo *, struct wmEvent *);
|
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
|
|
|
/* event handler function pointer RETURN 1 if redraw is needed */
|
|
|
|
int total; /* total number of transformed data */
|
|
|
|
TransData *data; /* transformed data (array) */
|
|
|
|
TransDataExtension *ext; /* transformed data extension (array) */
|
|
|
|
TransData2D *data2d; /* transformed data for 2d (array) */
|
|
|
|
TransCon con; /* transformed constraint */
|
|
|
|
TransSnap tsnap;
|
|
|
|
NumInput num; /* numerical input */
|
|
|
|
NDofInput ndof; /* ndof input */
|
2008-12-29 20:37:54 +00:00
|
|
|
MouseInput mouse; /* mouse input */
|
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
|
|
|
char redraw; /* redraw flag */
|
2009-03-06 15:50:15 +00:00
|
|
|
float prop_size; /* proportional circle radius */
|
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
|
|
|
char proptext[20]; /* proportional falloff text */
|
|
|
|
float center[3]; /* center of transformation */
|
|
|
|
int center2d[2]; /* center in screen coordinates */
|
|
|
|
short imval[2]; /* initial mouse position */
|
2009-01-28 15:39:39 +00:00
|
|
|
short event_type; /* event->type used to invoke transform */
|
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
|
|
|
short idx_max; /* maximum index on the input vector */
|
|
|
|
float snap[3]; /* Snapping Gears */
|
2009-01-24 05:38:25 +00:00
|
|
|
char frame_side; /* Mouse side of the cfra, 'L', 'R' or 'B' */
|
2009-07-12 02:01:13 +00:00
|
|
|
|
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
|
|
|
float viewmat[4][4]; /* copy from G.vd, prevents feedback, */
|
|
|
|
float viewinv[4][4]; /* and to make sure we don't have to */
|
|
|
|
float persmat[4][4]; /* access G.vd from other space types */
|
|
|
|
float persinv[4][4];
|
|
|
|
short persp;
|
|
|
|
short around;
|
|
|
|
char spacetype; /* spacetype where transforming is */
|
2009-04-30 11:47:35 +00:00
|
|
|
char helpline; /* helpline modes (not to be confused with hotline) */
|
2009-07-12 02:01:13 +00:00
|
|
|
|
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
|
|
|
float vec[3]; /* translation, to show for widget */
|
|
|
|
float mat[3][3]; /* rot/rescale, to show for widget */
|
2009-07-12 02:01:13 +00:00
|
|
|
|
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
|
|
|
char *undostr; /* if set, uses this string for undo */
|
|
|
|
float spacemtx[3][3]; /* orientation matrix of the current space */
|
|
|
|
char spacename[32]; /* name of the current space */
|
2009-07-12 02:01:13 +00:00
|
|
|
|
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 Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */
|
2009-07-12 02:01:13 +00:00
|
|
|
|
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
|
|
|
void *customData; /* Per Transform custom data */
|
2009-09-22 20:16:56 +00:00
|
|
|
void (*customFree)(struct TransInfo *); /* if a special free function is needed */
|
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
|
|
|
|
|
|
|
/*************** NEW STUFF *********************/
|
|
|
|
|
2009-03-06 15:50:15 +00:00
|
|
|
short current_orientation;
|
|
|
|
|
|
|
|
short prop_mode;
|
|
|
|
|
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
|
|
|
float values[4];
|
2009-03-06 15:50:15 +00:00
|
|
|
float auto_values[4];
|
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
|
|
|
void *view;
|
|
|
|
struct ScrArea *sa;
|
|
|
|
struct ARegion *ar;
|
|
|
|
struct Scene *scene;
|
2009-06-23 00:41:55 +00:00
|
|
|
struct ToolSettings *settings;
|
2009-02-16 03:01:56 +00:00
|
|
|
struct wmTimer *animtimer;
|
2008-12-31 22:43:29 +00:00
|
|
|
short mval[2]; /* current mouse position */
|
|
|
|
struct Object *obedit;
|
2009-01-10 18:33:16 +00:00
|
|
|
void *draw_handle;
|
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
|
|
|
} TransInfo;
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************** Macros & Prototypes *********************** */
|
|
|
|
|
|
|
|
/* NUMINPUT FLAGS */
|
|
|
|
#define NUM_NULL_ONE 2
|
|
|
|
#define NUM_NO_NEGATIVE 4
|
|
|
|
#define NUM_NO_ZERO 8
|
|
|
|
#define NUM_NO_FRACTION 16
|
|
|
|
#define NUM_AFFECT_ALL 32
|
|
|
|
|
|
|
|
/* NDOFINPUT FLAGS */
|
|
|
|
#define NDOF_INIT 1
|
|
|
|
|
|
|
|
/* transinfo->state */
|
|
|
|
#define TRANS_RUNNING 0
|
|
|
|
#define TRANS_CONFIRM 1
|
|
|
|
#define TRANS_CANCEL 2
|
|
|
|
|
|
|
|
/* transinfo->flag */
|
|
|
|
#define T_OBJECT (1 << 0)
|
|
|
|
#define T_EDIT (1 << 1)
|
|
|
|
#define T_POSE (1 << 2)
|
|
|
|
#define T_TEXTURE (1 << 3)
|
|
|
|
#define T_CAMERA (1 << 4)
|
2009-07-12 02:01:13 +00:00
|
|
|
// trans on points, having no rotation/scale
|
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
|
|
|
#define T_POINTS (1 << 6)
|
|
|
|
// for manipulator exceptions, like scaling using center point, drawing help lines
|
|
|
|
#define T_USES_MANIPULATOR (1 << 7)
|
|
|
|
|
|
|
|
/* restrictions flags */
|
|
|
|
#define T_ALL_RESTRICTIONS ((1 << 8)|(1 << 9)|(1 << 10))
|
|
|
|
#define T_NO_CONSTRAINT (1 << 8)
|
|
|
|
#define T_NULL_ONE (1 << 9)
|
|
|
|
#define T_NO_ZERO (1 << 10)
|
|
|
|
|
|
|
|
#define T_PROP_EDIT (1 << 11)
|
|
|
|
#define T_PROP_CONNECTED (1 << 12)
|
|
|
|
|
|
|
|
#define T_V3D_ALIGN (1 << 14)
|
|
|
|
/* for 2d views like uv or ipo */
|
2009-07-12 02:01:13 +00:00
|
|
|
#define T_2D_EDIT (1 << 15)
|
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
|
|
|
#define T_CLIP_UV (1 << 16)
|
|
|
|
|
|
|
|
#define T_FREE_CUSTOMDATA (1 << 17)
|
|
|
|
/* auto-ik is on */
|
|
|
|
#define T_AUTOIK (1 << 18)
|
|
|
|
|
2009-03-06 15:50:15 +00:00
|
|
|
#define T_MIRROR (1 << 19)
|
|
|
|
|
|
|
|
#define T_AUTOVALUES (1 << 20)
|
|
|
|
|
|
|
|
/* to specificy if we save back settings at the end */
|
|
|
|
#define T_MODAL (1 << 21)
|
|
|
|
|
2009-01-03 22:15:59 +00:00
|
|
|
/* TransInfo->modifiers */
|
|
|
|
#define MOD_CONSTRAINT_SELECT 0x01
|
|
|
|
#define MOD_PRECISION 0x02
|
|
|
|
#define MOD_SNAP_GEARS 0x04
|
|
|
|
#define MOD_CONSTRAINT_PLANE 0x08
|
|
|
|
|
|
|
|
|
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-04-30 11:47:35 +00:00
|
|
|
/* transinfo->helpline */
|
|
|
|
#define HLP_NONE 0
|
|
|
|
#define HLP_SPRING 1
|
|
|
|
#define HLP_ANGLE 2
|
|
|
|
#define HLP_HARROW 3
|
|
|
|
#define HLP_VARROW 4
|
|
|
|
#define HLP_TRACKBALL 5
|
|
|
|
|
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
|
|
|
/* transinfo->con->mode */
|
|
|
|
#define CON_APPLY 1
|
|
|
|
#define CON_AXIS0 2
|
|
|
|
#define CON_AXIS1 4
|
|
|
|
#define CON_AXIS2 8
|
|
|
|
#define CON_SELECT 16
|
|
|
|
#define CON_NOFLIP 32 /* does not reorient vector to face viewport when on */
|
2009-01-18 21:36:38 +00:00
|
|
|
#define CON_USER 64
|
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
|
|
|
|
|
|
|
/* transdata->flag */
|
|
|
|
#define TD_SELECTED 1
|
|
|
|
#define TD_ACTIVE (1 << 1)
|
|
|
|
#define TD_NOACTION (1 << 2)
|
|
|
|
#define TD_USEQUAT (1 << 3)
|
|
|
|
#define TD_NOTCONNECTED (1 << 4)
|
|
|
|
#define TD_SINGLESIZE (1 << 5) /* used for scaling of MetaElem->rad */
|
|
|
|
#define TD_TIMEONLY (1 << 8)
|
|
|
|
#define TD_NOCENTER (1 << 9)
|
|
|
|
#define TD_NO_EXT (1 << 10) /* ext abused for particle key timing */
|
|
|
|
#define TD_SKIP (1 << 11) /* don't transform this data */
|
|
|
|
#define TD_BEZTRIPLE (1 << 12) /* if this is a bez triple, we need to restore the handles, if this is set transdata->misc.hdata needs freeing */
|
|
|
|
#define TD_NO_LOC (1 << 13) /* when this is set, don't apply translation changes to this element */
|
2009-01-28 02:56:58 +00:00
|
|
|
#define TD_NOTIMESNAP (1 << 14) /* for Graph Editor autosnap, indicates that point should not undergo autosnapping */
|
2009-03-18 10:58:18 +00:00
|
|
|
#define TD_INTVALUES (1 << 15) /* for Graph Editor - curves that can only have int-values need their keyframes tagged with this */
|
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
|
|
|
|
|
|
|
/* transsnap->status */
|
|
|
|
#define SNAP_ON 1
|
2009-03-29 19:52:53 +00:00
|
|
|
#define SNAP_FORCED 2
|
|
|
|
#define TARGET_INIT 4
|
|
|
|
#define POINT_INIT 8
|
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
|
|
|
|
|
|
|
/* transsnap->modePoint */
|
|
|
|
#define SNAP_GRID 0
|
|
|
|
#define SNAP_GEO 1
|
|
|
|
|
|
|
|
/* transsnap->modeTarget */
|
|
|
|
#define SNAP_CLOSEST 0
|
|
|
|
#define SNAP_CENTER 1
|
|
|
|
#define SNAP_MEDIAN 2
|
|
|
|
#define SNAP_ACTIVE 3
|
|
|
|
|
|
|
|
|
|
|
|
void TFM_OT_transform(struct wmOperatorType *ot);
|
|
|
|
|
2009-03-28 20:46:38 +00:00
|
|
|
int initTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op, struct wmEvent *event, int mode);
|
2009-01-03 22:15:59 +00:00
|
|
|
void saveTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op);
|
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
|
|
|
void transformEvent(TransInfo *t, struct wmEvent *event);
|
2009-01-07 16:52:18 +00:00
|
|
|
void transformApply(struct bContext *C, TransInfo *t);
|
2008-12-31 17:11:42 +00:00
|
|
|
int transformEnd(struct bContext *C, TransInfo *t);
|
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
|
|
|
|
|
|
|
void setTransformViewMatrices(TransInfo *t);
|
|
|
|
void convertViewVec(TransInfo *t, float *vec, short dx, short dy);
|
|
|
|
void projectIntView(TransInfo *t, float *vec, int *adr);
|
|
|
|
void projectFloatView(TransInfo *t, float *vec, float *adr);
|
|
|
|
|
2009-01-20 20:44:36 +00:00
|
|
|
void applyAspectRatio(TransInfo *t, float *vec);
|
|
|
|
void removeAspectRatio(TransInfo *t, float *vec);
|
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
|
|
|
|
|
|
|
void initWarp(TransInfo *t);
|
|
|
|
int handleEventWarp(TransInfo *t, struct wmEvent *event);
|
|
|
|
int Warp(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initShear(TransInfo *t);
|
|
|
|
int handleEventShear(TransInfo *t, struct wmEvent *event);
|
|
|
|
int Shear(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initResize(TransInfo *t);
|
|
|
|
int Resize(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initTranslation(TransInfo *t);
|
|
|
|
int Translation(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initToSphere(TransInfo *t);
|
|
|
|
int ToSphere(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initRotation(TransInfo *t);
|
|
|
|
int Rotation(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initShrinkFatten(TransInfo *t);
|
|
|
|
int ShrinkFatten(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initTilt(TransInfo *t);
|
|
|
|
int Tilt(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initCurveShrinkFatten(TransInfo *t);
|
|
|
|
int CurveShrinkFatten(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initTrackball(TransInfo *t);
|
|
|
|
int Trackball(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initPushPull(TransInfo *t);
|
|
|
|
int PushPull(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initBevel(TransInfo *t);
|
|
|
|
int handleEventBevel(TransInfo *t, struct wmEvent *event);
|
|
|
|
int Bevel(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initBevelWeight(TransInfo *t);
|
|
|
|
int BevelWeight(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initCrease(TransInfo *t);
|
|
|
|
int Crease(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initBoneSize(TransInfo *t);
|
|
|
|
int BoneSize(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initBoneEnvelope(TransInfo *t);
|
|
|
|
int BoneEnvelope(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initBoneRoll(TransInfo *t);
|
|
|
|
int BoneRoll(TransInfo *t, short mval[2]);
|
|
|
|
|
2009-09-22 08:41:03 +00:00
|
|
|
void initEdgeSlide(TransInfo *t);
|
|
|
|
int EdgeSlide(TransInfo *t, short mval[2]);
|
|
|
|
|
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
|
|
|
void initTimeTranslate(TransInfo *t);
|
|
|
|
int TimeTranslate(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initTimeSlide(TransInfo *t);
|
|
|
|
int TimeSlide(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initTimeScale(TransInfo *t);
|
|
|
|
int TimeScale(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initBakeTime(TransInfo *t);
|
|
|
|
int BakeTime(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initMirror(TransInfo *t);
|
|
|
|
int Mirror(TransInfo *t, short mval[2]);
|
|
|
|
|
|
|
|
void initAlign(TransInfo *t);
|
|
|
|
int Align(TransInfo *t, short mval[2]);
|
|
|
|
|
2009-03-28 20:46:38 +00:00
|
|
|
void drawPropCircle(const struct bContext *C, TransInfo *t);
|
2009-01-10 18:33:16 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
void transform_modal_keymap(struct wmKeyConfig *keyconf);
|
2.5
Modal keymaps.
I've tried to make it as simple as possible, yet still using sufficient facilities to enable self-documenting UIs, saving/reading in files, and proper Python support.
The simplicity is: the 'modal keymap' just checks an event, uses event matching similarly to other keymap matching, and if there's a match it changes the event type, and sets the event value to what the modal keymap has defined. The event values are being defined using EnumPropertyItem structs, so the UI will be able to show all options in self-documenting way.
This system also allows to still handle hardcoded own events.
Tech doc:
1) define keymap
- Create map with unique name, WM_modalkeymap_add()
- Give map property definitions (EnumPropertyItem *)
This only for UI, so user can get information on available options
2) items
- WM_modalkeymap_add_item(): give it an enum value for events
3) activate
- In keymap definition code, assign the modal keymap to operatortype
WM_modalkeymap_assign()
4) event manager
- The event handler will check for modal keymap, if so:
- If the modal map has a match:
- Sets event->type to EVT_MODAL_MAP
- Sets event->val to the enum value
5) modal handler
- If event type is EVT_MODAL_MAP:
- Check event->val, handle it
- Other events can just be handled still
Two examples added in the code:
editors/transform/transform.c: transform_modal_keymap()
editors/screen/screen_ops.c: keymap_modal_set()
Also: to support 'key release' the define KM_RELEASE now is officially
used in event manager, this is not '0', so don't check key events with
the old convention if(event->val) but use if(event->val==KM_PRESS)
2009-07-21 11:03:07 +00:00
|
|
|
|
|
|
|
|
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
|
|
|
/*********************** transform_conversions.c ********** */
|
|
|
|
struct ListBase;
|
2009-01-28 02:56:58 +00:00
|
|
|
|
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
|
|
|
void flushTransGPactionData(TransInfo *t);
|
2009-01-28 02:56:58 +00:00
|
|
|
void flushTransGraphData(TransInfo *t);
|
|
|
|
void remake_graph_transdata(TransInfo *t, struct ListBase *anim_data);
|
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
|
|
|
void flushTransUVs(TransInfo *t);
|
|
|
|
void flushTransParticles(TransInfo *t);
|
|
|
|
int clipUVTransform(TransInfo *t, float *vec, int resize);
|
2009-01-04 01:08:01 +00:00
|
|
|
void flushTransNodes(TransInfo *t);
|
2009-01-21 07:01:20 +00:00
|
|
|
void flushTransSeq(TransInfo *t);
|
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
|
|
|
|
|
|
|
/*********************** exported from transform_manipulator.c ********** */
|
2009-07-08 15:01:28 +00:00
|
|
|
int calc_manipulator_stats(const struct bContext *C);
|
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
|
|
|
float get_drawsize(struct ARegion *ar, float *co);
|
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
|
|
|
|
|
|
|
/*********************** TransData Creation and General Handling *********** */
|
|
|
|
void createTransData(struct bContext *C, TransInfo *t);
|
|
|
|
void sort_trans_data_dist(TransInfo *t);
|
|
|
|
void add_tdi_poin(float *poin, float *old, float delta);
|
|
|
|
void special_aftertrans_update(TransInfo *t);
|
|
|
|
|
|
|
|
void transform_autoik_update(TransInfo *t, short mode);
|
|
|
|
|
2009-07-12 02:01:13 +00:00
|
|
|
int count_set_pose_transflags(int *out_mode, short around, struct Object *ob);
|
|
|
|
|
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
|
|
|
/* auto-keying stuff used by special_aftertrans_update */
|
2009-02-16 03:01:56 +00:00
|
|
|
void autokeyframe_ob_cb_func(struct Scene *scene, struct View3D *v3d, struct Object *ob, int tmode);
|
|
|
|
void autokeyframe_pose_cb_func(struct Scene *scene, struct View3D *v3d, struct Object *ob, int tmode, short targetless_ik);
|
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
|
|
|
|
|
|
|
/*********************** Constraints *****************************/
|
|
|
|
|
2009-03-28 20:46:38 +00:00
|
|
|
void drawConstraint(const struct bContext *C, TransInfo *t);
|
2009-01-10 18:33:16 +00:00
|
|
|
|
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
|
|
|
void getConstraintMatrix(TransInfo *t);
|
|
|
|
void setConstraint(TransInfo *t, float space[3][3], int mode, const char text[]);
|
|
|
|
void setLocalConstraint(TransInfo *t, int mode, const char text[]);
|
2009-10-07 20:55:14 +00:00
|
|
|
void setUserConstraint(TransInfo *t, short orientation, int mode, const char text[]);
|
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
|
|
|
|
|
|
|
void constraintNumInput(TransInfo *t, float vec[3]);
|
|
|
|
|
|
|
|
void getConstraintMatrix(TransInfo *t);
|
|
|
|
int isLockConstraint(TransInfo *t);
|
|
|
|
int getConstraintSpaceDimension(TransInfo *t);
|
|
|
|
char constraintModeToChar(TransInfo *t);
|
|
|
|
|
|
|
|
void startConstraint(TransInfo *t);
|
|
|
|
void stopConstraint(TransInfo *t);
|
|
|
|
|
|
|
|
void initSelectConstraint(TransInfo *t, float mtx[3][3]);
|
|
|
|
void selectConstraint(TransInfo *t);
|
|
|
|
void postSelectConstraint(TransInfo *t);
|
|
|
|
|
|
|
|
void setNearestAxis(TransInfo *t);
|
|
|
|
|
|
|
|
/*********************** Snapping ********************************/
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
NO_GEARS = 0,
|
|
|
|
BIG_GEARS = 1,
|
|
|
|
SMALL_GEARS = 2
|
|
|
|
} GearsType;
|
|
|
|
|
|
|
|
void snapGrid(TransInfo *t, float *val);
|
|
|
|
void snapGridAction(TransInfo *t, float *val, GearsType action);
|
|
|
|
|
2009-03-29 19:52:53 +00:00
|
|
|
void initSnapping(struct TransInfo *t, struct wmOperator *op);
|
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
|
|
|
void applySnapping(TransInfo *t, float *vec);
|
|
|
|
void resetSnapping(TransInfo *t);
|
|
|
|
int handleSnapping(TransInfo *t, struct wmEvent *event);
|
2009-03-28 20:46:38 +00:00
|
|
|
void drawSnapping(const struct bContext *C, TransInfo *t);
|
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
|
|
|
int usingSnappingNormal(TransInfo *t);
|
|
|
|
int validSnappingNormal(TransInfo *t);
|
|
|
|
|
2008-12-29 20:37:54 +00:00
|
|
|
/********************** Mouse Input ******************************/
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
INPUT_NONE,
|
|
|
|
INPUT_VECTOR,
|
|
|
|
INPUT_SPRING,
|
|
|
|
INPUT_SPRING_FLIP,
|
|
|
|
INPUT_ANGLE,
|
|
|
|
INPUT_TRACKBALL,
|
|
|
|
INPUT_HORIZONTAL_RATIO,
|
|
|
|
INPUT_HORIZONTAL_ABSOLUTE,
|
|
|
|
INPUT_VERTICAL_RATIO,
|
2009-09-21 00:48:36 +00:00
|
|
|
INPUT_VERTICAL_ABSOLUTE,
|
|
|
|
INPUT_CUSTOM_RATIO
|
2008-12-29 20:37:54 +00:00
|
|
|
} MouseInputMode;
|
|
|
|
|
|
|
|
void initMouseInput(TransInfo *t, MouseInput *mi, int center[2], short mval[2]);
|
|
|
|
void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode);
|
|
|
|
int handleMouseInput(struct TransInfo *t, struct MouseInput *mi, struct wmEvent *event);
|
|
|
|
void applyMouseInput(struct TransInfo *t, struct MouseInput *mi, short mval[2], float output[3]);
|
|
|
|
|
2009-09-21 00:48:36 +00:00
|
|
|
void setCustomPoints(TransInfo *t, MouseInput *mi, short start[2], short end[2]);
|
|
|
|
|
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
|
|
|
/*********************** Generics ********************************/
|
|
|
|
|
2009-03-28 20:46:38 +00:00
|
|
|
int initTransInfo(struct bContext *C, TransInfo *t, struct wmOperator *op, struct wmEvent *event);
|
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
|
|
|
void postTrans (TransInfo *t);
|
|
|
|
void resetTransRestrictions(TransInfo *t);
|
|
|
|
|
2009-01-10 18:33:16 +00:00
|
|
|
void drawLine(TransInfo *t, float *center, float *dir, char axis, short options);
|
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
|
|
|
|
|
|
|
TransDataCurveHandleFlags *initTransDataCurveHandes(TransData *td, struct BezTriple *bezt);
|
|
|
|
|
|
|
|
/* DRAWLINE options flags */
|
|
|
|
#define DRAWLIGHT 1
|
|
|
|
#define DRAWDASHED 2
|
|
|
|
#define DRAWBOLD 4
|
|
|
|
|
|
|
|
void applyTransObjects(TransInfo *t);
|
|
|
|
void restoreTransObjects(TransInfo *t);
|
2009-01-02 23:58:03 +00:00
|
|
|
void restoreTransNodes(TransInfo *t);
|
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
|
|
|
void recalcData(TransInfo *t);
|
|
|
|
|
|
|
|
void calculateCenter(TransInfo *t);
|
|
|
|
void calculateCenter2D(TransInfo *t);
|
|
|
|
void calculateCenterBound(TransInfo *t);
|
|
|
|
void calculateCenterMedian(TransInfo *t);
|
|
|
|
void calculateCenterCursor(TransInfo *t);
|
|
|
|
|
|
|
|
void calculateCenterCursor2D(TransInfo *t);
|
|
|
|
void calculatePropRatio(TransInfo *t);
|
|
|
|
|
|
|
|
void getViewVector(TransInfo *t, float coord[3], float vec[3]);
|
|
|
|
|
|
|
|
/*********************** NumInput ********************************/
|
|
|
|
|
|
|
|
void initNumInput(NumInput *n);
|
|
|
|
void outputNumInput(NumInput *n, char *str);
|
|
|
|
short hasNumInput(NumInput *n);
|
|
|
|
void applyNumInput(NumInput *n, float *vec);
|
|
|
|
char handleNumInput(NumInput *n, struct wmEvent *event);
|
|
|
|
|
|
|
|
/*********************** NDofInput ********************************/
|
|
|
|
|
|
|
|
void initNDofInput(NDofInput *n);
|
|
|
|
int hasNDofInput(NDofInput *n);
|
|
|
|
void applyNDofInput(NDofInput *n, float *vec);
|
|
|
|
int handleNDofInput(NDofInput *n, struct wmEvent *event);
|
|
|
|
|
|
|
|
/* handleNDofInput return values */
|
|
|
|
#define NDOF_REFRESH 1
|
|
|
|
#define NDOF_NOMOVE 2
|
|
|
|
#define NDOF_CONFIRM 3
|
|
|
|
#define NDOF_CANCEL 4
|
|
|
|
|
|
|
|
|
2009-01-18 21:36:38 +00:00
|
|
|
/*********************** Transform Orientations ******************************/
|
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-18 21:36:38 +00:00
|
|
|
void initTransformOrientation(struct bContext *C, TransInfo *t);
|
|
|
|
|
2009-09-28 19:49:36 +00:00
|
|
|
struct TransformOrientation *createObjectSpace(struct bContext *C, struct ReportList *reports, char *name, int overwrite);
|
|
|
|
struct TransformOrientation *createMeshSpace(struct bContext *C, struct ReportList *reports, char *name, int overwrite);
|
|
|
|
struct TransformOrientation *createBoneSpace(struct bContext *C, struct ReportList *reports, char *name, int overwrite);
|
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
|
|
|
|
|
|
|
/* Those two fill in mat and return non-zero on success */
|
|
|
|
int createSpaceNormal(float mat[3][3], float normal[3]);
|
|
|
|
int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3]);
|
|
|
|
|
2009-09-28 19:49:36 +00:00
|
|
|
struct TransformOrientation *addMatrixSpace(struct bContext *C, float mat[3][3], char name[], int overwrite);
|
2009-01-18 21:36:38 +00:00
|
|
|
int addObjectSpace(struct bContext *C, struct Object *ob);
|
2009-09-28 19:49:36 +00:00
|
|
|
void applyTransformOrientation(const struct bContext *C, float mat[3][3], char *name);
|
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
|
|
|
|
|
|
|
#define ORIENTATION_NONE 0
|
|
|
|
#define ORIENTATION_NORMAL 1
|
|
|
|
#define ORIENTATION_VERT 2
|
|
|
|
#define ORIENTATION_EDGE 3
|
|
|
|
#define ORIENTATION_FACE 4
|
|
|
|
|
2009-07-08 15:01:28 +00:00
|
|
|
int getTransformOrientation(const struct bContext *C, float normal[3], float plane[3], int activeOnly);
|
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
|
|
|
int createSpaceNormal(float mat[3][3], float normal[3]);
|
|
|
|
int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3]);
|
|
|
|
|
2009-09-22 08:41:03 +00:00
|
|
|
void freeSlideVerts(TransInfo *t);
|
|
|
|
|
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
|
|
|
#endif
|
|
|
|
|
|
|
|
|