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:
authorAntony Riakiotakis <kalast@gmail.com>2015-03-27 17:23:39 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-03-31 17:45:30 +0300
commit66a028a5761c44fa37963443c78bd7baf04ff551 (patch)
tree0431b7d81d6ac74fd3e44d637ef000a8c311f453 /source/blender/editors/transform/transform_constraints.c
parent41f9cdc955d82bcf25abc86942f7bb9c98084db4 (diff)
Proportional editing for IPO editor - version ready for feedback by artists.
This works by using the distance in the x axis only (usually artists want to influence nearby keyframes based on timing, not value). Tweaking handles is the same as tweaking the central handle. It's a bit ambiguous if proportional editing is really meaningful for handles but will leave that for artists to decide.
Diffstat (limited to 'source/blender/editors/transform/transform_constraints.c')
-rw-r--r--source/blender/editors/transform/transform_constraints.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c
index ccb81c7342b..bcd66f56c53 100644
--- a/source/blender/editors/transform/transform_constraints.c
+++ b/source/blender/editors/transform/transform_constraints.c
@@ -46,6 +46,7 @@
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_string.h"
+#include "BLI_rect.h"
#include "BKE_context.h"
@@ -757,12 +758,22 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
ED_space_image_get_aspect(t->sa->spacedata.first, &aspx, &aspy);
}
else if (t->options & CTX_PAINT_CURVE) {
- aspx = aspy = 1.0;
+ aspx = aspy = 1.0f;
}
else {
ED_space_image_get_uv_aspect(t->sa->spacedata.first, &aspx, &aspy);
}
- glScalef(1.0f / aspx, 1.0f / aspy, 1.0);
+ glScalef(1.0f / aspx, 1.0f / aspy, 1.0f);
+ }
+ else if (t->spacetype == SPACE_IPO) {
+ /* only scale y */
+ rcti *mask = &t->ar->v2d.mask;
+ rctf *datamask = &t->ar->v2d.cur;
+ float xsize = BLI_rctf_size_x(datamask);
+ float ysize = BLI_rctf_size_y(datamask);
+ float xmask = BLI_rcti_size_x(mask);
+ float ymask = BLI_rcti_size_y(mask);
+ glScalef(1.0f, (ysize / xsize) * (xmask / ymask), 1.0f);
}
depth_test_enabled = glIsEnabled(GL_DEPTH_TEST);