svn merge ^/trunk/blender -r49478:49498
authorCampbell Barton <ideasman42@gmail.com>
Thu, 2 Aug 2012 11:29:32 +0000 (11:29 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 2 Aug 2012 11:29:32 +0000 (11:29 +0000)
14 files changed:
build_files/buildbot/slave_pack.py
intern/smoke/intern/WAVELET_NOISE.h
release/scripts/startup/bl_ui/space_node.py
source/blender/avi/intern/avi.c
source/blender/blenkernel/BKE_node.h
source/blender/blenkernel/intern/node.c
source/blender/compositor/operations/COM_MathBaseOperation.cpp
source/blender/editors/space_node/node_add.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_group.c
source/blender/editors/space_node/node_intern.h
source/blender/editors/space_node/node_ops.c
source/blender/editors/space_node/node_relationships.c
source/blender/imbuf/intern/anim_movie.c

index 73c633d0c29cc2fed5c3857b4114521387f464f0..654efd72876064bc3a087fc2f4147b1aa11f913e 100644 (file)
@@ -55,11 +55,14 @@ if builder.find('scons') != -1:
             'WITHOUT_BF_INSTALL=True']
 
         config = None
+        bits = None
 
         if builder.endswith('linux_x86_64_scons'):
             config = 'user-config-x86_64.py'
+            bits = 64
         elif builder.endswith('linux_i386_scons'):
-            config = 'user-config-x86_64.py'
+            config = 'user-config-i686.py'
+            bits = 32
 
         if config is not None:
             config_fpath = os.path.join(config_dir, config)
@@ -69,7 +72,16 @@ if builder.find('scons') != -1:
         blenderplayer = os.path.join(install_dir, 'blenderplayer')
         subprocess.call(['strip', '--strip-all', blender, blenderplayer])
 
+        extra = '/' + os.path.join('home', 'sources', 'release-builder', 'extra')
+        mesalibs = os.path.join(extra, 'mesalibs' + str(bits) + '.tar.bz2')
+        software_gl = os.path.join(extra, 'blender-softwaregl')
+
+        os.system('tar -xpf %s -C %s' % (mesalibs, install_dir))
+        os.system('cp %s %s' % (software_gl, install_dir))
+        os.system('chmod 755 %s' % (os.path.join(install_dir, 'blender-softwaregl')))
+
         retcode = subprocess.call(['python', 'scons/scons.py'] + scons_options)
+
         sys.exit(retcode)
     else:
         if builder.find('win') != -1:
index 66dfb95d1436c9d3254960da53e4ebdaa366316d..4806c6a9fc1ece89b24ea385f7e4800634a905f5 100644 (file)
@@ -107,7 +107,7 @@ static void downsampleNeumann(const float *from, float *to, int n, int stride)
   // if these values are not local incorrect results are generated
   float downCoeffs[32] = { DOWNCOEFFS };
   const float *const aCoCenter= &downCoeffs[16];
