2005-02-20 01:25:10 +00:00
|
|
|
/**
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL/BL DUAL 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. The Blender
|
|
|
|
|
* Foundation also sells licenses for use in proprietary software under
|
|
|
|
|
* the Blender License. See http://www.blender.org/BL/ for information
|
|
|
|
|
* about this.
|
|
|
|
|
*
|
|
|
|
|
* 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/BL DUAL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef BIF_TRANSFORM_H
|
|
|
|
|
#define BIF_TRANSFORM_H
|
|
|
|
|
|
|
|
|
|
/* ******************** Macros & Prototypes *********************** */
|
|
|
|
|
|
|
|
|
|
/* MODE AND NUMINPUT FLAGS */
|
2005-05-08 12:00:28 +00:00
|
|
|
#define TFM_INIT -1
|
2007-03-18 18:21:24 +00:00
|
|
|
#define TFM_DUMMY 0
|
2005-02-20 01:25:10 +00:00
|
|
|
#define TFM_TRANSLATION 1
|
|
|
|
|
#define TFM_ROTATION 2
|
|
|
|
|
#define TFM_RESIZE 3
|
|
|
|
|
#define TFM_TOSPHERE 4
|
|
|
|
|
#define TFM_SHEAR 5
|
2005-03-08 17:29:33 +00:00
|
|
|
#define TFM_WARP 7
|
2005-03-13 20:17:39 +00:00
|
|
|
#define TFM_SHRINKFATTEN 8
|
2005-03-16 21:55:57 +00:00
|
|
|
#define TFM_TILT 9
|
2005-03-13 20:17:39 +00:00
|
|
|
#define TFM_LAMP_ENERGY 10
|
2005-03-19 12:17:06 +00:00
|
|
|
#define TFM_TRACKBALL 11
|
2005-03-31 22:18:08 +00:00
|
|
|
#define TFM_PUSHPULL 12
|
2005-04-04 23:37:15 +00:00
|
|
|
#define TFM_CREASE 13
|
2005-05-04 00:37:11 +00:00
|
|
|
#define TFM_MIRROR 14
|
2005-07-16 19:07:02 +00:00
|
|
|
#define TFM_BONESIZE 15
|
Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;
http://www.blender3d.org/cms/Armature_Envelopes.647.0.html
Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).
Also part of this commit is:
- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
keep the PoseMode hidden Bones separate from EditMode.
(In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
data. Sounds logical, but remember that VertexGroups are partial on a
Mesh, partial on Object. Weird design decision though...
Anyhoo, at this moment the only way to have Bone Envelopes deform, is
by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
set.
2005-08-19 12:35:15 +00:00
|
|
|
#define TFM_BONE_ENVELOPE 16
|
2006-08-13 07:37:51 +00:00
|
|
|
#define TFM_CURVE_SHRINKFATTEN 17
|
2006-12-03 19:54:27 +00:00
|
|
|
#define TFM_BONE_ROLL 18
|
2005-02-20 01:25:10 +00:00
|
|
|
|
2005-03-27 21:25:15 +00:00
|
|
|
/* TRANSFORM CONTEXTS */
|
2005-04-04 02:16:56 +00:00
|
|
|
#define CTX_NONE 0
|
|
|
|
|
#define CTX_TEXTURE 1
|
|
|
|
|
#define CTX_EDGE 2
|
|
|
|
|
#define CTX_NO_PET 4
|
2005-08-16 18:23:28 +00:00
|
|
|
#define CTX_TWEAK 8
|
2005-02-25 17:40:03 +00:00
|
|
|
|
2005-05-10 04:21:11 +00:00
|
|
|
void initTransform(int mode, int context);
|
|
|
|
|
void Transform(void);
|
2005-05-04 12:53:35 +00:00
|
|
|
void Mirror(short mode);
|
2005-02-20 01:25:10 +00:00
|
|
|
|
2007-03-24 13:38:50 +00:00
|
|
|
/* Standalone call to get the transformation center corresponding to the current situation
|
|
|
|
|
* returns 1 if successful, 0 otherwise (usually means there's no selection)
|
|
|
|
|
* (if 0 is returns, *vec is unmodified)
|
|
|
|
|
* */
|
|
|
|
|
int calculateTransformCenter(int centerMode, float *vec);
|
2007-03-18 18:21:24 +00:00
|
|
|
|
2005-02-20 19:00:00 +00:00
|
|
|
struct TransInfo;
|
So! Finally a show-off of the *power* of Martin P's work! :)
- Made framework for 3d Transform Manipulators (widgets)
- The Manipulators act like '2d buttons', by default with LeftMouse and with
while-hold-move-release
- Implemented now: Translation Widget, which allows:
- four hotspots for axis grab or view-aligned grab
- center defined by 'around' setting
- SHIFT+LMB gives planar constraint on other 2 axes
- works in Object mode and Edit mode (not posemode yet)
Enable it with (temporal) icon in 3D header. All other 'normal' transforms
then keeps working btw.
On the todo for this widget:
- choice for Global, Local or Normal orientation
The way the widgets are going to work is in review still. Commit is also for
Matt for his proposal/paper on topic.
Some notes regarding this project;
- no life updates (on mouse over) like 3DS, I think that's neurotic
- on click, dominant axis changes to theme defined "Transform" color, other axes disappear, like maya
- manipulater size is fixed preset, independent zoom.
- manipulator follows selection, and is located based on 'around' mode
Unresolved;
- in maya, when you select 2 or more objects, the manipulator draws on the 'active' object, also interesting
- what to do with G,R,S hotkeys? It could switch the manipulator "mode"...
- header button/menu for manipulator mode?
2005-03-17 21:31:49 +00:00
|
|
|
struct ScrArea;
|
2005-02-20 19:00:00 +00:00
|
|
|
|
2005-03-09 19:45:59 +00:00
|
|
|
struct TransInfo * BIF_GetTransInfo(void);
|
2005-03-21 17:52:45 +00:00
|
|
|
void BIF_setSingleAxisConstraint(float vec[3], char *text);
|
2005-04-03 20:13:10 +00:00
|
|
|
void BIF_setDualAxisConstraint(float vec1[3], float vec2[3], char *text);
|
2005-05-02 02:18:13 +00:00
|
|
|
void BIF_setLocalAxisConstraint(char axis, char *text);
|
|
|
|
|
void BIF_setLocalLockConstraint(char axis, char *text);
|
2007-08-09 01:07:27 +00:00
|
|
|
|
|
|
|
|
/* Drawing callbacks */
|
2005-03-09 19:45:59 +00:00
|
|
|
void BIF_drawConstraint(void);
|
|
|
|
|
void BIF_drawPropCircle(void);
|
2006-12-19 22:25:07 +00:00
|
|
|
void BIF_drawSnap(void);
|
2007-08-09 01:07:27 +00:00
|
|
|
|
2005-08-23 18:13:30 +00:00
|
|
|
void BIF_getPropCenter(float *center);
|
2005-02-20 01:25:10 +00:00
|
|
|
|
2005-05-08 12:00:28 +00:00
|
|
|
void BIF_TransformSetUndo(char *str);
|
|
|
|
|
|
Big Transform Manipulator Merge
*NOTE*: Some UI decision done in this commit will most likely be revised, all flame shall go in /dev/null. Constructive discussions of course welcomed.
This commit merges manipulator orientation selection back in "traditional" transform.
That's how it works:
- The dropdown in the 3D view header is always visible
- The orientation chosen will be used when choosing an axis with MMB and for the *second* key press of X,Y,Z
However, Local orientation doesn't use the one calculated by the manipulator. This is to ensure that multiple object local and armatures in pose still works as before.
- Alt-Space (to change the orientation) works during transform
New Transform orientation: View, using the view axis.
Fixes for the following bugs:
- Constraint projection code "jammed" if input vector was <0,0,0>, reported a couple of times on IRC. Thanks to Basse for the example file.
- Transform on texspace crashed on objects without texspace data (camera, lamp, ...). This was reported in tracker.
- Numinput with lock constraints didn't work correctly. Reported on elysiun
Probably some others that I'm forgetting
I also moved a couple of functions around in an attempt to make things clearer.
2005-07-24 06:25:00 +00:00
|
|
|
void BIF_selectOrientation(void);
|
|
|
|
|
|
So! Finally a show-off of the *power* of Martin P's work! :)
- Made framework for 3d Transform Manipulators (widgets)
- The Manipulators act like '2d buttons', by default with LeftMouse and with
while-hold-move-release
- Implemented now: Translation Widget, which allows:
- four hotspots for axis grab or view-aligned grab
- center defined by 'around' setting
- SHIFT+LMB gives planar constraint on other 2 axes
- works in Object mode and Edit mode (not posemode yet)
Enable it with (temporal) icon in 3D header. All other 'normal' transforms
then keeps working btw.
On the todo for this widget:
- choice for Global, Local or Normal orientation
The way the widgets are going to work is in review still. Commit is also for
Matt for his proposal/paper on topic.
Some notes regarding this project;
- no life updates (on mouse over) like 3DS, I think that's neurotic
- on click, dominant axis changes to theme defined "Transform" color, other axes disappear, like maya
- manipulater size is fixed preset, independent zoom.
- manipulator follows selection, and is located based on 'around' mode
Unresolved;
- in maya, when you select 2 or more objects, the manipulator draws on the 'active' object, also interesting
- what to do with G,R,S hotkeys? It could switch the manipulator "mode"...
- header button/menu for manipulator mode?
2005-03-17 21:31:49 +00:00
|
|
|
/* view3d manipulators */
|
2005-06-28 07:58:16 +00:00
|
|
|
void initManipulator(int mode);
|
|
|
|
|
void ManipulatorTransform();
|
So! Finally a show-off of the *power* of Martin P's work! :)
- Made framework for 3d Transform Manipulators (widgets)
- The Manipulators act like '2d buttons', by default with LeftMouse and with
while-hold-move-release
- Implemented now: Translation Widget, which allows:
- four hotspots for axis grab or view-aligned grab
- center defined by 'around' setting
- SHIFT+LMB gives planar constraint on other 2 axes
- works in Object mode and Edit mode (not posemode yet)
Enable it with (temporal) icon in 3D header. All other 'normal' transforms
then keeps working btw.
On the todo for this widget:
- choice for Global, Local or Normal orientation
The way the widgets are going to work is in review still. Commit is also for
Matt for his proposal/paper on topic.
Some notes regarding this project;
- no life updates (on mouse over) like 3DS, I think that's neurotic
- on click, dominant axis changes to theme defined "Transform" color, other axes disappear, like maya
- manipulater size is fixed preset, independent zoom.
- manipulator follows selection, and is located based on 'around' mode
Unresolved;
- in maya, when you select 2 or more objects, the manipulator draws on the 'active' object, also interesting
- what to do with G,R,S hotkeys? It could switch the manipulator "mode"...
- header button/menu for manipulator mode?
2005-03-17 21:31:49 +00:00
|
|
|
|
|
|
|
|
int BIF_do_manipulator(struct ScrArea *sa);
|
|
|
|
|
void BIF_draw_manipulator(struct ScrArea *sa);
|
|
|
|
|
|
2005-02-20 01:25:10 +00:00
|
|
|
#endif
|
|
|
|
|
|