2011-02-23 10:52:22 +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
|
|
|
* 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.
|
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
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup edtransform
|
2011-02-27 20:29:51 +00:00
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#pragma once
|
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-02-20 20:29:09 +00:00
|
|
|
#include "ED_numinput.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "ED_transform.h"
|
2013-02-28 11:29:27 +00:00
|
|
|
#include "ED_view3d.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
|
|
|
|
2017-10-16 17:15:03 -02:00
|
|
|
#include "RE_engine.h"
|
|
|
|
|
2009-12-01 18:26:18 +00:00
|
|
|
#include "DNA_listBase.h"
|
2020-06-07 18:36:01 -03:00
|
|
|
#include "DNA_object_enums.h"
|
2009-12-01 18:26:18 +00:00
|
|
|
|
2018-02-06 16:34:11 +11:00
|
|
|
#include "DEG_depsgraph.h"
|
|
|
|
|
2020-06-07 18:36:01 -03:00
|
|
|
#include "transform_data.h"
|
|
|
|
|
2021-02-03 19:25:16 -03:00
|
|
|
/* use node center for transform instead of upper-left corner.
|
|
|
|
* disabled since it makes absolute snapping not work so nicely
|
|
|
|
*/
|
|
|
|
// #define USE_NODE_CENTER
|
|
|
|
|
2020-11-06 10:29:01 +11:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Types/
|
|
|
|
* \{ */
|
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
|
|
|
|
2019-01-28 21:08:24 +11:00
|
|
|
struct ARegion;
|
2021-05-28 18:18:13 +10:00
|
|
|
struct BMPartialUpdate;
|
2018-01-18 15:58:02 +01:00
|
|
|
struct Depsgraph;
|
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 NumInput;
|
|
|
|
struct Object;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct RNG;
|
|
|
|
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
|
|
|
struct Scene;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct ScrArea;
|
|
|
|
struct SnapObjectContext;
|
|
|
|
struct TransDataContainer;
|
|
|
|
struct TransInfo;
|
|
|
|
struct TransSnap;
|
2017-11-22 10:52:39 -02:00
|
|
|
struct ViewLayer;
|
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;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct wmKeyConfig;
|
|
|
|
struct wmKeyMap;
|
2020-12-16 16:19:04 +11:00
|
|
|
struct wmOperator;
|
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
|
|
|
|
2021-02-03 19:25:16 -03:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Enums and Flags
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
/** #TransInfo.options */
|
|
|
|
typedef enum {
|
|
|
|
CTX_NONE = 0,
|
2021-02-05 11:56:43 -03:00
|
|
|
|
|
|
|
/* These are similar to TransInfo::data_type. */
|
|
|
|
CTX_CAMERA = (1 << 0),
|
|
|
|
CTX_CURSOR = (1 << 1),
|
|
|
|
CTX_EDGE_DATA = (1 << 2),
|
|
|
|
CTX_GPENCIL_STROKES = (1 << 3),
|
|
|
|
CTX_MASK = (1 << 4),
|
|
|
|
CTX_MOVIECLIP = (1 << 5),
|
|
|
|
CTX_OBJECT = (1 << 6),
|
|
|
|
CTX_PAINT_CURVE = (1 << 7),
|
|
|
|
CTX_POSE_BONE = (1 << 8),
|
|
|
|
CTX_TEXTURE_SPACE = (1 << 9),
|
|
|
|
|
|
|
|
CTX_NO_PET = (1 << 10),
|
2021-04-24 11:24:53 -03:00
|
|
|
CTX_AUTOCONFIRM = (1 << 11),
|
2021-02-03 19:25:16 -03:00
|
|
|
/** When transforming object's, adjust the object data so it stays in the same place. */
|
2021-04-24 11:24:53 -03:00
|
|
|
CTX_OBMODE_XFORM_OBDATA = (1 << 12),
|
2021-02-03 19:25:16 -03:00
|
|
|
/** Transform object parents without moving their children. */
|
2021-04-24 11:24:53 -03:00
|
|
|
CTX_OBMODE_XFORM_SKIP_CHILDREN = (1 << 13),
|
2021-02-03 19:25:16 -03:00
|
|
|
} eTContext;
|
|
|
|
|
|
|
|
/** #TransInfo.flag */
|
|
|
|
typedef enum {
|
|
|
|
/** \note We could remove 'T_EDIT' and use 'obedit_type', for now ensure they're in sync. */
|
2021-02-05 11:56:43 -03:00
|
|
|
T_EDIT = 1 << 0,
|
2021-02-03 19:25:16 -03:00
|
|
|
/** Transform points, having no rotation/scale. */
|
2021-02-05 11:56:43 -03:00
|
|
|
T_POINTS = 1 << 1,
|
2021-02-03 19:25:16 -03:00
|
|
|
/** restrictions flags */
|
2021-02-05 11:56:43 -03:00
|
|
|
T_NO_CONSTRAINT = 1 << 2,
|
|
|
|
T_NULL_ONE = 1 << 3,
|
2021-04-24 11:34:02 -03:00
|
|
|
T_ALL_RESTRICTIONS = T_NO_CONSTRAINT | T_NULL_ONE,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
2021-04-24 11:34:02 -03:00
|
|
|
T_PROP_EDIT = 1 << 4,
|
|
|
|
T_PROP_CONNECTED = 1 << 5,
|
|
|
|
T_PROP_PROJECTED = 1 << 6,
|
2021-02-03 19:25:16 -03:00
|
|
|
T_PROP_EDIT_ALL = T_PROP_EDIT | T_PROP_CONNECTED | T_PROP_PROJECTED,
|
|
|
|
|
2021-04-24 11:34:02 -03:00
|
|
|
T_V3D_ALIGN = 1 << 7,
|
2021-02-03 19:25:16 -03:00
|
|
|
/** For 2D views such as UV or f-curve. */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_2D_EDIT = 1 << 8,
|
|
|
|
T_CLIP_UV = 1 << 9,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** Auto-IK is on. */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_AUTOIK = 1 << 10,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** Don't use mirror even if the data-block option is set. */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_NO_MIRROR = 1 << 11,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** To indicate that the value set in the `value` parameter is the final
|
|
|
|
* value of the transformation, modified only by the constrain. */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_INPUT_IS_VALUES_FINAL = 1 << 12,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** To specify if we save back settings at the end. */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_MODAL = 1 << 13,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** No re-topology (projection). */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_NO_PROJECT = 1 << 14,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
2021-04-24 11:34:02 -03:00
|
|
|
T_RELEASE_CONFIRM = 1 << 15,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** Alternative transformation. used to add offset to tracking markers. */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_ALT_TRANSFORM = 1 << 16,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** #TransInfo.center has been set, don't change it. */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_OVERRIDE_CENTER = 1 << 17,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
2021-04-24 11:34:02 -03:00
|
|
|
T_MODAL_CURSOR_SET = 1 << 18,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
2021-04-24 11:34:02 -03:00
|
|
|
T_CLNOR_REBUILD = 1 << 19,
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** Merges unselected into selected after transforming (runs after transforming). */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_AUTOMERGE = 1 << 20,
|
2021-02-03 19:25:16 -03:00
|
|
|
/** Runs auto-merge & splits. */
|
2021-04-24 11:34:02 -03:00
|
|
|
T_AUTOSPLIT = 1 << 21,
|
2021-06-16 18:17:07 +01:00
|
|
|
|
|
|
|
/** No cursor wrapping on region bounds */
|
|
|
|
T_NO_CURSOR_WRAP = 1 << 23,
|
2021-02-03 19:25:16 -03:00
|
|
|
} eTFlag;
|
|
|
|
|
|
|
|
/** #TransInfo.modifiers */
|
|
|
|
typedef enum {
|
2021-05-24 11:35:33 -03:00
|
|
|
MOD_CONSTRAINT_SELECT_AXIS = 1 << 0,
|
2021-02-03 19:25:16 -03:00
|
|
|
MOD_PRECISION = 1 << 1,
|
|
|
|
MOD_SNAP = 1 << 2,
|
|
|
|
MOD_SNAP_INVERT = 1 << 3,
|
2021-05-24 11:35:33 -03:00
|
|
|
MOD_CONSTRAINT_SELECT_PLANE = 1 << 4,
|
2021-02-03 19:25:16 -03:00
|
|
|
} eTModifier;
|
|
|
|
|
|
|
|
/** #TransSnap.status */
|
|
|
|
typedef enum {
|
|
|
|
SNAP_FORCED = 1 << 0,
|
|
|
|
TARGET_INIT = 1 << 1,
|
2021-02-05 11:01:30 -03:00
|
|
|
/* Special flag for snap to grid. */
|
|
|
|
TARGET_GRID_INIT = 1 << 2,
|
|
|
|
POINT_INIT = 1 << 3,
|
|
|
|
MULTI_POINTS = 1 << 4,
|
2021-02-03 19:25:16 -03:00
|
|
|
} eTSnap;
|
|
|
|
|
|
|
|
/** #TransCon.mode, #TransInfo.con.mode */
|
|
|
|
typedef enum {
|
|
|
|
/** When set constraints are in use. */
|
|
|
|
CON_APPLY = 1 << 0,
|
|
|
|
/** These are only used for modal execution. */
|
|
|
|
CON_AXIS0 = 1 << 1,
|
|
|
|
CON_AXIS1 = 1 << 2,
|
|
|
|
CON_AXIS2 = 1 << 3,
|
|
|
|
CON_SELECT = 1 << 4,
|
|
|
|
/** Does not reorient vector to face viewport when on. */
|
|
|
|
CON_NOFLIP = 1 << 5,
|
|
|
|
CON_USER = 1 << 6,
|
|
|
|
} eTConstraint;
|
|
|
|
|
|
|
|
/** #TransInfo.state */
|
|
|
|
typedef enum {
|
|
|
|
TRANS_STARTING = 0,
|
|
|
|
TRANS_RUNNING = 1,
|
|
|
|
TRANS_CONFIRM = 2,
|
|
|
|
TRANS_CANCEL = 3,
|
|
|
|
} eTState;
|
|
|
|
|
2020-11-06 10:29:01 +11:00
|
|
|
/** #TransInfo.redraw */
|
2013-10-23 06:48:36 +00:00
|
|
|
typedef enum {
|
|
|
|
TREDRAW_NOTHING = 0,
|
|
|
|
TREDRAW_HARD = 1,
|
|
|
|
TREDRAW_SOFT = 2,
|
|
|
|
} eRedrawFlag;
|
|
|
|
|
2021-02-03 19:25:16 -03:00
|
|
|
/** #TransInfo.helpline */
|
|
|
|
typedef enum {
|
|
|
|
HLP_NONE = 0,
|
|
|
|
HLP_SPRING = 1,
|
|
|
|
HLP_ANGLE = 2,
|
|
|
|
HLP_HARROW = 3,
|
|
|
|
HLP_VARROW = 4,
|
|
|
|
HLP_CARROW = 5,
|
|
|
|
HLP_TRACKBALL = 6,
|
|
|
|
} eTHelpline;
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
TC_NONE = 0,
|
|
|
|
TC_ACTION_DATA,
|
|
|
|
TC_POSE,
|
|
|
|
TC_ARMATURE_VERTS,
|
|
|
|
TC_CURSOR_IMAGE,
|
|
|
|
TC_CURSOR_VIEW3D,
|
|
|
|
TC_CURVE_VERTS,
|
|
|
|
TC_GRAPH_EDIT_DATA,
|
|
|
|
TC_GPENCIL,
|
|
|
|
TC_LATTICE_VERTS,
|
|
|
|
TC_MASKING_DATA,
|
|
|
|
TC_MBALL_VERTS,
|
|
|
|
TC_MESH_VERTS,
|
|
|
|
TC_MESH_EDGES,
|
|
|
|
TC_MESH_SKIN,
|
|
|
|
TC_MESH_UV,
|
|
|
|
TC_NLA_DATA,
|
|
|
|
TC_NODE_DATA,
|
|
|
|
TC_OBJECT,
|
|
|
|
TC_OBJECT_TEXSPACE,
|
|
|
|
TC_PAINT_CURVE_VERTS,
|
|
|
|
TC_PARTICLE_VERTS,
|
|
|
|
TC_SCULPT,
|
|
|
|
TC_SEQ_DATA,
|
|
|
|
TC_TRACKING_DATA,
|
|
|
|
} eTConvertType;
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Keymap Modal Items
|
|
|
|
*
|
|
|
|
* \note these values are saved in key-map files, do not change then but just add new ones.
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
enum {
|
|
|
|
TFM_MODAL_CANCEL = 1,
|
|
|
|
TFM_MODAL_CONFIRM = 2,
|
|
|
|
TFM_MODAL_TRANSLATE = 3,
|
|
|
|
TFM_MODAL_ROTATE = 4,
|
|
|
|
TFM_MODAL_RESIZE = 5,
|
|
|
|
TFM_MODAL_SNAP_INV_ON = 6,
|
|
|
|
TFM_MODAL_SNAP_INV_OFF = 7,
|
|
|
|
TFM_MODAL_SNAP_TOGGLE = 8,
|
|
|
|
TFM_MODAL_AXIS_X = 9,
|
|
|
|
TFM_MODAL_AXIS_Y = 10,
|
|
|
|
TFM_MODAL_AXIS_Z = 11,
|
|
|
|
TFM_MODAL_PLANE_X = 12,
|
|
|
|
TFM_MODAL_PLANE_Y = 13,
|
|
|
|
TFM_MODAL_PLANE_Z = 14,
|
|
|
|
TFM_MODAL_CONS_OFF = 15,
|
|
|
|
TFM_MODAL_ADD_SNAP = 16,
|
|
|
|
TFM_MODAL_REMOVE_SNAP = 17,
|
|
|
|
|
|
|
|
/* 18 and 19 used by number-input, defined in `ED_numinput.h`. */
|
|
|
|
// NUM_MODAL_INCREMENT_UP = 18,
|
|
|
|
// NUM_MODAL_INCREMENT_DOWN = 19,
|
|
|
|
|
|
|
|
TFM_MODAL_PROPSIZE_UP = 20,
|
|
|
|
TFM_MODAL_PROPSIZE_DOWN = 21,
|
|
|
|
TFM_MODAL_AUTOIK_LEN_INC = 22,
|
|
|
|
TFM_MODAL_AUTOIK_LEN_DEC = 23,
|
|
|
|
|
|
|
|
TFM_MODAL_EDGESLIDE_UP = 24,
|
|
|
|
TFM_MODAL_EDGESLIDE_DOWN = 25,
|
|
|
|
|
|
|
|
/** For analog input, like track-pad. */
|
|
|
|
TFM_MODAL_PROPSIZE = 26,
|
|
|
|
/** Node editor insert offset (also called auto-offset) direction toggle. */
|
|
|
|
TFM_MODAL_INSERTOFS_TOGGLE_DIR = 27,
|
|
|
|
|
|
|
|
TFM_MODAL_AUTOCONSTRAINT = 28,
|
|
|
|
TFM_MODAL_AUTOCONSTRAINTPLANE = 29,
|
2021-02-09 12:28:51 -03:00
|
|
|
|
|
|
|
TFM_MODAL_PRECISION = 30,
|
2021-02-03 19:25:16 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
2009-12-01 18:26:18 +00:00
|
|
|
typedef struct TransSnapPoint {
|
2012-04-29 15:47:02 +00:00
|
|
|
struct TransSnapPoint *next, *prev;
|
2009-12-01 18:26:18 +00:00
|
|
|
float co[3];
|
|
|
|
} TransSnapPoint;
|
|
|
|
|
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 TransSnap {
|
2009-03-29 19:52:53 +00:00
|
|
|
short mode;
|
2009-12-03 19:18:00 +00:00
|
|
|
short target;
|
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 modePoint;
|
2009-11-26 19:47:55 +00:00
|
|
|
short modeSelect;
|
2013-04-04 09:20:46 +00:00
|
|
|
bool align;
|
2014-04-17 02:53:11 +10:00
|
|
|
bool project;
|
|
|
|
bool snap_self;
|
|
|
|
bool peel;
|
2020-07-22 12:00:02 -03:00
|
|
|
bool use_backface_culling;
|
2021-02-03 19:25:16 -03:00
|
|
|
eTSnap status;
|
2019-08-23 15:20:25 -03:00
|
|
|
/* Snapped Element Type (currently for objects only). */
|
|
|
|
char snapElem;
|
2019-01-08 10:28:20 +11:00
|
|
|
/** snapping from this point (in global-space). */
|
|
|
|
float snapPoint[3];
|
|
|
|
/** to this point (in global-space). */
|
|
|
|
float snapTarget[3];
|
2021-02-05 11:01:30 -03:00
|
|
|
float snapTargetGrid[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
|
|
|
float snapNormal[3];
|
2012-06-29 14:34:46 +00:00
|
|
|
char snapNodeBorder;
|
2009-12-01 18:26:18 +00:00
|
|
|
ListBase points;
|
2011-12-26 20:23:07 +00:00
|
|
|
TransSnapPoint *selectedPoint;
|
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
|
|
|
double last;
|
|
|
|
void (*applySnap)(struct TransInfo *, float *);
|
|
|
|
void (*calcSnap)(struct TransInfo *, float *);
|
|
|
|
void (*targetSnap)(struct TransInfo *);
|
2016-01-18 13:15:38 +11:00
|
|
|
/**
|
|
|
|
* Get the transform distance between two points (used by Closest snap)
|
|
|
|
*
|
|
|
|
* \note Return value can be anything,
|
2019-07-31 14:25:09 +02:00
|
|
|
* where the smallest absolute value defines what's closest.
|
2016-01-18 13:15:38 +11:00
|
|
|
*/
|
2018-04-16 16:27:55 +02:00
|
|
|
float (*distance)(struct TransInfo *t, const float p1[3], const float p2[3]);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2016-04-21 11:29:32 +10:00
|
|
|
/**
|
|
|
|
* Re-usable snap context data.
|
|
|
|
*/
|
2016-05-06 04:49:21 +10:00
|
|
|
struct SnapObjectContext *object_context;
|
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;
|
|
|
|
|
|
|
|
typedef struct TransCon {
|
2019-03-01 10:45:22 +11:00
|
|
|
/** Description of the constraint for header_print. */
|
2019-01-08 10:28:20 +11:00
|
|
|
char text[50];
|
2019-03-01 10:45:22 +11:00
|
|
|
/** Projection constraint matrix (same as #imtx with some axis == 0). */
|
2019-01-08 10:28:20 +11:00
|
|
|
float pmtx[3][3];
|
|
|
|
/** Initial mouse value for visual calculation
|
2019-03-01 10:45:22 +11:00
|
|
|
* the one in #TransInfo is not guarantee to stay the same (Rotates change it). */
|
2019-01-08 10:28:20 +11:00
|
|
|
int imval[2];
|
2019-03-01 10:45:22 +11:00
|
|
|
/** Mode flags of the constraint. */
|
2021-02-03 19:25:16 -03:00
|
|
|
eTConstraint mode;
|
2013-01-15 13:08:51 +00:00
|
|
|
void (*drawExtra)(struct TransInfo *t);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-08 10:28:20 +11:00
|
|
|
/* Note: if 'tc' is NULL, 'td' must also be NULL.
|
|
|
|
* For constraints that needs to draw differently from the other
|
|
|
|
* uses this instead of the generic draw function. */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Apply function pointer for linear vectorial transformation
|
|
|
|
* The last three parameters are pointers to the in/out/printable vectors. */
|
2018-04-16 16:27:55 +02:00
|
|
|
void (*applyVec)(struct TransInfo *t,
|
|
|
|
struct TransDataContainer *tc,
|
|
|
|
struct TransData *td,
|
|
|
|
const float in[3],
|
2020-05-19 18:54:46 -03:00
|
|
|
float out[3]);
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Apply function pointer for size transformation. */
|
2018-04-16 16:27:55 +02:00
|
|
|
void (*applySize)(struct TransInfo *t,
|
|
|
|
struct TransDataContainer *tc,
|
|
|
|
struct TransData *td,
|
|
|
|
float smat[3][3]);
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Apply function pointer for rotation transformation */
|
2018-04-16 16:27:55 +02:00
|
|
|
void (*applyRot)(struct TransInfo *t,
|
|
|
|
struct TransDataContainer *tc,
|
|
|
|
struct TransData *td,
|
|
|
|
float vec[3],
|
|
|
|
float *angle);
|
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
|
|
|
} TransCon;
|
|
|
|
|
2008-12-29 20:37:54 +00:00
|
|
|
typedef struct MouseInput {
|
2015-10-30 17:31:07 +11:00
|
|
|
void (*apply)(struct TransInfo *t, struct MouseInput *mi, const double mval[2], float output[3]);
|
2013-01-14 08:02:06 +00:00
|
|
|
void (*post)(struct TransInfo *t, float values[3]);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Initial mouse position. */
|
|
|
|
int imval[2];
|
2014-04-17 02:53:11 +10:00
|
|
|
bool precision;
|
2015-10-30 17:31:07 +11:00
|
|
|
float precision_factor;
|
2013-10-12 03:42:06 +00:00
|
|
|
float center[2];
|
2008-12-29 20:37:54 +00:00
|
|
|
float factor;
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Additional data, if needed by the particular function. */
|
|
|
|
void *data;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-10-30 17:31:07 +11:00
|
|
|
/**
|
2015-11-07 17:31:28 +11:00
|
|
|
* Use virtual cursor, which takes precision into account
|
2015-10-30 17:31:07 +11:00
|
|
|
* keeping track of the cursors 'virtual' location,
|
|
|
|
* to avoid jumping values when its toggled.
|
|
|
|
*
|
|
|
|
* This works well for scaling drag motion,
|
2020-09-06 01:45:38 +10:00
|
|
|
* but not for rotating around a point (rotation needs its own custom accumulator)
|
2015-10-30 17:31:07 +11:00
|
|
|
*/
|
|
|
|
bool use_virtual_mval;
|
|
|
|
struct {
|
|
|
|
double prev[2];
|
|
|
|
double accum[2];
|
|
|
|
} virtual_mval;
|
2008-12-29 20:37:54 +00:00
|
|
|
} MouseInput;
|
|
|
|
|
2016-02-01 15:15:10 +11:00
|
|
|
typedef struct TransCustomData {
|
|
|
|
void *data;
|
2018-04-16 16:27:55 +02:00
|
|
|
void (*free_cb)(struct TransInfo *,
|
|
|
|
struct TransDataContainer *tc,
|
|
|
|
struct TransCustomData *custom_data);
|
2016-02-01 15:15:10 +11:00
|
|
|
unsigned int use_free : 1;
|
|
|
|
} TransCustomData;
|
|
|
|
|
2016-05-31 23:56:59 +10:00
|
|
|
typedef struct TransCenterData {
|
2018-04-16 16:27:55 +02:00
|
|
|
float global[3];
|
2016-05-31 23:56:59 +10:00
|
|
|
unsigned int is_set : 1;
|
|
|
|
} TransCenterData;
|
|
|
|
|
2018-04-16 16:27:55 +02:00
|
|
|
/**
|
|
|
|
* Rule of thumb for choosing between mode/type:
|
|
|
|
* - If transform mode uses the data, assign to `mode`
|
|
|
|
* (typically in transform.c).
|
|
|
|
* - If conversion uses the data as an extension to the #TransData, assign to `type`
|
|
|
|
* (typically in transform_conversion.c).
|
|
|
|
*/
|
|
|
|
typedef struct TransCustomDataContainer {
|
|
|
|
/** Owned by the mode (grab, scale, bend... ).*/
|
|
|
|
union {
|
|
|
|
TransCustomData mode, first_elem;
|
|
|
|
};
|
|
|
|
TransCustomData type;
|
|
|
|
} TransCustomDataContainer;
|
|
|
|
#define TRANS_CUSTOM_DATA_ELEM_MAX (sizeof(TransCustomDataContainer) / sizeof(TransCustomData))
|
|
|
|
|
2021-03-13 03:12:24 +11:00
|
|
|
/**
|
|
|
|
* Container for Transform Data
|
|
|
|
*
|
2021-05-21 22:19:46 +10:00
|
|
|
* Used to implement multi-object modes, so each object can have its
|
2021-03-13 03:12:24 +11:00
|
|
|
* own data array as well as object matrix, local center etc.
|
|
|
|
*
|
|
|
|
* Anything that can't be shared between all objects
|
|
|
|
* and doesn't make sense to store for every vertex (in the #TransDataContainer.data).
|
|
|
|
*
|
|
|
|
* \note at some point this could be used to store non object containers
|
2021-05-21 22:19:46 +10:00
|
|
|
* although this only makes sense if each container has its own matrices,
|
2021-03-13 03:12:24 +11:00
|
|
|
* otherwise all elements may as well be stored in one array (#TransDataContainer.data),
|
|
|
|
* as is already done for curve-objects, f-curves. etc.
|
|
|
|
*/
|
2018-04-16 16:27:55 +02:00
|
|
|
typedef struct TransDataContainer {
|
|
|
|
/** Transformed data (array). */
|
|
|
|
TransData *data;
|
|
|
|
/** Transformed data extension (array). */
|
|
|
|
TransDataExtension *data_ext;
|
|
|
|
/** Transformed data for 2d (array). */
|
|
|
|
TransData2D *data_2d;
|
2020-06-08 08:23:04 -03:00
|
|
|
/** Transformed data for mirror elements (array). */
|
|
|
|
TransDataMirror *data_mirror;
|
|
|
|
|
|
|
|
/** Total number of transformed data, data_ext, data_2d. */
|
|
|
|
int data_len;
|
|
|
|
/** Total number of transformed data_mirror. */
|
|
|
|
int data_mirror_len;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-16 16:27:55 +02:00
|
|
|
struct Object *obedit;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-04 14:41:51 +02:00
|
|
|
float mat[4][4];
|
|
|
|
float imat[4][4];
|
|
|
|
/** 3x3 copies of matrices above. */
|
|
|
|
float mat3[3][3];
|
|
|
|
float imat3[3][3];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-05-04 14:41:51 +02:00
|
|
|
/** Normalized 'mat3' */
|
|
|
|
float mat3_unit[3][3];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-16 16:27:55 +02:00
|
|
|
/** if 't->flag & T_POSE', this denotes pose object */
|
|
|
|
struct Object *poseobj;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-16 16:27:55 +02:00
|
|
|
/** Center of transformation (in local-space), Calculated from #TransInfo.center_global. */
|
|
|
|
float center_local[3];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-14 14:59:18 +11:00
|
|
|
/**
|
2020-06-08 08:23:04 -03:00
|
|
|
* Use for cases we care about the active, eg: active vert of active mesh.
|
|
|
|
* if set this will _always_ be the first item in the array.
|
2019-01-14 14:59:18 +11:00
|
|
|
*/
|
2020-06-08 08:23:04 -03:00
|
|
|
bool is_active;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Store matrix, this avoids having to have duplicate check all over
|
|
|
|
* Typically: 'obedit->obmat' or 'poseobj->obmat', but may be used elsewhere too.
|
|
|
|
*/
|
|
|
|
bool use_local_mat;
|
|
|
|
|
2021-03-21 13:18:20 +11:00
|
|
|
/** Mirror option. */
|
2020-06-08 08:23:04 -03:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
uint use_mirror_axis_x : 1;
|
|
|
|
uint use_mirror_axis_y : 1;
|
|
|
|
uint use_mirror_axis_z : 1;
|
2019-09-11 13:48:42 -03:00
|
|
|
};
|
2020-06-08 08:23:04 -03:00
|
|
|
/* For easy checking. */
|
|
|
|
char use_mirror_axis_any;
|
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-16 16:27:55 +02:00
|
|
|
TransCustomDataContainer custom;
|
|
|
|
} TransDataContainer;
|
|
|
|
|
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 {
|
2018-04-16 16:27:55 +02:00
|
|
|
TransDataContainer *data_container;
|
|
|
|
int data_container_len;
|
2020-06-07 18:48:33 -03:00
|
|
|
|
2018-04-16 16:27:55 +02:00
|
|
|
/** Combine length of all #TransDataContainer.data_len
|
|
|
|
* Use to check if nothing is selected or if we have a single selection. */
|
|
|
|
int data_len_all;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-02-03 19:25:16 -03:00
|
|
|
/** TODO: It should be a member of #TransDataContainer. */
|
|
|
|
eTConvertType data_type;
|
|
|
|
|
|
|
|
/** Current context/options for transform. */
|
|
|
|
eTContext options;
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Generic flags for special behaviors. */
|
2021-02-03 19:25:16 -03:00
|
|
|
eTFlag flag;
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Special modifiers, by function, not key. */
|
2021-02-03 19:25:16 -03:00
|
|
|
eTModifier modifiers;
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Current state (running, canceled. */
|
2021-02-03 19:25:16 -03:00
|
|
|
eTState state;
|
|
|
|
/** Redraw flag. */
|
|
|
|
eRedrawFlag redraw;
|
|
|
|
/** Choice of custom cursor with or without a help line from the gizmo to the mouse position. */
|
|
|
|
eTHelpline helpline;
|
|
|
|
/** Current mode. */
|
|
|
|
eTfmMode mode;
|
|
|
|
|
|
|
|
/** Main transform mode function. */
|
2013-10-23 03:57:42 +00:00
|
|
|
void (*transform)(struct TransInfo *, const int[2]);
|
2021-02-03 19:25:16 -03:00
|
|
|
/* Event handler function that determines whether the viewport needs to be redrawn. */
|
2013-10-23 06:48:36 +00:00
|
|
|
eRedrawFlag (*handleEvent)(struct TransInfo *, const struct wmEvent *);
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** Constraint Data. */
|
2019-01-08 10:28:20 +11:00
|
|
|
TransCon con;
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** Snap Data. */
|
2010-03-22 09:30:00 +00:00
|
|
|
TransSnap tsnap;
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** Numerical input. */
|
2019-01-08 10:28:20 +11:00
|
|
|
NumInput num;
|
2021-02-03 19:25:16 -03:00
|
|
|
|
|
|
|
/** Mouse input. */
|
2019-01-08 10:28:20 +11:00
|
|
|
MouseInput mouse;
|
2021-02-03 19:25:16 -03:00
|
|
|
|
2019-01-08 10:28:20 +11:00
|
|
|
/** proportional circle radius. */
|
|
|
|
float prop_size;
|
|
|
|
/** proportional falloff text. */
|
|
|
|
char proptext[20];
|
|
|
|
/**
|
|
|
|
* Spaces using non 1:1 aspect, (uv's, f-curve, movie-clip... etc)
|
|
|
|
* use for conversion and snapping.
|
|
|
|
*/
|
|
|
|
float aspect[3];
|
|
|
|
/** center of transformation (in global-space) */
|
|
|
|
float center_global[3];
|
|
|
|
/** center in screen coordinates. */
|
|
|
|
float center2d[2];
|
|
|
|
/** maximum index on the input vector. */
|
|
|
|
short idx_max;
|
|
|
|
/** Snapping Gears. */
|
2020-10-08 09:45:45 -03:00
|
|
|
float snap[2];
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Spatial snapping gears(even when rotating, scaling... etc). */
|
2020-10-08 09:45:45 -03:00
|
|
|
float snap_spatial[2];
|
2020-09-06 01:45:38 +10:00
|
|
|
/** Mouse side of the current frame, 'L', 'R' or 'B' */
|
2019-01-08 10:28:20 +11:00
|
|
|
char frame_side;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-08 10:28:20 +11:00
|
|
|
/** copy from G.vd, prevents feedback. */
|
|
|
|
float viewmat[4][4];
|
|
|
|
/** and to make sure we don't have to. */
|
|
|
|
float viewinv[4][4];
|
|
|
|
/** access G.vd from other space types. */
|
|
|
|
float persmat[4][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
|
|
|
float persinv[4][4];
|
|
|
|
short persp;
|
|
|
|
short around;
|
2020-11-06 10:29:01 +11:00
|
|
|
/** space-type where transforming is. */
|
2019-01-08 10:28:20 +11:00
|
|
|
char spacetype;
|
2020-11-06 10:29:01 +11:00
|
|
|
/** Avoid looking inside #TransDataContainer.obedit. */
|
2019-01-08 10:28:20 +11:00
|
|
|
short obedit_type;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-08 10:28:20 +11:00
|
|
|
/** translation, to show for widget. */
|
|
|
|
float vec[3];
|
2020-11-06 10:29:01 +11:00
|
|
|
/** Rotate/re-scale, to show for widget. */
|
2019-01-08 10:28:20 +11:00
|
|
|
float mat[3][3];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-08 10:28:20 +11:00
|
|
|
/** orientation matrix of the current space. */
|
|
|
|
float spacemtx[3][3];
|
2020-05-20 16:22:10 -03:00
|
|
|
float spacemtx_inv[3][3];
|
2019-01-08 10:28:20 +11:00
|
|
|
/** name of the current space, MAX_NAME. */
|
|
|
|
char spacename[64];
|
2019-04-17 06:17:24 +02: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
|
|
|
/*************** NEW STUFF *********************/
|
2019-01-08 10:28:20 +11:00
|
|
|
/** event type used to launch transform. */
|
2020-12-04 10:35:26 -03:00
|
|
|
short launch_event;
|
2019-11-22 16:46:15 +01:00
|
|
|
/** Is the actual launch event a tweak event? (launch_event above is set to the corresponding
|
|
|
|
* mouse button then.) */
|
|
|
|
bool is_launch_event_tweak;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-05-11 23:40:06 -03:00
|
|
|
bool is_orient_set;
|
|
|
|
|
2018-11-28 10:01:16 +11:00
|
|
|
struct {
|
2020-05-22 12:34:29 -03:00
|
|
|
short type;
|
|
|
|
float matrix[3][3];
|
|
|
|
} orient[3];
|
2021-05-11 22:40:56 -03:00
|
|
|
|
|
|
|
enum {
|
|
|
|
O_DEFAULT = 0,
|
|
|
|
O_SCENE,
|
|
|
|
O_SET,
|
|
|
|
} orient_curr;
|
2020-05-22 12:34:29 -03:00
|
|
|
|
2019-01-08 10:28:20 +11:00
|
|
|
/** backup from view3d, to restore on end. */
|
|
|
|
short gizmo_flag;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2009-03-06 15:50:15 +00:00
|
|
|
short prop_mode;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-08-02 01:15:33 -03:00
|
|
|
/** Value taken as input, either through mouse coordinates or entered as a parameter. */
|
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];
|
2019-08-02 01:15:33 -03:00
|
|
|
|
2020-11-06 10:29:01 +11:00
|
|
|
/** Offset applied on top of modal input. */
|
2019-01-08 10:28:20 +11:00
|
|
|
float values_modal_offset[4];
|
2019-08-02 01:15:33 -03:00
|
|
|
|
|
|
|
/** Final value of the transformation (displayed in the redo panel).
|
|
|
|
* If the operator is executed directly (not modal), this value is usually the
|
|
|
|
* value of the input parameter, except when a constrain is entered. */
|
|
|
|
float values_final[4];
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-03-01 10:12:26 +11:00
|
|
|
/* Axis members for modes that use an axis separate from the orientation (rotate & shear). */
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-03-01 10:12:26 +11:00
|
|
|
/** Primary axis, rotate only uses this. */
|
2019-02-26 20:22:54 +11:00
|
|
|
int orient_axis;
|
2019-03-01 10:12:26 +11:00
|
|
|
/** Secondary axis, shear uses this. */
|
2019-02-26 20:22:54 +11:00
|
|
|
int orient_axis_ortho;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2019-01-08 10:28:20 +11:00
|
|
|
/** remove elements if operator is canceled. */
|
|
|
|
bool remove_on_cancel;
|
2019-04-17 06:17:24 +02: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 *view;
|
2019-01-08 10:28:20 +11:00
|
|
|
/** Only valid (non null) during an operator called function. */
|
|
|
|
struct bContext *context;
|
2020-06-02 18:00:52 +10:00
|
|
|
struct wmMsgBus *mbus;
|
2020-04-03 13:25:03 +02:00
|
|
|
struct ScrArea *area;
|
2020-03-06 16:56:42 +01:00
|
|
|
struct ARegion *region;
|
2018-01-18 15:58:02 +01:00
|
|
|
struct Depsgraph *depsgraph;
|
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 Scene *scene;
|
2017-11-22 10:52:39 -02:00
|
|
|
struct ViewLayer *view_layer;
|
2009-06-23 00:41:55 +00:00
|
|
|
struct ToolSettings *settings;
|
2009-02-16 03:01:56 +00:00
|
|
|
struct wmTimer *animtimer;
|
2020-11-06 10:29:01 +11:00
|
|
|
/** Needed so we can perform a look up for header text. */
|
2019-01-08 10:28:20 +11:00
|
|
|
struct wmKeyMap *keymap;
|
|
|
|
/** assign from the operator, or can be NULL. */
|
|
|
|
struct ReportList *reports;
|
|
|
|
/** current mouse position. */
|
|
|
|
int mval[2];
|
|
|
|
/** use for 3d view. */
|
|
|
|
float zfac;
|
2010-03-22 09:30:00 +00:00
|
|
|
void *draw_handle_apply;
|
|
|
|
void *draw_handle_view;
|
|
|
|
void *draw_handle_pixel;
|
|
|
|
void *draw_handle_cursor;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-06-12 17:00:07 +02:00
|
|
|
/** Currently only used for random curve of proportional editing. */
|
|
|
|
struct RNG *rng;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-16 16:27:55 +02:00
|
|
|
/** Typically for mode settings. */
|
|
|
|
TransCustomDataContainer custom;
|
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;
|
|
|
|
|
2020-11-06 10:29:01 +11: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
|
|
|
|
2020-11-06 10:29:01 +11:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Public Transform API
|
|
|
|
* \{ */
|
|
|
|
|
2014-04-17 13:46:34 +10:00
|
|
|
bool initTransform(struct bContext *C,
|
|
|
|
struct TransInfo *t,
|
|
|
|
struct wmOperator *op,
|
|
|
|
const struct wmEvent *event,
|
|
|
|
int mode);
|
2009-01-03 22:15:59 +00:00
|
|
|
void saveTransform(struct bContext *C, struct TransInfo *t, struct wmOperator *op);
|
2013-03-13 09:03:46 +00:00
|
|
|
int transformEvent(TransInfo *t, const struct wmEvent *event);
|
2010-11-20 21:43:16 +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);
|
2015-06-26 15:45:09 +10:00
|
|
|
void setTransformViewAspect(TransInfo *t, float r_aspect[3]);
|
2015-10-30 17:31:07 +11:00
|
|
|
void convertViewVec(TransInfo *t, float r_vec[3], double dx, double dy);
|
2013-02-28 11:29:27 +00:00
|
|
|
void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DProjTest flag);
|
2012-03-12 06:53:47 +00:00
|
|
|
void projectIntView(TransInfo *t, const float vec[3], int adr[2]);
|
2013-02-28 11:29:27 +00:00
|
|
|
void projectFloatViewEx(TransInfo *t, const float vec[3], float adr[2], const eV3DProjTest flag);
|
2012-03-12 06:53:47 +00:00
|
|
|
void projectFloatView(TransInfo *t, const float vec[3], float adr[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
|
|
|
|
2014-03-30 11:08:33 +11:00
|
|
|
void applyAspectRatio(TransInfo *t, float vec[2]);
|
|
|
|
void removeAspectRatio(TransInfo *t, float vec[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
|
|
|
|
2009-12-21 17:23:44 +00:00
|
|
|
struct wmKeyMap *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
|
|
|
|
2020-11-06 10:29:01 +11:00
|
|
|
/** \} */
|
2017-04-07 00:35:57 +10:00
|
|
|
|
2020-11-06 10:29:01 +11:00
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Gizmo
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
/* transform_gizmo.c */
|
2018-07-14 23:49:00 +02:00
|
|
|
#define GIZMO_AXIS_LINE_WIDTH 2.0f
|
2017-04-07 00:35:57 +10:00
|
|
|
|
2018-04-05 18:20:27 +02:00
|
|
|
bool gimbal_axis(struct Object *ob, float gmat[3][3]);
|
2018-10-03 16:25:10 -03:00
|
|
|
void drawDial3d(const 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
|
|
|
|
2020-11-06 10:29:01 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name TransData Creation and General Handling
|
|
|
|
* \{ */
|
|
|
|
|
2014-11-27 21:37:42 +01:00
|
|
|
bool transdata_check_local_islands(TransInfo *t, short around);
|
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
|
|
|
|
2020-11-06 10:29:01 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Mouse Input
|
|
|
|
* \{ */
|
2008-12-29 20:37:54 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
INPUT_NONE,
|
|
|
|
INPUT_VECTOR,
|
|
|
|
INPUT_SPRING,
|
|
|
|
INPUT_SPRING_FLIP,
|
2014-06-03 22:02:02 +06:00
|
|
|
INPUT_SPRING_DELTA,
|
2008-12-29 20:37:54 +00:00
|
|
|
INPUT_ANGLE,
|
2013-10-13 01:09:23 +00:00
|
|
|
INPUT_ANGLE_SPRING,
|
2008-12-29 20:37:54 +00:00
|
|
|
INPUT_TRACKBALL,
|
|
|
|
INPUT_HORIZONTAL_RATIO,
|
|
|
|
INPUT_HORIZONTAL_ABSOLUTE,
|
|
|
|
INPUT_VERTICAL_RATIO,
|
2009-09-21 00:48:36 +00:00
|
|
|
INPUT_VERTICAL_ABSOLUTE,
|
2013-01-31 22:18:37 +00:00
|
|
|
INPUT_CUSTOM_RATIO,
|
2014-06-03 22:02:02 +06:00
|
|
|
INPUT_CUSTOM_RATIO_FLIP,
|
2008-12-29 20:37:54 +00:00
|
|
|
} MouseInputMode;
|
|
|
|
|
2016-12-15 11:12:43 +01:00
|
|
|
void initMouseInput(
|
|
|
|
TransInfo *t, MouseInput *mi, const float center[2], const int mval[2], const bool precision);
|
2008-12-29 20:37:54 +00:00
|
|
|
void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode);
|
2011-05-20 07:40:05 +00:00
|
|
|
void applyMouseInput(struct TransInfo *t,
|
|
|
|
struct MouseInput *mi,
|
|
|
|
const int mval[2],
|
|
|
|
float output[3]);
|
2008-12-29 20:37:54 +00:00
|
|
|
|
2013-01-15 03:35:31 +00:00
|
|
|
void setCustomPoints(TransInfo *t, MouseInput *mi, const int start[2], const int end[2]);
|
2018-10-17 16:30:15 +11:00
|
|
|
void setCustomPointsFromDirection(TransInfo *t, MouseInput *mi, const float dir[2]);
|
2013-01-14 08:02:06 +00:00
|
|
|
void setInputPostFct(MouseInput *mi, void (*post)(struct TransInfo *t, float values[3]));
|
2009-09-21 00:48:36 +00:00
|
|
|
|
2020-11-06 10:29:01 +11:00
|
|
|
/** \} */
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/** \name Generics
|
|
|
|
* \{ */
|
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
|
|
|
|
2013-11-25 07:49:49 +11:00
|
|
|
void initTransInfo(struct bContext *C,
|
|
|
|
TransInfo *t,
|
|
|
|
struct wmOperator *op,
|
|
|
|
const struct wmEvent *event);
|
2018-04-26 10:08:41 +02:00
|
|
|
void freeTransCustomDataForMode(TransInfo *t);
|
2013-04-18 01:52:38 +00:00
|
|
|
void postTrans(struct bContext *C, TransInfo *t);
|
2013-04-24 15:15:01 +00:00
|
|
|
void resetTransModal(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 resetTransRestrictions(TransInfo *t);
|
|
|
|
|
2012-08-05 20:40:26 +00:00
|
|
|
void drawLine(TransInfo *t, const float center[3], const float dir[3], 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
|
|
|
|
|
|
|
/* DRAWLINE options flags */
|
|
|
|
#define DRAWLIGHT 1
|
|
|
|
|
|
|
|
void applyTransObjects(TransInfo *t);
|
|
|
|
void restoreTransObjects(TransInfo *t);
|
|
|
|
void recalcData(TransInfo *t);
|
|
|
|
|
|
|
|
void calculateCenter2D(TransInfo *t);
|
2018-04-16 16:27:55 +02:00
|
|
|
void calculateCenterLocal(TransInfo *t, const float center_global[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
|
|
|
|
2014-05-09 16:52:09 +10:00
|
|
|
void calculateCenter(TransInfo *t);
|
|
|
|
|
|
|
|
/* API functions for getting center points */
|
|
|
|
void calculateCenterBound(TransInfo *t, float r_center[3]);
|
|
|
|
void calculateCenterMedian(TransInfo *t, float r_center[3]);
|
|
|
|
void calculateCenterCursor(TransInfo *t, float r_center[3]);
|
|
|
|
void calculateCenterCursor2D(TransInfo *t, float r_center[2]);
|
|
|
|
void calculateCenterCursorGraph2D(TransInfo *t, float r_center[2]);
|
|
|
|
bool calculateCenterActive(TransInfo *t, bool select_only, float r_center[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
|
|
|
void calculatePropRatio(TransInfo *t);
|
|
|
|
|
2015-07-14 04:27:32 +10:00
|
|
|
void transform_data_ext_rotate(TransData *td, float mat[3][3], bool use_drot);
|
|
|
|
|
2021-02-10 15:19:51 -03:00
|
|
|
struct Object *transform_object_deform_pose_armature_get(const TransInfo *t, struct Object *ob);
|
2021-02-10 12:27:01 -03:00
|
|
|
|
2018-06-05 23:21:08 +05:30
|
|
|
void freeCustomNormalArray(TransInfo *t, TransDataContainer *tc, TransCustomData *custom_data);
|
2018-05-25 22:24:24 +05:30
|
|
|
|
2018-06-30 10:29:40 +02:00
|
|
|
/* TODO. transform_query.c */
|
2013-05-01 05:26:10 +00:00
|
|
|
bool checkUseAxisMatrix(TransInfo *t);
|
2013-02-18 16:35:13 +00:00
|
|
|
|
2016-04-21 11:29:32 +10:00
|
|
|
#define TRANSFORM_SNAP_MAX_PX 100.0f
|
|
|
|
#define TRANSFORM_DIST_INVALID -FLT_MAX
|
|
|
|
|
2018-04-16 16:27:55 +02:00
|
|
|
/* Temp macros. */
|
|
|
|
|
|
|
|
#define TRANS_DATA_CONTAINER_FIRST_OK(t) (&(t)->data_container[0])
|
|
|
|
/* For cases we _know_ there is only one handle. */
|
|
|
|
#define TRANS_DATA_CONTAINER_FIRST_SINGLE(t) \
|
|
|
|
(BLI_assert((t)->data_container_len == 1), (&(t)->data_container[0]))
|
|
|
|
|
|
|
|
#define FOREACH_TRANS_DATA_CONTAINER(t, th) \
|
2020-04-05 13:53:24 +10:00
|
|
|
for (TransDataContainer *tc = (t)->data_container, \
|
|
|
|
*tc_end = (t)->data_container + (t)->data_container_len; \
|
2018-04-16 16:27:55 +02:00
|
|
|
th != tc_end; \
|
|
|
|
th++)
|
|
|
|
|
|
|
|
#define FOREACH_TRANS_DATA_CONTAINER_INDEX(t, th, i) \
|
2020-04-05 13:53:24 +10:00
|
|
|
for (TransDataContainer *tc = ((i = 0), (t)->data_container), \
|
|
|
|
*tc_end = (t)->data_container + (t)->data_container_len; \
|
2018-04-16 16:27:55 +02:00
|
|
|
th != tc_end; \
|
|
|
|
th++, i++)
|
2020-11-06 10:29:01 +11:00
|
|
|
|
|
|
|
/** \} */
|