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:
authorJoshua Leung <aligorith@gmail.com>2009-10-21 14:36:46 +0400
committerJoshua Leung <aligorith@gmail.com>2009-10-21 14:36:46 +0400
commit7685def9af9f69c2ff176a32d586fcbf0d938512 (patch)
treebfefb1b437a3937922e603b5aa0a4902611c39a3 /source/blender/editors/transform/transform_generics.c
parent3a6da12ab101f2406c951638141641ad634c397e (diff)
Graph Editor: Pivot Modes for Transform
It is now possible to choose from 'Bounding Box' (default), '2D-Cursor', and 'Individual Centers' as the pivot point(s) that rotation/scaling is performed around.
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r--source/blender/editors/transform/transform_generics.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 2af92719d19..4b800ba1409 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -952,11 +952,17 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
t->view = &ar->v2d;
t->around = sima->around;
}
+ else if(t->spacetype==SPACE_IPO)
+ {
+ SpaceIpo *sipo= sa->spacedata.first;
+ t->view = &ar->v2d;
+ t->around = sipo->around;
+ }
else
{
// XXX for now, get View2D from the active region
t->view = &ar->v2d;
-
+ // XXX for now, the center point is the midpoint of the data
t->around = V3D_CENTER;
}
@@ -1196,6 +1202,18 @@ void calculateCenterCursor2D(TransInfo *t)
calculateCenter2D(t);
}
+void calculateCenterCursorGraph2D(TransInfo *t)
+{
+ SpaceIpo *sipo= (SpaceIpo *)t->sa->spacedata.first;
+ Scene *scene= t->scene;
+
+ /* cursor is combination of current frame, and graph-editor cursor value */
+ t->center[0]= (float)(scene->r.cfra);
+ t->center[1]= sipo->cursorVal;
+
+ calculateCenter2D(t);
+}
+
void calculateCenterMedian(TransInfo *t)
{
float partial[3] = {0.0f, 0.0f, 0.0f};
@@ -1267,6 +1285,8 @@ void calculateCenter(TransInfo *t)
case V3D_CURSOR:
if(t->spacetype==SPACE_IMAGE)
calculateCenterCursor2D(t);
+ else if(t->spacetype==SPACE_IPO)
+ calculateCenterCursorGraph2D(t);
else
calculateCenterCursor(t);
break;