2005-02-14 02:53:36 +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 TRANSFORM_H
|
|
|
|
|
#define TRANSFORM_H
|
|
|
|
|
|
2005-02-20 01:25:10 +00:00
|
|
|
#include "BIF_transform.h"
|
2005-02-14 02:53:36 +00:00
|
|
|
|
|
|
|
|
/* ************************** Types ***************************** */
|
|
|
|
|
|
2005-02-19 16:37:48 +00:00
|
|
|
struct TransInfo;
|
|
|
|
|
struct TransData;
|
2006-12-28 22:42:58 +00:00
|
|
|
struct TransSnap;
|
2005-04-10 18:33:19 +00:00
|
|
|
struct NumInput;
|
2005-08-16 10:17:02 +00:00
|
|
|
struct Object;
|
2006-12-28 22:08:33 +00:00
|
|
|
struct View3D;
|
2006-12-28 22:42:58 +00:00
|
|
|
struct ScrArea;
|
2007-06-23 06:56:16 +00:00
|
|
|
struct bPose;
|
2007-12-05 11:19:36 +00:00
|
|
|
struct bConstraint;
|
2006-12-28 22:42:58 +00:00
|
|
|
|
2005-04-10 18:33:19 +00:00
|
|
|
|
|
|
|
|
typedef struct NumInput {
|
|
|
|
|
short idx;
|
|
|
|
|
short idx_max;
|
|
|
|
|
short flag; /* Different flags to indicate different behaviors */
|
|
|
|
|
float val[3]; /* Direct value of the input */
|
2006-07-08 13:18:57 +00:00
|
|
|
int ctrl[3]; /* Control to indicate what to do with the numbers that are typed */
|
2005-04-10 18:33:19 +00:00
|
|
|
} NumInput ;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
The ctrl value has different meaning:
|
|
|
|
|
0 : No value has been typed
|
|
|
|
|
|
|
|
|
|
otherwise, |value| - 1 is where the cursor is located after the period
|
|
|
|
|
Positive : number is positive
|
|
|
|
|
Negative : number is negative
|
|
|
|
|
*/
|
2005-02-19 16:37:48 +00:00
|
|
|
|
2006-10-25 23:57:00 +00:00
|
|
|
typedef struct TransSnap {
|
2006-12-23 00:52:34 +00:00
|
|
|
short modePoint;
|
|
|
|
|
short modeTarget;
|
|
|
|
|
int status;
|
|
|
|
|
float snapPoint[3];
|
|
|
|
|
float snapTarget[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)
|
2006-10-25 23:57:00 +00:00
|
|
|
} TransSnap;
|
|
|
|
|
|
2005-02-14 02:53:36 +00:00
|
|
|
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 */
|
2005-03-04 00:07:16 +00:00
|
|
|
float pmtx[3][3]; /* Projection Constraint Matrix (same as imtx with some axis == 0) */
|
2007-04-04 13:18:41 +00:00
|
|
|
float center[3]; /* transformation center to define where to draw the view widget
|
2005-02-14 02:53:36 +00:00
|
|
|
ALWAYS in global space. Unlike the transformation center */
|
2005-03-17 02:34:25 +00:00
|
|
|
short imval[2]; /* initial mouse value for visual calculation */
|
|
|
|
|
/* the one in TransInfo is not garanty to stay the same (Rotates change it) */
|
2005-02-14 02:53:36 +00:00
|
|
|
int mode; /* Mode flags of the Constraint */
|
+ Local axis constraint for multiple object selection works with resize and rotate (the easiest).
+ Refined the headerprint for Translation. Now prints only the needed info for constraint in the constraint's space (ie: if you're moving 1 unit along the local X axis, regardless of it's orientation, it will print "D: 1.000 along local X")
Still need to make numinput work like that (typing a number with a local axis constraint would move along that axis. There's some base code already though, just need a finishing touch, but it's late now)
+ Optimised PET calculations by using the TD_NOACTION flag (actually, that might have been in the last commit).
+ Added a float axismtx[3][3] member to TransData to store the orientation of the element (useful for local axis constrainst which, in edit could be moving along normals and the like).
- Fixed scaling in edit mode (was doing some matrix multiplications in the wrong order, only visible when using a constraint)
- Fixed the constraint projection matrix. It didn't work for planar constraint if the constraint space wasn't global (in a nutshell, it produced weird results for local space planes).
- Some potential bugs fixed (Note to Ton: added an ext pointer in TransInfo to point to the TransDataExtension block. With the sort done after allocation, the first td pointer doesn't necesarely point at the start of the ext block, so we needed another to free it correctly).
- Got rid of some remaining test with G.obedit.
- Moved constraint reset from init to post trans code (Ton, that means you can create constraints before calling transform, like for the menus for example).
NOTE:
I was getting some random segfault with the new headerprint code. Very random, couldn't reproduce with a debug version. I did some initialisation that might have been missing (though doubtful that's what caused the crashes). Was linked to using constraint though not caused by them. Probably due to some dumb late coding error.
2005-03-08 03:51:45 +00:00
|
|
|
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 *);
|
2005-02-14 02:53:36 +00:00
|
|
|
/* Apply function pointer for linear vectorial transformation */
|
+ Local axis constraint for multiple object selection works with resize and rotate (the easiest).
+ Refined the headerprint for Translation. Now prints only the needed info for constraint in the constraint's space (ie: if you're moving 1 unit along the local X axis, regardless of it's orientation, it will print "D: 1.000 along local X")
Still need to make numinput work like that (typing a number with a local axis constraint would move along that axis. There's some base code already though, just need a finishing touch, but it's late now)
+ Optimised PET calculations by using the TD_NOACTION flag (actually, that might have been in the last commit).
+ Added a float axismtx[3][3] member to TransData to store the orientation of the element (useful for local axis constrainst which, in edit could be moving along normals and the like).
- Fixed scaling in edit mode (was doing some matrix multiplications in the wrong order, only visible when using a constraint)
- Fixed the constraint projection matrix. It didn't work for planar constraint if the constraint space wasn't global (in a nutshell, it produced weird results for local space planes).
- Some potential bugs fixed (Note to Ton: added an ext pointer in TransInfo to point to the TransDataExtension block. With the sort done after allocation, the first td pointer doesn't necesarely point at the start of the ext block, so we needed another to free it correctly).
- Got rid of some remaining test with G.obedit.
- Moved constraint reset from init to post trans code (Ton, that means you can create constraints before calling transform, like for the menus for example).
NOTE:
I was getting some random segfault with the new headerprint code. Very random, couldn't reproduce with a debug version. I did some initialisation that might have been missing (though doubtful that's what caused the crashes). Was linked to using constraint though not caused by them. Probably due to some dumb late coding error.
2005-03-08 03:51:45 +00:00
|
|
|
/* The last three parameters are pointers to the in/out/printable vectors */
|
2005-03-04 00:07:16 +00:00
|
|
|
void (*applySize)(struct TransInfo *, struct TransData *, float [3][3]);
|
|
|
|
|
/* Apply function pointer for rotation transformation (prototype will change */
|
2005-02-14 02:53:36 +00:00
|
|
|
void (*applyRot)(struct TransInfo *, struct TransData *, float [3]);
|
|
|
|
|
/* Apply function pointer for rotation transformation (prototype will change */
|
|
|
|
|
} TransCon;
|
|
|
|
|
|
2005-02-25 11:35:24 +00:00
|
|
|
typedef struct TransDataIpokey {
|
|
|
|
|
int flag; /* which keys */
|
|
|
|
|
float *locx, *locy, *locz; /* channel pointers */
|
|
|
|
|
float *rotx, *roty, *rotz;
|
|
|
|
|
float *quatx, *quaty, *quatz, *quatw;
|
|
|
|
|
float *sizex, *sizey, *sizez;
|
|
|
|
|
float oldloc[9]; /* storage old values */
|
|
|
|
|
float oldrot[9];
|
|
|
|
|
float oldsize[9];
|
|
|
|
|
float oldquat[12];
|
|
|
|
|
} TransDataIpokey;
|
|
|
|
|
|
2005-02-23 02:23:50 +00:00
|
|
|
typedef struct TransDataExtension {
|
2005-02-25 11:35:24 +00:00
|
|
|
float drot[3]; /* Initial object drot */
|
|
|
|
|
float dsize[3]; /* Initial object dsize */
|
2005-02-23 02:23:50 +00:00
|
|
|
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 */
|
2005-02-25 11:35:24 +00:00
|
|
|
float obmat[3][3]; /* Object matrix */
|
2005-02-23 02:23:50 +00:00
|
|
|
} TransDataExtension;
|
|
|
|
|
|
2005-08-23 18:13:30 +00:00
|
|
|
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;
|
|
|
|
|
|
2005-02-14 02:53:36 +00:00
|
|
|
typedef struct TransData {
|
2005-03-27 23:13:52 +00:00
|
|
|
float dist; /* Distance needed to affect element (for Proportionnal Editing) */
|
|
|
|
|
float rdist; /* Distance to the nearest element (for Proportionnal Editing) */
|
2005-02-14 02:53:36 +00:00
|
|
|
float factor; /* Factor of the transformation (for Proportionnal Editing) */
|
|
|
|
|
float *loc; /* Location of the data to transform */
|
|
|
|
|
float iloc[3]; /* Initial location */
|
2005-03-16 21:55:57 +00:00
|
|
|
float *val; /* Value pointer for special transforms */
|
|
|
|
|
float ival; /* Old value*/
|
+ Local axis constraint for multiple object selection works with resize and rotate (the easiest).
+ Refined the headerprint for Translation. Now prints only the needed info for constraint in the constraint's space (ie: if you're moving 1 unit along the local X axis, regardless of it's orientation, it will print "D: 1.000 along local X")
Still need to make numinput work like that (typing a number with a local axis constraint would move along that axis. There's some base code already though, just need a finishing touch, but it's late now)
+ Optimised PET calculations by using the TD_NOACTION flag (actually, that might have been in the last commit).
+ Added a float axismtx[3][3] member to TransData to store the orientation of the element (useful for local axis constrainst which, in edit could be moving along normals and the like).
- Fixed scaling in edit mode (was doing some matrix multiplications in the wrong order, only visible when using a constraint)
- Fixed the constraint projection matrix. It didn't work for planar constraint if the constraint space wasn't global (in a nutshell, it produced weird results for local space planes).
- Some potential bugs fixed (Note to Ton: added an ext pointer in TransInfo to point to the TransDataExtension block. With the sort done after allocation, the first td pointer doesn't necesarely point at the start of the ext block, so we needed another to free it correctly).
- Got rid of some remaining test with G.obedit.
- Moved constraint reset from init to post trans code (Ton, that means you can create constraints before calling transform, like for the menus for example).
NOTE:
I was getting some random segfault with the new headerprint code. Very random, couldn't reproduce with a debug version. I did some initialisation that might have been missing (though doubtful that's what caused the crashes). Was linked to using constraint though not caused by them. Probably due to some dumb late coding error.
2005-03-08 03:51:45 +00:00
|
|
|
float center[3]; /* Individual data center */
|
2005-02-23 02:23:50 +00:00
|
|
|
float mtx[3][3]; /* Transformation matrix from data space to global space */
|
|
|
|
|
float smtx[3][3]; /* Transformation matrix from global space to data space */
|
+ Local axis constraint for multiple object selection works with resize and rotate (the easiest).
+ Refined the headerprint for Translation. Now prints only the needed info for constraint in the constraint's space (ie: if you're moving 1 unit along the local X axis, regardless of it's orientation, it will print "D: 1.000 along local X")
Still need to make numinput work like that (typing a number with a local axis constraint would move along that axis. There's some base code already though, just need a finishing touch, but it's late now)
+ Optimised PET calculations by using the TD_NOACTION flag (actually, that might have been in the last commit).
+ Added a float axismtx[3][3] member to TransData to store the orientation of the element (useful for local axis constrainst which, in edit could be moving along normals and the like).
- Fixed scaling in edit mode (was doing some matrix multiplications in the wrong order, only visible when using a constraint)
- Fixed the constraint projection matrix. It didn't work for planar constraint if the constraint space wasn't global (in a nutshell, it produced weird results for local space planes).
- Some potential bugs fixed (Note to Ton: added an ext pointer in TransInfo to point to the TransDataExtension block. With the sort done after allocation, the first td pointer doesn't necesarely point at the start of the ext block, so we needed another to free it correctly).
- Got rid of some remaining test with G.obedit.
- Moved constraint reset from init to post trans code (Ton, that means you can create constraints before calling transform, like for the menus for example).
NOTE:
I was getting some random segfault with the new headerprint code. Very random, couldn't reproduce with a debug version. I did some initialisation that might have been missing (though doubtful that's what caused the crashes). Was linked to using constraint though not caused by them. Probably due to some dumb late coding error.
2005-03-08 03:51:45 +00:00
|
|
|
float axismtx[3][3];/* Axis orientation matrix of the data */
|
2005-02-23 02:23:50 +00:00
|
|
|
struct Object *ob;
|
2007-12-05 11:19:36 +00:00
|
|
|
struct bConstraint *con; /* for objects/bones, the first constraint in its constraint stack */
|
2005-02-25 11:35:24 +00:00
|
|
|
TransDataExtension *ext; /* for objects, poses. 1 single malloc per TransInfo! */
|
|
|
|
|
TransDataIpokey *tdi; /* for objects, ipo keys. per transdata a malloc */
|
2005-12-01 19:04:57 +00:00
|
|
|
void *tdmir; /* mirrored element pointer, in editmode mesh to EditVert */
|
2005-10-29 20:08:25 +00:00
|
|
|
short flag; /* Various flags */
|
|
|
|
|
short protectflag; /* If set, copy of Object or PoseChannel protection */
|
2006-08-20 15:22:56 +00:00
|
|
|
/*#ifdef WITH_VERSE*/
|
|
|
|
|
void *verse; /* pointer at verse data struct (VerseVert, etc.) */
|
|
|
|
|
/*#endif*/
|
2005-02-14 02:53:36 +00:00
|
|
|
} TransData;
|
|
|
|
|
|
|
|
|
|
typedef struct TransInfo {
|
|
|
|
|
int mode; /* current mode */
|
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
|
|
|
int flag; /* generic flags for special behaviors */
|
2005-05-10 04:21:11 +00:00
|
|
|
short state; /* current state (running, canceled,...)*/
|
2005-03-27 21:25:15 +00:00
|
|
|
int context; /* current context */
|
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
|
|
|
float val; /* init value for some transformations (and rotation angle) */
|
|
|
|
|
float fac; /* factor for distance based transform */
|
2005-02-14 02:53:36 +00:00
|
|
|
int (*transform)(struct TransInfo *, short *);
|
|
|
|
|
/* transform function pointer */
|
2007-08-09 01:07:27 +00:00
|
|
|
int (*handleEvent)(struct TransInfo *, unsigned short event, short val);
|
|
|
|
|
/* event handler function pointer RETURN 1 if redraw is needed */
|
2005-02-14 02:53:36 +00:00
|
|
|
int total; /* total number of transformed data */
|
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
|
|
|
TransData *data; /* transformed data (array) */
|
|
|
|
|
TransDataExtension *ext; /* transformed data extension (array) */
|
2005-08-23 18:13:30 +00:00
|
|
|
TransData2D *data2d; /* transformed data for 2d (array) */
|
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
|
|
|
TransCon con; /* transformed constraint */
|
2006-10-25 23:57:00 +00:00
|
|
|
TransSnap tsnap;
|
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
|
|
|
NumInput num; /* numerical input */
|
|
|
|
|
char redraw; /* redraw flag */
|
2005-02-14 02:53:36 +00:00
|
|
|
float propsize; /* proportional circle radius */
|
|
|
|
|
char proptext[20]; /* proportional falloff text */
|
|
|
|
|
float center[3]; /* center of transformation */
|
2005-06-05 13:50:21 +00:00
|
|
|
int center2d[2]; /* center in screen coordinates */
|
2005-02-14 02:53:36 +00:00
|
|
|
short imval[2]; /* initial mouse position */
|
2005-03-25 11:17:59 +00:00
|
|
|
short shiftmval[2]; /* mouse position when shift was pressed */
|
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
|
|
|
short idx_max; /* maximum index on the input vector */
|
2005-03-04 00:07:16 +00:00
|
|
|
float snap[3]; /* Snapping Gears */
|
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
|
|
|
|
2005-08-23 18:13:30 +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 */
|
2005-03-24 18:47:09 +00:00
|
|
|
float persinv[4][4];
|
2005-08-23 18:13:30 +00:00
|
|
|
short persp;
|
|
|
|
|
short around;
|
|
|
|
|
char spacetype; /* spacetype where transforming is */
|
2005-03-24 18:47:09 +00:00
|
|
|
|
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
|
|
|
float vec[3]; /* translation, to show for widget */
|
|
|
|
|
float mat[3][3]; /* rot/rescale, to show for widget */
|
2005-05-08 12:00:28 +00:00
|
|
|
|
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
|
|
|
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 */
|
2005-08-16 10:17:02 +00:00
|
|
|
|
|
|
|
|
struct Object *poseobj; /* if t->flag & T_POSE, this denotes pose object */
|
2007-08-09 01:07:27 +00:00
|
|
|
|
|
|
|
|
void *customData; /* Per Transform custom data */
|
2005-02-14 02:53:36 +00:00
|
|
|
} TransInfo;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************** Macros & Prototypes *********************** */
|
|
|
|
|
|
2005-03-31 21:02:35 +00:00
|
|
|
/* 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
|
2005-02-14 02:53:36 +00:00
|
|
|
|
2005-05-10 04:21:11 +00:00
|
|
|
/* transinfo->state */
|
|
|
|
|
#define TRANS_RUNNING 0
|
|
|
|
|
#define TRANS_CONFIRM 1
|
|
|
|
|
#define TRANS_CANCEL 2
|
|
|
|
|
|
2005-03-11 01:33:43 +00:00
|
|
|
/* transinfo->flag */
|
2007-08-09 01:07:27 +00:00
|
|
|
#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)
|
2005-03-25 11:17:59 +00:00
|
|
|
// when shift pressed, higher resolution transform. cannot rely on G.qual, need event!
|
2007-08-09 01:07:27 +00:00
|
|
|
#define T_SHIFT_MOD (1 << 5)
|
2005-08-23 18:13:30 +00:00
|
|
|
// trans on points, having no rotation/scale
|
2007-08-09 01:07:27 +00:00
|
|
|
#define T_POINTS (1 << 6)
|
2005-03-19 12:17:06 +00:00
|
|
|
// for manipulator exceptions, like scaling using center point, drawing help lines
|
2007-08-09 01:07:27 +00:00
|
|
|
#define T_USES_MANIPULATOR (1 << 7)
|
2005-03-11 01:33:43 +00:00
|
|
|
|
2007-12-15 07:35:16 +00:00
|
|
|
/* restrictions flags */
|
2007-08-09 01:07:27 +00:00
|
|
|
#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)
|
2005-03-31 21:02:35 +00:00
|
|
|
|
2007-08-09 01:07:27 +00:00
|
|
|
#define T_PROP_EDIT (1 << 11)
|
|
|
|
|
#define T_PROP_CONNECTED (1 << 12)
|
2005-04-01 18:39:39 +00:00
|
|
|
|
2007-12-15 07:35:16 +00:00
|
|
|
/* if MMB is pressed or not */
|
2007-08-09 01:07:27 +00:00
|
|
|
#define T_MMB_PRESSED (1 << 13)
|
|
|
|
|
|
|
|
|
|
#define T_V3D_ALIGN (1 << 14)
|
2007-12-15 07:35:16 +00:00
|
|
|
/* for 2d views like uv or ipo */
|
|
|
|
|
#define T_2D_EDIT (1 << 15)
|
2007-08-09 01:07:27 +00:00
|
|
|
#define T_CLIP_UV (1 << 16)
|
|
|
|
|
|
|
|
|
|
#define T_FREE_CUSTOMDATA (1 << 17)
|
2007-12-15 07:35:16 +00:00
|
|
|
/* auto-ik is on */
|
|
|
|
|
#define T_AUTOIK (1 << 18)
|
2007-08-09 01:07:27 +00:00
|
|
|
|
|
|
|
|
/* ******************************************************************************** */
|
2005-03-11 01:33:43 +00:00
|
|
|
|
2005-03-19 12:17:06 +00:00
|
|
|
/* transinfo->con->mode */
|
2005-03-01 19:22:29 +00:00
|
|
|
#define CON_APPLY 1
|
|
|
|
|
#define CON_AXIS0 2
|
|
|
|
|
#define CON_AXIS1 4
|
|
|
|
|
#define CON_AXIS2 8
|
|
|
|
|
#define CON_SELECT 16
|
+ Local axis constraint for multiple object selection works with resize and rotate (the easiest).
+ Refined the headerprint for Translation. Now prints only the needed info for constraint in the constraint's space (ie: if you're moving 1 unit along the local X axis, regardless of it's orientation, it will print "D: 1.000 along local X")
Still need to make numinput work like that (typing a number with a local axis constraint would move along that axis. There's some base code already though, just need a finishing touch, but it's late now)
+ Optimised PET calculations by using the TD_NOACTION flag (actually, that might have been in the last commit).
+ Added a float axismtx[3][3] member to TransData to store the orientation of the element (useful for local axis constrainst which, in edit could be moving along normals and the like).
- Fixed scaling in edit mode (was doing some matrix multiplications in the wrong order, only visible when using a constraint)
- Fixed the constraint projection matrix. It didn't work for planar constraint if the constraint space wasn't global (in a nutshell, it produced weird results for local space planes).
- Some potential bugs fixed (Note to Ton: added an ext pointer in TransInfo to point to the TransDataExtension block. With the sort done after allocation, the first td pointer doesn't necesarely point at the start of the ext block, so we needed another to free it correctly).
- Got rid of some remaining test with G.obedit.
- Moved constraint reset from init to post trans code (Ton, that means you can create constraints before calling transform, like for the menus for example).
NOTE:
I was getting some random segfault with the new headerprint code. Very random, couldn't reproduce with a debug version. I did some initialisation that might have been missing (though doubtful that's what caused the crashes). Was linked to using constraint though not caused by them. Probably due to some dumb late coding error.
2005-03-08 03:51:45 +00:00
|
|
|
#define CON_NOFLIP 32 /* does not reorient vector to face viewport when on */
|
2005-05-07 21:04:55 +00:00
|
|
|
#define CON_LOCAL 64
|
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
|
|
|
#define CON_USER 128
|
2005-02-14 02:53:36 +00:00
|
|
|
|
2005-02-22 16:50:04 +00:00
|
|
|
/* transdata->flag */
|
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
|
|
|
#define TD_SELECTED 1
|
|
|
|
|
#define TD_NOACTION 2
|
|
|
|
|
#define TD_USEQUAT 4
|
2005-04-11 19:31:05 +00:00
|
|
|
#define TD_NOTCONNECTED 8
|
|
|
|
|
#define TD_SINGLESIZE 16 /* used for scaling of MetaElem->rad */
|
2006-08-20 15:22:56 +00:00
|
|
|
#ifdef WITH_VERSE
|
2007-09-30 11:43:16 +00:00
|
|
|
#define TD_VERSE_OBJECT 32
|
|
|
|
|
#define TD_VERSE_VERT 64
|
2006-08-20 15:22:56 +00:00
|
|
|
#endif
|
2007-09-30 11:43:16 +00:00
|
|
|
#define TD_TIMEONLY 128
|
2007-11-01 12:55:47 +00:00
|
|
|
#define TD_NOCENTER 256
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
#define TD_NO_EXT 512 /* ext abused for particle key timing */
|
|
|
|
|
#define TD_SKIP 1024 /* don't transform this data */
|
2005-02-14 02:53:36 +00:00
|
|
|
|
2006-12-19 22:25:07 +00:00
|
|
|
/* transsnap->status */
|
2006-12-20 19:47:12 +00:00
|
|
|
#define SNAP_ON 1
|
|
|
|
|
#define TARGET_INIT 2
|
|
|
|
|
#define POINT_INIT 4
|
2006-12-19 22:25:07 +00:00
|
|
|
|
2006-12-23 00:52:34 +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
|
2006-12-19 22:25:07 +00:00
|
|
|
|
2005-05-15 05:44:11 +00:00
|
|
|
void checkFirstTime(void);
|
|
|
|
|
|
2005-08-23 18:13:30 +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);
|
|
|
|
|
|
|
|
|
|
void convertVecToDisplayNum(float *vec, float *num);
|
|
|
|
|
void convertDisplayNumToVec(float *num, float *vec);
|
|
|
|
|
|
2005-03-08 17:29:33 +00:00
|
|
|
void initWarp(TransInfo *t);
|
2007-12-26 03:06:59 +00:00
|
|
|
int handleEventWarp(TransInfo *t, unsigned short event, short val);
|
2005-03-08 17:29:33 +00:00
|
|
|
int Warp(TransInfo *t, short mval[2]);
|
2005-02-14 02:53:36 +00:00
|
|
|
|
|
|
|
|
void initShear(TransInfo *t);
|
2007-08-09 01:07:27 +00:00
|
|
|
int handleEventShear(TransInfo *t, unsigned short evenl, short val);
|
2005-02-14 02:53:36 +00:00
|
|
|
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]);
|
|
|
|
|
|
2005-03-13 20:17:39 +00:00
|
|
|
void initShrinkFatten(TransInfo *t);
|
|
|
|
|
int ShrinkFatten(TransInfo *t, short mval[2]);
|
|
|
|
|
|
2005-03-16 21:55:57 +00:00
|
|
|
void initTilt(TransInfo *t);
|
|
|
|
|
int Tilt(TransInfo *t, short mval[2]);
|
|
|
|
|
|
2006-08-13 07:37:51 +00:00
|
|
|
void initCurveShrinkFatten(TransInfo *t);
|
|
|
|
|
int CurveShrinkFatten(TransInfo *t, short mval[2]);
|
|
|
|
|
|
2005-03-19 12:17:06 +00:00
|
|
|
void initTrackball(TransInfo *t);
|
|
|
|
|
int Trackball(TransInfo *t, short mval[2]);
|
|
|
|
|
|
2005-03-31 22:18:08 +00:00
|
|
|
void initPushPull(TransInfo *t);
|
|
|
|
|
int PushPull(TransInfo *t, short mval[2]);
|
|
|
|
|
|
2005-04-04 23:37:15 +00:00
|
|
|
void initCrease(TransInfo *t);
|
|
|
|
|
int Crease(TransInfo *t, short mval[2]);
|
|
|
|
|
|
2005-07-16 19:07:02 +00:00
|
|
|
void initBoneSize(TransInfo *t);
|
|
|
|
|
int BoneSize(TransInfo *t, short mval[2]);
|
|
|
|
|
|
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
|
|
|
void initBoneEnvelope(TransInfo *t);
|
|
|
|
|
int BoneEnvelope(TransInfo *t, short mval[2]);
|
|
|
|
|
|
Big Commit.
Now time-markers work in all time-related spaces (i.e. Ipo,
Action Editor, NLA editor, TimeLine, Sound). The hotkeys and
functionality set should be the same for each of these modes
(with a few exceptions still). I've had to change a few hotkeys
here and there, so hopefully they aren't too bad.
Marker Operations:
MKEY - Add Marker
SHIFT MKEY - Rename marker (was CTRL MKEY)
XKEY - Delete Marker
PAGE UP - Jump to next marker
PAGE DOWN - Jump to previous marker
CTRL A - Select all markers
SHIFT G - Transform markers (NLA, IPO, Action)
G - Transform markers (Sound, Timeline)
CTRL SHIFT D - Duplicate markers (NLA, IPO, Action)
SHIFT D - Duplicate markers (Sound, Timeline)
BKEY - select markers and other keyframes (if any)
I've also made a few little tool additions to NLA and Action editors:
* NLA editor - Snap To Frame.
Now with the option to offset strip so that it starts at the current frame.
Added menus for this.
* Action editor - Snap To Frame
A few new menus for this too
2006-11-30 01:57:14 +00:00
|
|
|
void initBoneRoll(TransInfo *t);
|
|
|
|
|
int BoneRoll(TransInfo *t, short mval[2]);
|
|
|
|
|
|
2007-09-24 11:29:25 +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]);
|
|
|
|
|
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
void initBakeTime(TransInfo *t);
|
|
|
|
|
int BakeTime(TransInfo *t, short mval[2]);
|
|
|
|
|
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
/*********************** transform_conversions.c ********** */
|
2005-03-20 09:45:54 +00:00
|
|
|
struct ListBase;
|
2007-09-30 11:43:16 +00:00
|
|
|
void flushTransIpoData(TransInfo *t);
|
2005-08-23 18:13:30 +00:00
|
|
|
void flushTransUVs(TransInfo *t);
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
void flushTransParticles(TransInfo *t);
|
2005-08-23 18:13:30 +00:00
|
|
|
int clipUVTransform(TransInfo *t, float *vec, int resize);
|
2005-03-20 09:45:54 +00:00
|
|
|
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
/*********************** exported from transform_manipulator.c ********** */
|
2005-03-23 11:49:54 +00:00
|
|
|
void draw_manipulator_ext(struct ScrArea *sa, int type, char axis, int col, float vec[3], float mat[][3]);
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
int calc_manipulator_stats(struct ScrArea *sa);
|
2006-12-21 20:45:57 +00:00
|
|
|
float get_drawsize(struct View3D *v3d);
|
2005-03-23 11:49:54 +00:00
|
|
|
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
/*********************** TransData Creation and General Handling *********** */
|
2005-04-10 18:33:19 +00:00
|
|
|
void createTransData(TransInfo *t);
|
|
|
|
|
void sort_trans_data_dist(TransInfo *t);
|
|
|
|
|
void add_tdi_poin(float *poin, float *old, float delta);
|
2005-08-16 10:17:02 +00:00
|
|
|
void special_aftertrans_update(TransInfo *t);
|
2005-03-20 09:45:54 +00:00
|
|
|
|
2007-12-15 07:35:16 +00:00
|
|
|
void transform_autoik_update(TransInfo *t, short mode);
|
|
|
|
|
|
2007-06-23 06:56:16 +00:00
|
|
|
/* auto-keying stuff used by special_aftertrans_update */
|
2008-01-10 01:36:22 +00:00
|
|
|
short autokeyframe_cfra_can_key(struct Object *ob);
|
2007-06-23 06:56:16 +00:00
|
|
|
void autokeyframe_ob_cb_func(struct Object *ob, int tmode);
|
|
|
|
|
void autokeyframe_pose_cb_func(struct Object *ob, int tmode, short targetless_ik);
|
|
|
|
|
|
2005-04-10 18:33:19 +00:00
|
|
|
/*********************** Constraints *****************************/
|
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
|
|
|
|
2005-04-10 18:33:19 +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[]);
|
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 setUserConstraint(TransInfo *t, int mode, const char text[]);
|
2005-04-10 18:33:19 +00:00
|
|
|
|
|
|
|
|
void constraintNumInput(TransInfo *t, float vec[3]);
|
|
|
|
|
|
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 getConstraintMatrix(TransInfo *t);
|
2005-05-29 09:21:34 +00:00
|
|
|
int isLockConstraint(TransInfo *t);
|
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
|
|
|
int getConstraintSpaceDimension(TransInfo *t);
|
|
|
|
|
char constraintModeToChar(TransInfo *t);
|
2005-05-29 09:21:34 +00:00
|
|
|
|
2005-04-10 18:33:19 +00:00
|
|
|
void startConstraint(TransInfo *t);
|
|
|
|
|
void stopConstraint(TransInfo *t);
|
|
|
|
|
|
2005-04-24 01:18:13 +00:00
|
|
|
void initSelectConstraint(TransInfo *t, float mtx[3][3]);
|
2005-04-10 18:33:19 +00:00
|
|
|
void selectConstraint(TransInfo *t);
|
|
|
|
|
void postSelectConstraint(TransInfo *t);
|
|
|
|
|
|
|
|
|
|
void setNearestAxis(TransInfo *t);
|
|
|
|
|
|
2006-10-25 23:57:00 +00:00
|
|
|
/*********************** 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);
|
|
|
|
|
|
|
|
|
|
void initSnapping(struct TransInfo *t);
|
|
|
|
|
void applySnapping(TransInfo *t, float *vec);
|
|
|
|
|
void resetSnapping(TransInfo *t);
|
|
|
|
|
int handleSnapping(TransInfo *t, int event);
|
|
|
|
|
void drawSnapping(TransInfo *t);
|
|
|
|
|
|
2005-04-10 18:33:19 +00:00
|
|
|
/*********************** Generics ********************************/
|
|
|
|
|
|
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 initTrans(TransInfo *t);
|
2005-04-10 18:33:19 +00:00
|
|
|
void initTransModeFlags(TransInfo *t, int mode);
|
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 postTrans (TransInfo *t);
|
2005-04-10 18:33:19 +00:00
|
|
|
|
|
|
|
|
void drawLine(float *center, float *dir, char axis, short options);
|
|
|
|
|
|
|
|
|
|
/* DRAWLINE options flags */
|
|
|
|
|
#define DRAWLIGHT 1
|
|
|
|
|
#define DRAWDASHED 2
|
|
|
|
|
#define DRAWBOLD 4
|
|
|
|
|
|
|
|
|
|
void applyTransObjects(TransInfo *t);
|
|
|
|
|
void restoreTransObjects(TransInfo *t);
|
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 recalcData(TransInfo *t);
|
2005-04-10 18:33:19 +00:00
|
|
|
|
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 calculateCenter(TransInfo *t);
|
2005-09-24 18:00:32 +00:00
|
|
|
void calculateCenter2D(TransInfo *t);
|
2005-04-10 18:33:19 +00:00
|
|
|
void calculateCenterBound(TransInfo *t);
|
|
|
|
|
void calculateCenterMedian(TransInfo *t);
|
|
|
|
|
void calculateCenterCursor(TransInfo *t);
|
|
|
|
|
|
2007-09-14 16:12:17 +00:00
|
|
|
void calculateCenterCursor2D(TransInfo *t);
|
2005-04-10 18:33:19 +00:00
|
|
|
void calculatePropRatio(TransInfo *t);
|
|
|
|
|
|
|
|
|
|
void getViewVector(float coord[3], float vec[3]);
|
|
|
|
|
|
|
|
|
|
TransInfo * BIF_GetTransInfo(void);
|
|
|
|
|
|
|
|
|
|
/*********************** NumInput ********************************/
|
|
|
|
|
|
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 outputNumInput(NumInput *n, char *str);
|
2005-04-10 18:33:19 +00:00
|
|
|
short hasNumInput(NumInput *n);
|
|
|
|
|
void applyNumInput(NumInput *n, float *vec);
|
|
|
|
|
char handleNumInput(NumInput *n, unsigned short event);
|
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
|
|
|
|
=== Custom Transform Orientation ===
Custom Orientations can be added with Ctrl-Shift-C (hotkey suggestions are welcomed), this adds and select the new alignment. Custom Orientations can also be added, deleted, selected from the Transform Orientations panel (View -> Transform Orientations). Standard orientations (global, local, normal, view) can also be selected from this panel.
If you plan on using only a single custom orientation and don't really need a list, I suggest you use the hotkey as it adds and selects at the same time.
Custom Orientations are save in the scene and are selected per 3D view (like normal orientation).
Adding from an object, the orientation is a normalized version of the object's orientation.
Adding from mesh data, a single element (vertex, edge, face) must be selected in its respective selection mode. Vertex orientation Z-axis is based on the normal, edge Z-axis on the edge itself (X-axis is on the XoY plane when possible, Y-axis is perpendicular to the rest). Face orientation Z-axis is the face normal, X-axis is perpendicular to the first edge, Y-axis is perpendicular to the rest.
(More logical orientations can be suggested).
I plan to add: 2 vertice (connected or not) => edge orientation , 3 vertice = face orientation
Differences from the patch:
- orientations no longer link back to the object they came from, everything is copy on creation.
- orientations are overwritten based on name (if you add an orientation with the same name as one that already exists, it overwrites the old one)
2008-01-13 18:24:09 +00:00
|
|
|
/*********************** TransSpace ******************************/
|
|
|
|
|
|
|
|
|
|
int manageObjectSpace(int confirm, int set);
|
|
|
|
|
int manageMeshSpace(int confirm, int set);
|
|
|
|
|
|
|
|
|
|
int addMatrixSpace(float mat[3][3], char name[]);
|
|
|
|
|
int addObjectSpace(struct Object *ob);
|
|
|
|
|
void applyTransformOrientation(void);
|
|
|
|
|
|
2005-02-14 02:53:36 +00:00
|
|
|
#endif
|
|
|
|
|
|
2007-12-15 07:35:16 +00:00
|
|
|
|