Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2007-08-09 05:07:27 +0400
committerMartin Poirier <theeth@yahoo.com>2007-08-09 05:07:27 +0400
commit9e32291a758395ad7c15819858e4fa5492b7c4a2 (patch)
treec7d12432874cb0839592c41eee2da3dc5219cedf /source/blender/src/transform_generics.c
parent5f5b35889bf83e4605bab13a56a9c72b868e6e3f (diff)
Small Transform code cleanup and addins for future features.
- Removing evil InitTransModeFlags (I would always forget to update that when adding new stuff). It's properly done in the per transform init now. - Add toggleable mode for Shear (with MMB) for horizontal or vertical shear. Toggle shear mode also changes the input mode from vertical to horizontal and vice versa (it's intuitiver that way). (This was suggested in a really old patch but never implemented because I disliked adding transform specific handling in the main event switch). - Add custom event handlers per transform (currently only used for Shear) - Add custom data pointer and freeing flag (only (a)bused by Shear). NOTE to Levi Schooley: Some stuff in there might be useful for you.
Diffstat (limited to 'source/blender/src/transform_generics.c')
-rwxr-xr-xsource/blender/src/transform_generics.c42
1 files changed, 8 insertions, 34 deletions
diff --git a/source/blender/src/transform_generics.c b/source/blender/src/transform_generics.c
index 9243d8d3c2b..8e999e8bb31 100755
--- a/source/blender/src/transform_generics.c
+++ b/source/blender/src/transform_generics.c
@@ -376,39 +376,6 @@ void recalcData(TransInfo *t)
}
-void initTransModeFlags(TransInfo *t, int mode)
-{
- t->mode = mode;
- t->num.flag = 0;
-
- /* REMOVING RESTRICTIONS FLAGS */
- t->flag &= ~T_ALL_RESTRICTIONS;
-
- switch (mode) {
- case TFM_RESIZE:
- t->flag |= T_NULL_ONE;
- t->num.flag |= NUM_NULL_ONE;
- t->num.flag |= NUM_AFFECT_ALL;
- if (!G.obedit) {
- t->flag |= T_NO_ZERO;
- t->num.flag |= NUM_NO_ZERO;
- }
- break;
- case TFM_TOSPHERE:
- t->num.flag |= NUM_NULL_ONE;
- t->num.flag |= NUM_NO_NEGATIVE;
- t->flag |= T_NO_CONSTRAINT;
- break;
- case TFM_SHEAR:
- case TFM_CREASE:
- case TFM_BONE_ENVELOPE:
- case TFM_CURVE_SHRINKFATTEN:
- case TFM_BONE_ROLL:
- t->flag |= T_NO_CONSTRAINT;
- break;
- }
-}
-
void drawLine(float *center, float *dir, char axis, short options)
{
extern void make_axis_color(char *col, char *col2, char axis); // drawview.c
@@ -443,7 +410,6 @@ void drawLine(float *center, float *dir, char axis, short options)
void initTrans (TransInfo *t)
{
-
/* moving: is shown in drawobject() (transform color) */
if(G.obedit || (t->flag & T_POSE) ) G.moving= G_TRANSFORM_EDIT;
else G.moving= G_TRANSFORM_OBJ;
@@ -452,6 +418,8 @@ void initTrans (TransInfo *t)
t->ext = NULL;
t->flag = 0;
+ t->num.flag = 0;
+
/* setting PET flag */
if ((t->context & CTX_NO_PET) == 0 && (G.scene->proportional)) {
@@ -464,6 +432,8 @@ void initTrans (TransInfo *t)
t->con.imval[1] = t->imval[1];
t->transform = NULL;
+ t->handleEvent = NULL;
+ t->customData = NULL;
t->total =
t->num.idx =
@@ -542,6 +512,10 @@ void postTrans (TransInfo *t)
MEM_freeN(t->data2d);
t->data2d= NULL;
}
+
+ if ((t->flag & T_FREE_CUSTOMDATA) && t->customData != NULL) {
+ MEM_freeN(t->customData);
+ }
if(t->spacetype==SPACE_IMAGE) {
if (G.sima->flag & SI_LIVE_UNWRAP)