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-07-02 16:41:03 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-02 16:41:03 +0400
commit441bcaae2e63d3f757ee336fb051a9cb851e3e33 (patch)
tree31ef5e997b3dcfd56994386a22cb628b7775b5ae /source/blender/editors/space_graph
parent6b784a80f02deaca05e347dc2626dc92826f0944 (diff)
NLA SoC: FModifier drawing converted to use Layout Engine
* Most of the F-Modifiers have been ported to use the layout engine + RNA for drawing their buttons now. This plays much nicer with various button-layouts. --> As a nice demo, try adding a Noise Modifier to a NLA-strip, and change the 'size' setting to about 2 to see some effects. * Generator and Envelope modifiers haven't been ported yet since they're quite complex (requiring more time + energy), and as such, have been made to have some temporary error prints instead. Will check on this tomorrow. * Finished/cleaned up the RNA-wrapping of most FModifiers. TODO's (help requested... Brecht?): Generator modifier's UI cannot be wrapped yet using the layout engine (though I might try using the old system only), as I'm having some trouble wrapping the coefficients array for this (see rna_fcurve.c - rna_def_fmodifier_generator())
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 5616ffc8002..17bc78f9ee6 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -366,22 +366,30 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa)
bAnimListElem *ale;
FCurve *fcu;
FModifier *fcm;
+ uiLayout *col, *row;
uiBlock *block;
- int yco= 190;
- if(!graph_panel_context(C, &ale, &fcu))
+ if (!graph_panel_context(C, &ale, &fcu))
return;
- block= uiLayoutFreeBlock(pa->layout);
+ block= uiLayoutGetBlock(pa->layout);
uiBlockSetHandleFunc(block, do_graph_region_modifier_buttons, NULL);
/* 'add modifier' button at top of panel */
- // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator
- uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 225, 150, 20, "Adds a new F-Curve Modifier for the active F-Curve");
+ {
+ row= uiLayoutRow(pa->layout, 0);
+ block= uiLayoutGetBlock(row);
+
+ // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator
+ uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, "Add Modifier", 10, 0, 150, 20, "Adds a new F-Curve Modifier for the active F-Curve");
+ }
/* draw each modifier */
- for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next)
- ANIM_uiTemplate_fmodifier_draw(block, &fcu->modifiers, fcm, &yco);
+ for (fcm= fcu->modifiers.first; fcm; fcm= fcm->next) {
+ col= uiLayoutColumn(pa->layout, 1);
+
+ ANIM_uiTemplate_fmodifier_draw(col, &fcu->modifiers, fcm);
+ }
MEM_freeN(ale);
}