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:
authorTon Roosendaal <ton@blender.org>2006-11-24 19:56:02 +0300
committerTon Roosendaal <ton@blender.org>2006-11-24 19:56:02 +0300
commitc3adb61dcc6b550efa1df0eb5c8a4729bd47350a (patch)
tree3213f421a1f78581b03d00f3b79c541676d3f75a /source/blender/src/editnode.c
parente600fdb882aaa39949c920a13df5ec0281075da2 (diff)
Composite Time node usablity improvement:
- now draws green 'current frame' line - when Time Node is active, hotkey I will allow inserting a value on current frame.
Diffstat (limited to 'source/blender/src/editnode.c')
-rw-r--r--source/blender/src/editnode.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/src/editnode.c b/source/blender/src/editnode.c
index 9f37248783e..1d290644148 100644
--- a/source/blender/src/editnode.c
+++ b/source/blender/src/editnode.c
@@ -35,6 +35,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_action_types.h"
+#include "DNA_color_types.h"
#include "DNA_image_types.h"
#include "DNA_ipo_types.h"
#include "DNA_object_types.h"
@@ -45,6 +46,7 @@
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
+#include "BKE_colortools.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_library.h"
@@ -1674,7 +1676,30 @@ void node_hide(SpaceNode *snode)
BIF_undo_push("Hide nodes");
allqueue(REDRAWNODE, 1);
}
+
+void node_insert_key(SpaceNode *snode)
+{
+ bNode *node= editnode_get_active(snode->edittree);
+
+ if(node->type==CMP_NODE_TIME) {
+ if(node->custom1<node->custom2) {
+
+ CurveMapping *cumap= node->storage;
+ float fval, curval;
+
+ curval= (float)(CFRA - node->custom1)/(float)(node->custom2-node->custom1);
+ fval= curvemapping_evaluateF(cumap, 0, curval);
+ if(fbutton(&fval, 0.0f, 1.0f, 10, 10, "Insert Value")) {
+ curvemap_insert(cumap->cm, curval, fval);
+
+ BIF_undo_push("Insert key in Time node");
+ allqueue(REDRAWNODE, 1);
+ }
+ }
+ }
+}
+
static void node_border_link_delete(SpaceNode *snode)
{
@@ -1998,6 +2023,9 @@ void winqreadnodespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case HKEY:
node_hide(snode);
break;
+ case IKEY:
+ node_insert_key(snode);
+ break;
case RKEY:
if(okee("Read saved Render Layers"))
node_read_renderlayers(snode);