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>2010-03-19 06:38:14 +0300
committerJoshua Leung <aligorith@gmail.com>2010-03-19 06:38:14 +0300
commitd89a8c34f3dc1a2923b6853c260de4f1deab9466 (patch)
tree80be2699ae83bf2a4c4c5bca43ccdc8e252337db /source/blender/editors
parent5e7b1bde8d35676bbb5a88f62821ed6689d0761b (diff)
More F-Modifier Tweaks:
This commit started out aiming to make the "Stepped" F-Modifier (committed last night) even more useful, but ended up fixing a few other finer-points of how F-Modifiers work. Firstly, the new stuff: I've addded options to the Stepped F-Modifier to not affect frames before and/or after specified values, and renamed the 'start offset' to 'offset' for clarity. The main objective of this is to allow Stepped F-Modifiers to only affect certain time ranges, so that by layering/using multiple instances of the F-Modifier, it can be possible to have multiple stepping-sizes. This allows for effects like: http://www.pasteall.org/blend/2230 or in words, it provides a convenient mechanism for animators to specify whether sections of the animation is shown "on twos", "fours", or even "forty-second-ths plus a smidgen", as can be easily done with 2D. Assorted changes to support this: * Properly fixed up how F-Modifiers that work with time, evaluate the time to evaluate the curve at. Now layered time effects like this should be possible in a much nicer way. * Added proper value range validation/clamping to many properties. There are still a lot more that need checking, but at least more properties now do "the right thing".
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c64
1 files changed, 41 insertions, 23 deletions
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 22bb5317383..06a4a2f980b 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -42,6 +42,8 @@
#include "MEM_guardedalloc.h"
+#include "BLI_blenlib.h"
+
#include "BKE_context.h"
#include "BKE_fcurve.h"
@@ -252,15 +254,15 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor
/* before range */
col= uiLayoutColumn(split, 1);
- uiItemL(col, "Before:", 0);
- uiItemR(col, "", 0, &ptr, "before_mode", 0);
- uiItemR(col, NULL, 0, &ptr, "before_cycles", 0);
+ uiItemL(col, "Before:", 0);
+ uiItemR(col, "", 0, &ptr, "before_mode", 0);
+ uiItemR(col, NULL, 0, &ptr, "before_cycles", 0);
/* after range */
col= uiLayoutColumn(split, 1);
- uiItemL(col, "After:", 0);
- uiItemR(col, "", 0, &ptr, "after_mode", 0);
- uiItemR(col, NULL, 0, &ptr, "after_cycles", 0);
+ uiItemL(col, "After:", 0);
+ uiItemR(col, "", 0, &ptr, "after_mode", 0);
+ uiItemR(col, NULL, 0, &ptr, "after_cycles", 0);
}
/* --------------- */
@@ -282,13 +284,13 @@ static void draw_modifier__noise(uiLayout *layout, ID *id, FModifier *fcm, short
/* col 1 */
col= uiLayoutColumn(split, 0);
- uiItemR(col, NULL, 0, &ptr, "size", 0);
- uiItemR(col, NULL, 0, &ptr, "strength", 0);
+ uiItemR(col, NULL, 0, &ptr, "size", 0);
+ uiItemR(col, NULL, 0, &ptr, "strength", 0);
/* col 2 */
col= uiLayoutColumn(split, 0);
- uiItemR(col, NULL, 0, &ptr, "phase", 0);
- uiItemR(col, NULL, 0, &ptr, "depth", 0);
+ uiItemR(col, NULL, 0, &ptr, "phase", 0);
+ uiItemR(col, NULL, 0, &ptr, "depth", 0);
}
/* --------------- */
@@ -525,16 +527,16 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* x-minimum */
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0);
- uiItemR(col, NULL, 0, &ptr, "minimum_x", 0);
+ uiItemR(col, NULL, 0, &ptr, "use_minimum_x", 0);
+ uiItemR(col, NULL, 0, &ptr, "minimum_x", 0);
/* y-minimum*/
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0);
- uiItemR(col, NULL, 0, &ptr, "minimum_y", 0);
+ uiItemR(col, NULL, 0, &ptr, "use_minimum_y", 0);
+ uiItemR(col, NULL, 0, &ptr, "minimum_y", 0);
}
- /* row 2: minimum */
+ /* row 2: maximum */
{
row= uiLayoutRow(layout, 0);
@@ -543,13 +545,13 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* x-minimum */
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0);
- uiItemR(col, NULL, 0, &ptr, "maximum_x", 0);
+ uiItemR(col, NULL, 0, &ptr, "use_maximum_x", 0);
+ uiItemR(col, NULL, 0, &ptr, "maximum_x", 0);
/* y-minimum*/
col= uiLayoutColumn(split, 1);
- uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0);
- uiItemR(col, NULL, 0, &ptr, "maximum_y", 0);
+ uiItemR(col, NULL, 0, &ptr, "use_maximum_y", 0);
+ uiItemR(col, NULL, 0, &ptr, "maximum_y", 0);
}
}
@@ -558,16 +560,32 @@ static void draw_modifier__limits(uiLayout *layout, ID *id, FModifier *fcm, shor
/* draw settings for stepped interpolation modifier */
static void draw_modifier__stepped(uiLayout *layout, ID *id, FModifier *fcm, short width)
{
- uiLayout *col;
+ uiLayout *col, *subcol;
PointerRNA ptr;
/* init the RNA-pointer */
RNA_pointer_create(id, &RNA_FModifierStepped, fcm, &ptr);
+ /* block 1: "stepping" settings */
col= uiLayoutColumn(layout, 0);
-
- uiItemR(col, NULL, 0, &ptr, "step_size", 0);
- uiItemR(col, NULL, 0, &ptr, "start_offset", 0);
+ uiItemR(col, NULL, 0, &ptr, "step_size", 0);
+ uiItemR(col, NULL, 0, &ptr, "offset", 0);
+
+ /* block 2: start range settings */
+ col= uiLayoutColumn(layout, 1);
+ uiItemR(col, NULL, 0, &ptr, "use_start_frame", 0);
+
+ subcol = uiLayoutColumn(col, 1);
+ uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_start_frame"));
+ uiItemR(subcol, NULL, 0, &ptr, "start_frame", 0);
+
+ /* block 3: end range settings */
+ col= uiLayoutColumn(layout, 1);
+ uiItemR(col, NULL, 0, &ptr, "use_end_frame", 0);
+
+ subcol = uiLayoutColumn(col, 1);
+ uiLayoutSetActive(subcol, RNA_boolean_get(&ptr, "use_end_frame"));
+ uiItemR(subcol, NULL, 0, &ptr, "end_frame", 0);
}
/* --------------- */