-       for (int i = 0; i < n / 2; i++) {
+       for (int i = 0; i < ceil((float)n / 2); i++) {
                to[i * stride] = 0;
                for (int k = 2 * i - 16; k < 2 * i + 16; k++) { 
                        // handle boundary
index 419309068be8cdf034d4e128b5da20d98e233985..cad642045e90b600fa2d18b445317429bd1b33f0 100644 (file)
@@ -94,6 +94,10 @@ class NODE_HT_header(Header):
         if toolsettings.snap_node_element != 'INCREMENT':
             row.prop(toolsettings, "snap_target", text="")
 
+        row = layout.row(align=True)
+        row.operator("node.clipboard_copy", text="", icon='COPYDOWN')
+        row.operator("node.clipboard_paste", text="", icon='PASTEDOWN')
+
         layout.template_running_jobs()
 
 
index 1c79c9b4237d8a3109e4c5cf885d3268d4280d60..9d4704cf0f263db776e5e6b173cef55291f92e25 100644 (file)
@@ -970,7 +970,7 @@ AviError AVI_write_frame(AviMovie *movie, int frame_num, ...)
                if (movie->entries != NULL) {
                        temp = (AviIndexEntry *)MEM_reallocN(movie->entries, (frame_num + 1) * entry_size);
                        /* clear new bytes */
-                       memset(&temp[movie->index_entries], 0, ((frame_num + 1) - movie->index_entries) * entry_size);
+                       memset(&temp[movie->index_entries + 1], 0, (frame_num - movie->index_entries) * entry_size);
                }
                else {
                        temp = (AviIndexEntry *) MEM_callocN((frame_num + 1) * entry_size, "newidxentry");
index 173d428c3eb2b0eb802b3f865da8972c098eb67b..0b9aa7e4f644c218e00644bceb98182531555cc0 100644 (file)
@@ -384,6 +384,13 @@ void            nodeFreePreview(struct bNode *node);
 int             nodeSocketIsHidden(struct bNodeSocket *sock);
 void            nodeSocketSetType(struct bNodeSocket *sock, int type);
 
+/* Node Clipboard */
+void nodeClipboardClear(void);
+void nodeClipboardAddNode(struct bNode *node);
+void nodeClipboardAddLink(struct bNodeLink *link);
+const struct ListBase *nodeClipboardGetNodes(void);
+const struct ListBase *nodeClipboardGetLinks(void);
+
 /* ************** NODE TYPE ACCESS *************** */
 
 struct bNodeTemplate nodeMakeTemplate(struct bNode *node);
index e40796d0ea08b05f60180be687536b7823f6e3f7..afe0b9ec81f0f75c6297f5a80dfc60625456a3dd 100644 (file)
@@ -347,9 +347,12 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
        bNodeSocket *sock, *oldsock;
 
        *nnode = *node;
-       nodeUniqueName(ntree, nnode);
-       
-       BLI_addtail(&ntree->nodes, nnode);
+       /* can be called for nodes outside a node tree (e.g. clipboard) */
+       if (ntree) {
+               nodeUniqueName(ntree, nnode);
+
+               BLI_addtail(&ntree->nodes, nnode);
+       }
 
        BLI_duplicatelist(&nnode->inputs, &node->inputs);
        oldsock = node->inputs.first;
@@ -390,7 +393,8 @@ bNode *nodeCopyNode(struct bNodeTree *ntree, struct bNode *node)
        nnode->new_node = NULL;
        nnode->preview = NULL;
        
-       ntree->update |= NTREE_UPDATE_NODES;
+       if (ntree)
+               ntree->update |= NTREE_UPDATE_NODES;
        
        return nnode;
 }
@@ -417,7 +421,7 @@ bNodeLink *nodeAddLink(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock,
                                from = -1;  /* OK but flip */
                }
        }
-       else {
+       else if (ntree) {
                /* check tree sockets */
                for (sock = ntree->inputs.first; sock; sock = sock->next)
                        if (sock == fromsock)
@@ -446,7 +450,7 @@ bNodeLink *nodeAddLink(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock,
                                to = -1;  /* OK but flip */
                }
        }
-       else {
+       else if (ntree) {
                /* check tree sockets */
                for (sock = ntree->outputs.first; sock; sock = sock->next)
                        if (sock == tosock)
@@ -464,7 +468,8 @@ bNodeLink *nodeAddLink(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock,
        
        if (from >= 0 && to >= 0) {
                link = MEM_callocN(sizeof(bNodeLink), "link");
-               BLI_addtail(&ntree->links, link);
+               if (ntree)
+                       BLI_addtail(&ntree->links, link);
                link->fromnode = fromnode;
                link->fromsock = fromsock;
                link->tonode = tonode;
@@ -472,26 +477,32 @@ bNodeLink *nodeAddLink(bNodeTree *ntree, bNode *fromnode, bNodeSocket *fromsock,
        }
        else if (from <= 0 && to <= 0) {
                link = MEM_callocN(sizeof(bNodeLink), "link");
-               BLI_addtail(&ntree->links, link);
+               if (ntree)
+                       BLI_addtail(&ntree->links, link);
                link->fromnode = tonode;
                link->fromsock = tosock;
                link->tonode = fromnode;
                link->tosock = fromsock;
        }
        
-       ntree->update |= NTREE_UPDATE_LINKS;
+       if (ntree)
+               ntree->update |= NTREE_UPDATE_LINKS;
        
        return link;
 }
 
 void nodeRemLink(bNodeTree *ntree, bNodeLink *link)
 {
-       BLI_remlink(&ntree->links, link);
+       /* can be called for links outside a node tree (e.g. clipboard) */
+       if (ntree)
+               BLI_remlink(&ntree->links, link);
+
        if (link->tosock)
                link->tosock->link = NULL;
        MEM_freeN(link);
        
-       ntree->update |= NTREE_UPDATE_LINKS;
+       if (ntree)
+               ntree->update |= NTREE_UPDATE_LINKS;
 }
 
 void nodeRemSocketLinks(bNodeTree *ntree, bNodeSocket *sock)
@@ -885,20 +896,24 @@ static void node_unlink_attached(bNodeTree *ntree, bNode *parent)
 
 void nodeFreeNode(bNodeTree *ntree, bNode *node)
 {
-       bNodeTreeType *treetype = ntreeGetType(ntree->type);
        bNodeSocket *sock, *nextsock;
        
-       /* remove all references to this node */
-       nodeUnlinkNode(ntree, node);
-       node_unlink_attached(ntree, node);
-       
-       BLI_remlink(&ntree->nodes, node);
+       /* can be called for nodes outside a node tree (e.g. clipboard) */
+       if (ntree) {
+               bNodeTreeType *treetype = ntreeGetType(ntree->type);
+
+               /* remove all references to this node */
+               nodeUnlinkNode(ntree, node);
+               node_unlink_attached(ntree, node);
+
+               BLI_remlink(&ntree->nodes, node);
+
+               if (treetype->free_node_cache)
+                       treetype->free_node_cache(ntree, node);
+       }
        
        /* since it is called while free database, node->id is undefined */
        
-       if (treetype->free_node_cache)
-               treetype->free_node_cache(ntree, node);
-       
        if (node->typeinfo && node->typeinfo->freestoragefunc)
                node->typeinfo->freestoragefunc(node);
        
@@ -917,7 +932,8 @@ void nodeFreeNode(bNodeTree *ntree, bNode *node)
 
        MEM_freeN(node);
        
-       ntree->update |= NTREE_UPDATE_NODES;
+       if (ntree)
+               ntree->update |= NTREE_UPDATE_NODES;
 }
 
 /* do not free ntree itself here, BKE_libblock_free calls this function too */
@@ -1388,6 +1404,53 @@ void nodeSocketSetType(bNodeSocket *sock, int type)
        node_socket_free_default_value(old_type, old_default_value);
 }
 
+/* ************** Node Clipboard *********** */
+
+typedef struct bNodeClipboard {
+       ListBase nodes;
+       ListBase links;
+} bNodeClipboard;
+
+bNodeClipboard node_clipboard;
+
+void nodeClipboardClear(void)
+{
+       bNode *node, *node_next;
+       bNodeLink *link, *link_next;
+       
+       for (link = node_clipboard.links.first; link; link=link_next) {
+               link_next = link->next;
+               nodeRemLink(NULL, link);
+       }
+       node_clipboard.links.first = node_clipboard.links.last = NULL;
+       
+       for (node = node_clipboard.nodes.first; node; node=node_next) {
+               node_next = node->next;
+               nodeFreeNode(NULL, node);
+       }
+       node_clipboard.nodes.first = node_clipboard.nodes.last = NULL;
+}
+
+void nodeClipboardAddNode(bNode *node)
+{
+       BLI_addtail(&node_clipboard.nodes, node);
+}
+
+void nodeClipboardAddLink(bNodeLink *link)
+{
+       BLI_addtail(&node_clipboard.links, link);
+}
+
+const ListBase *nodeClipboardGetNodes(void)
+{
+       return &node_clipboard.nodes;
+}
+
+const ListBase *nodeClipboardGetLinks(void)
+{
+       return &node_clipboard.links;
+}
+
 /* ************** dependency stuff *********** */
 
 /* node is guaranteed to be not checked before */
@@ -2086,6 +2149,10 @@ static void free_typeinfos(ListBase *list)
 
 void init_nodesystem(void) 
 {
+       /* init clipboard */
+       node_clipboard.nodes.first = node_clipboard.nodes.last = NULL;
+       node_clipboard.links.first = node_clipboard.links.last = NULL;
+       
        registerCompositNodes(ntreeGetType(NTREE_COMPOSIT));
        registerShaderNodes(ntreeGetType(NTREE_SHADER));
        registerTextureNodes(ntreeGetType(NTREE_TEXTURE));
index 6c0c27c2522d7877b344bb5d7c1eafbf4b70b2e0..4644dce572db24980cf4b3094e28ead89805eb26 100644 (file)
@@ -32,6 +32,7 @@ MathBaseOperation::MathBaseOperation() : NodeOperation()
        this->addOutputSocket(COM_DT_VALUE);
        this->m_inputValue1Operation = NULL;
        this->m_inputValue2Operation = NULL;
+       this->m_useClamp = false;
 }
 
 void MathBaseOperation::initExecution()
index 5e58737606fd6c91882d88fa2d71c27808b7bfab..20429d832b570457bb6056770a6fe8e5667bf957 100644 (file)
  *  \ingroup spnode
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
 #include <errno.h>
 
-#include "MEM_guardedalloc.h"
-
-#include "DNA_ID.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
 #include "DNA_node_types.h"
-#include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_world_types.h"
-#include "DNA_action_types.h"
-#include "DNA_anim_types.h"
 
 #include "BLI_math.h"
-#include "BLI_blenlib.h"
-#include "BLI_utildefines.h"
 
-#include "BKE_action.h"
-#include "BKE_animsys.h"
 #include "BKE_context.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
 #include "BKE_image.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_node.h"
-#include "BKE_material.h"
-#include "BKE_modifier.h"
-#include "BKE_paint.h"
-#include "BKE_scene.h"
-#include "BKE_screen.h"
-#include "BKE_texture.h"
 #include "BKE_report.h"
 
-#include "RE_pipeline.h"
-
-#include "IMB_imbuf_types.h"
-
-#include "ED_node.h"
-#include "ED_image.h"
+#include "ED_node.h"  /* own include */
 #include "ED_screen.h"
-#include "ED_space_api.h"
 #include "ED_render.h"
 
 #include "RNA_access.h"
 #include "WM_api.h"
 #include "WM_types.h"
 
-#include "UI_interface.h"
-#include "UI_resources.h"
 #include "UI_view2d.h"
 
-#include "IMB_imbuf.h"
-
-#include "RNA_enum_types.h"
-
-#include "GPU_material.h"
-
-#include "node_intern.h"
-#include "NOD_socket.h"
-
+#include "node_intern.h"  /* own include */
 
 /* can be called from menus too, but they should do own undopush and redraws */
 bNode *node_add_node(SpaceNode *snode, Main *bmain, Scene *scene,
index 481c6544255d8bd6425ca9ab6e975d5723da438e..fa8fa13a6458c20b8c63be9623c30cde91383f70 100644 (file)
  *  \ingroup spnode
  */
 
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <errno.h>
-
 #include "MEM_guardedalloc.h"
 
-#include "DNA_ID.h"
 #include "DNA_lamp_types.h"
 #include "DNA_material_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_scene_types.h"
 #include "DNA_world_types.h"
-#include "DNA_action_types.h"
-#include "DNA_anim_types.h"
 
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
-#include "BLI_utildefines.h"
 
-#include "BKE_action.h"
-#include "BKE_animsys.h"
 #include "BKE_context.h"
 #include "BKE_depsgraph.h"
 #include "BKE_global.h"
 #include "BKE_main.h"
 #include "BKE_node.h"
 #include "BKE_material.h"
-#include "BKE_modifier.h"
 #include "BKE_paint.h"
 #include "BKE_scene.h"
 #include "BKE_screen.h"
 #include "BKE_texture.h"
-#include "BKE_report.h"
 
 #include "RE_pipeline.h"
 
 #include "IMB_imbuf_types.h"
 
-#include "ED_node.h"
+#include "ED_node.h"  /* own include */
 #include "ED_image.h"
 #include "ED_screen.h"
 #include "ED_space_api.h"
 
 #include "RNA_access.h"
 #include "RNA_define.h"
-#include "RNA_enum_types.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
 
-#include "UI_interface.h"
-#include "UI_resources.h"
 #include "UI_view2d.h"
 
 #include "IMB_imbuf.h"
 
-#include "RNA_enum_types.h"
 
 #include "GPU_material.h"
 
-#include "node_intern.h"
-#include "NOD_socket.h"
+#include "node_intern.h"  /* own include */
 
 /* ***************** composite job manager ********************** */
 
@@ -2237,3 +2215,156 @@ void NODE_OT_node_copy_color(wmOperatorType *ot)
        /* flags */
        ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
+
+/* ****************** Copy to clipboard ******************* */
+
+static int node_clipboard_copy_exec(bContext *C, wmOperator *UNUSED(op))
+{
+       SpaceNode *snode = CTX_wm_space_node(C);
+       bNodeTree *ntree = snode->edittree;
+       bNode *node, *newnode;
+       bNodeLink *link, *newlink;
+
+       ED_preview_kill_jobs(C);
+
+       /* clear current clipboard */
+       nodeClipboardClear();
+
+       for (node = ntree->nodes.first; node; node = node->next) {
+               if (node->flag & SELECT) {
+                       newnode = nodeCopyNode(NULL, node);
+                       nodeClipboardAddNode(newnode);
+               }
+       }
+
+       /* copy links between selected nodes
+        * NB: this depends on correct node->new_node and sock->new_sock pointers from above copy!
+        */
+       for (link = ntree->links.first; link; link = link->next) {
+               /* This creates new links between copied nodes. */
+               if (link->tonode && (link->tonode->flag & NODE_SELECT) &&
+                   link->fromnode && (link->fromnode->flag & NODE_SELECT))
+               {
+                       newlink = MEM_callocN(sizeof(bNodeLink), "bNodeLink");
+                       newlink->flag = link->flag;
+                       newlink->tonode = link->tonode->new_node;
+                       newlink->tosock = link->tosock->new_sock;
+                       newlink->fromnode = link->fromnode->new_node;
+                       newlink->fromsock = link->fromsock->new_sock;
+
+                       nodeClipboardAddLink(newlink);
+               }
+       }
+
+       /* reparent copied nodes */
+       for (node = ntree->nodes.first; node; node = node->next) {
+               if ((node->flag & SELECT) && node->parent) {
+                       if (node->parent->flag & SELECT)
+                               node->parent = node->parent->new_node;
+                       else
+                               node->parent = NULL;
+               }
+       }
+
+       return OPERATOR_FINISHED;
+}
+
+void NODE_OT_clipboard_copy(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name = "Copy to clipboard";
+       ot->description = "Copies selected nodes to the clipboard";
+       ot->idname = "NODE_OT_clipboard_copy";
+
+       /* api callbacks */
+       ot->exec = node_clipboard_copy_exec;
+       ot->poll = ED_operator_node_active;
+
+       /* flags */
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
+}
+
+/* ****************** Paste from clipboard ******************* */
+
+static int node_clipboard_paste_exec(bContext *C, wmOperator *UNUSED(op))
+{
+       SpaceNode *snode = CTX_wm_space_node(C);
+       bNodeTree *ntree = snode->edittree;
+       bNode *node;
+       bNodeLink *link;
+       int num_nodes;
+       float centerx, centery;
+
+       ED_preview_kill_jobs(C);
+
+       /* deselect old nodes */
+       node_deselect_all(snode);
+
+       /* calculate "barycenter" for placing on mouse cursor */
+       num_nodes = 0;
+       centerx = centery = 0.0f;
+       for (node = nodeClipboardGetNodes()->first; node; node = node->next) {
+               ++num_nodes;
+               centerx += node->locx + 0.5f * node->width;
+               centery += node->locy - 0.5f * node->height;
+       }
+       centerx /= num_nodes;
+       centery /= num_nodes;
+
+       /* copy nodes from clipboard */
+       for (node = nodeClipboardGetNodes()->first; node; node = node->next) {
+               bNode *newnode = nodeCopyNode(ntree, node);
+
+               /* pasted nodes are selected */
+               node_select(newnode);
+
+               /* place nodes around the mouse cursor */
+               newnode->locx += snode->mx - centerx;
+               newnode->locy += snode->my - centery;
+       }
+
+       for (link = nodeClipboardGetLinks()->first; link; link = link->next) {
+               nodeAddLink(ntree, link->fromnode->new_node, link->fromsock->new_sock,
+                           link->tonode->new_node, link->tosock->new_sock);
+       }
+
+       /* reparent copied nodes */
+       for (node = nodeClipboardGetNodes()->first; node; node = node->next) {
+               if (node->new_node->parent)
+                       node->new_node->parent = node->new_node->parent->new_node;
+       }
+
+       ntreeUpdateTree(snode->edittree);
+
+       snode_notify(C, snode);
+       snode_dag_update(C, snode);
+
+       return OPERATOR_FINISHED;
+}
+
+static int node_clipboard_paste_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+       ARegion *ar = CTX_wm_region(C);
+       SpaceNode *snode = CTX_wm_space_node(C);
+
+       /* convert mouse coordinates to v2d space */
+       UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &snode->mx, &snode->my);
+
+       return node_clipboard_paste_exec(C, op);
+}
+
+void NODE_OT_clipboard_paste(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name = "Paste from clipboard";
+       ot->description = "Pastes nodes from the clipboard to the active node tree";
+       ot->idname = "NODE_OT_clipboard_paste";
+
+       /* api callbacks */
+       ot->exec = node_clipboard_paste_exec;
+       ot->invoke = node_clipboard_paste_invoke;
+       ot->poll = ED_operator_node_active;
+
+       /* flags */
+       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+}
index 41924d926d215f5279eb4b869995df95df37eba1..7d3c9ce6b5bd506ee6e0d01b540588e970dd0f70 100644 (file)
  *  \ingroup spnode
  */
 
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <errno.h>
-
 #include "MEM_guardedalloc.h"
 
-#include "DNA_ID.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_world_types.h"
-#include "DNA_action_types.h"
 #include "DNA_anim_types.h"
 
-#include "BLI_math.h"
 #include "BLI_blenlib.h"
-#include "BLI_utildefines.h"
 
 #include "BKE_action.h"
 #include "BKE_animsys.h"
 #include "BKE_context.h"
-#include "BKE_depsgraph.h"
 #include "BKE_global.h"
-#include "BKE_image.h"
 #include "BKE_library.h"
 #include "BKE_main.h"
-#include "BKE_node.h"
-#include "BKE_material.h"
-#include "BKE_modifier.h"
-#include "BKE_paint.h"
-#include "BKE_scene.h"
-#include "BKE_screen.h"
-#include "BKE_texture.h"
 #include "BKE_report.h"
 
-#include "RE_pipeline.h"
-
-#include "IMB_imbuf_types.h"
-
-#include "ED_node.h"
-#include "ED_image.h"
+#include "ED_node.h"  /* own include */
 #include "ED_screen.h"
-#include "ED_space_api.h"
 #include "ED_render.h"
 
 #include "RNA_access.h"
 #include "WM_api.h"
 #include "WM_types.h"
 
-#include "UI_interface.h"
 #include "UI_resources.h"
-#include "UI_view2d.h"
-
-#include "IMB_imbuf.h"
-
-#include "RNA_enum_types.h"
-
-#include "GPU_material.h"
 
-#include "node_intern.h"
+#include "node_intern.h"  /* own include */
 #include "NOD_socket.h"
 
 static EnumPropertyItem socket_in_out_items[] = {
index 1d83215c1f992c701fb9c92ed1f5a0c512e359d0..8a85e833537909397b0354a9beb2188e697078bd 100644 (file)
@@ -200,6 +200,10 @@ void NODE_OT_output_file_add_socket(struct wmOperatorType *ot);
 void NODE_OT_output_file_remove_active_socket(struct wmOperatorType *ot);
 void NODE_OT_output_file_move_active_socket(struct wmOperatorType *ot);
 
+/* Note: clipboard_cut is a simple macro of copy + delete */
+void NODE_OT_clipboard_copy(struct wmOperatorType *ot);
+void NODE_OT_clipboard_paste(struct wmOperatorType *ot);
+
 extern const char *node_context_dir[];
 
 // XXXXXX
index 0ce72848c568968544cf67ac9dfa4ce21033f8b4..2efeebbfc75641001e6373f58b09864d3ba148dd 100644 (file)
@@ -113,6 +113,9 @@ void node_operatortypes(void)
        WM_operatortype_append(NODE_OT_join);
        WM_operatortype_append(NODE_OT_attach);
        WM_operatortype_append(NODE_OT_detach);
+       
+       WM_operatortype_append(NODE_OT_clipboard_copy);
+       WM_operatortype_append(NODE_OT_clipboard_paste);
 }
 
 void ED_operatormacros_node(void)
@@ -281,5 +284,8 @@ void node_keymap(struct wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "NODE_OT_read_fullsamplelayers", RKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "NODE_OT_render_changed", ZKEY, KM_PRESS, 0, 0);
        
+       WM_keymap_add_item(keymap, "NODE_OT_clipboard_copy", CKEY, KM_PRESS, KM_CTRL, 0);
+       WM_keymap_add_item(keymap, "NODE_OT_clipboard_paste", VKEY, KM_PRESS, KM_CTRL, 0);
+       
        transform_keymap_for_space(keyconf, keymap, SPACE_NODE);
 }
index 4fcc2abece4d26550785af7ba3a574c6a72ce319..cda736d199a5f1d53294330c7a1779ff66dec12c 100644 (file)
  *  \ingroup spnode
  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-#include <errno.h>
-
 #include "MEM_guardedalloc.h"
 
-#include "DNA_ID.h"
-#include "DNA_lamp_types.h"
-#include "DNA_material_types.h"
 #include "DNA_node_types.h"
 #include "DNA_object_types.h"
-#include "DNA_particle_types.h"
-#include "DNA_scene_types.h"
-#include "DNA_world_types.h"
-#include "DNA_action_types.h"
-#include "DNA_anim_types.h"
 
 #include "BLI_math.h"
 #include "BLI_blenlib.h"
-#include "BLI_utildefines.h"
 
-#include "BKE_action.h"
-#include "BKE_animsys.h"
 #include "BKE_context.h"
-#include "BKE_depsgraph.h"
-#include "BKE_global.h"
-#include "BKE_image.h"
-#include "BKE_library.h"
 #include "BKE_main.h"
 #include "BKE_node.h"
-#include "BKE_material.h"
-#include "BKE_modifier.h"
-#include "BKE_paint.h"
-#include "BKE_scene.h"
-#include "BKE_screen.h"
-#include "BKE_texture.h"
-#include "BKE_report.h"
-
-#include "RE_pipeline.h"
 
-#include "IMB_imbuf_types.h"
-
-#include "ED_node.h"
-#include "ED_image.h"
+#include "ED_node.h"  /* own include */
 #include "ED_screen.h"
-#include "ED_space_api.h"
 #include "ED_render.h"
 
 #include "RNA_access.h"
 #include "RNA_define.h"
-#include "RNA_enum_types.h"
 
 #include "WM_api.h"
 #include "WM_types.h"
 
-#include "UI_interface.h"
-#include "UI_resources.h"
 #include "UI_view2d.h"
 
-#include "IMB_imbuf.h"
-
-#include "RNA_enum_types.h"
-
-#include "GPU_material.h"
-
-#include "node_intern.h"
-#include "NOD_socket.h"
-
+#include "node_intern.h"  /* own include */
 
 /* ****************** Add *********************** */
 
index a27aae815da09e89afb50dc5228d12de79777e5a..9367511522d681c1c0396e80ac5613c4a4b7a9b9 100644 (file)
@@ -394,7 +394,9 @@ static ImBuf *avi_fetchibuf(struct anim *anim, int position)
        int *tmp;
        int y;
        
-       if (anim == NULL) return (NULL);
+       if (anim == NULL) {
+               return NULL;
+       }
 
 #if defined(_WIN32) && !defined(FREE_WINDOWS)
        if (anim->avistreams) {
@@ -418,7 +420,7 @@ static ImBuf *avi_fetchibuf(struct anim *anim, int position)
                                     AVI_get_stream(anim->avi, AVIST_VIDEO, 0));
                
                if (tmp == NULL) {
-                       printf("Error reading frame from AVI");
+                       printf("Error reading frame from AVI: '%s'\n", anim->name);
                        IMB_freeImBuf(ibuf);
                        return NULL;
                }