Revision: 48803
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48803
Author:   nazgul
Date:     2012-07-10 13:24:29 +0000 (Tue, 10 Jul 2012)
Log Message:
-----------
Merging r48794 through r48802 from trunk into soc-2011-tomato

Revision Links:
--------------
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48794
    
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48802

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/compositor/COM_compositor.h
    branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.h
    
branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkScheduler.cpp
    branches/soc-2011-tomato/source/blender/editors/space_node/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/editors/space_node/SConscript
    branches/soc-2011-tomato/source/blender/editors/space_node/node_draw.c
    branches/soc-2011-tomato/source/blender/editors/space_node/node_edit.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_node_types.h
    
branches/soc-2011-tomato/source/blender/nodes/composite/node_composite_tree.c

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-48793
   + 
/branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-48802

Modified: branches/soc-2011-tomato/source/blender/compositor/COM_compositor.h
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/COM_compositor.h 
2012-07-10 12:57:09 UTC (rev 48802)
+++ branches/soc-2011-tomato/source/blender/compositor/COM_compositor.h 
2012-07-10 13:24:29 UTC (rev 48803)
@@ -299,6 +299,19 @@
  */
 void COM_execute(RenderData* rd, bNodeTree *editingtree, int rendering);
 
+/**
+ * @brief Return a list of highlighted bnodes pointers.
+ * @return 
+ */
+void COM_startReadHighlights(void);
+
+/**
+ * @brief check if a bnode is highlighted
+ * @param bnode
+ * @return 
+ */
+int COM_isHighlightedbNode(bNode* bnode);
+
 #ifdef __cplusplus
 }
 #endif

Modified: 
branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.h
===================================================================
--- 
branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.h    
    2012-07-10 12:57:09 UTC (rev 48802)
+++ 
branches/soc-2011-tomato/source/blender/compositor/intern/COM_MemoryBuffer.h    
    2012-07-10 13:24:29 UTC (rev 48803)
@@ -28,11 +28,11 @@
 #include "COM_ExecutionGroup.h"
 #include "BLI_rect.h"
 #include "COM_MemoryProxy.h"
-#include "BLI_math.h"
 
-//extern "C" {
-//     #include "BLI_threads.h"
-//}
+extern "C" {
+       //#include "BLI_threads.h"
+       #include "BLI_math.h"
+}
 //#include <vector>
 
 /**

Modified: 
branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkScheduler.cpp
===================================================================
--- 
branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkScheduler.cpp 
    2012-07-10 12:57:09 UTC (rev 48802)
+++ 
branches/soc-2011-tomato/source/blender/compositor/intern/COM_WorkScheduler.cpp 
    2012-07-10 13:24:29 UTC (rev 48803)
@@ -66,6 +66,12 @@
 #endif
 #endif
 
+#define MAX_HIGHLIGHT 8
+extern "C" {
+int g_highlightIndex;
+void ** g_highlightedNodes;
+void ** g_highlightedNodesRead;
+
 #define HIGHLIGHT(wp) \
 { \
        ExecutionGroup* group = wp->getExecutionGroup(); \
@@ -77,15 +83,39 @@
                        bNode *node = complexOperation->getbNode(); \
                        if (node) { \
                                if (node->original) { \
-                                       node->original->highlight = 1;\
-                               } else {\
-                                       node->highlight = 1; \
+                                       node = node->original;\
                                }\
+                               if (g_highlightIndex < MAX_HIGHLIGHT) {\
+                                       g_highlightedNodes[g_highlightIndex++] 
= node;\
+                               }\
                        } \
                } \
        } \
 }
+void COM_startReadHighlights() {
+       if (g_highlightedNodesRead) {
+               delete g_highlightedNodesRead;
+       }
+       
+       g_highlightedNodesRead = g_highlightedNodes;
+       g_highlightedNodes = new void*[MAX_HIGHLIGHT];
+       g_highlightIndex = 0;
+       for (int i = 0 ; i < MAX_HIGHLIGHT; i++) {
+               g_highlightedNodes[i] = 0;
+       }
+}
 
+int COM_isHighlightedbNode(bNode* bnode) {
+       if (!g_highlightedNodesRead) return false;
+       for (int i = 0 ; i < MAX_HIGHLIGHT; i++) {
+               void* p = g_highlightedNodesRead[i];
+               if (!p) return false;
+               if (p == bnode) return true;
+       }
+       return false;
+}
+} // end extern "C"
+
 #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
 void *WorkScheduler::thread_execute_cpu(void *data)
 {
@@ -219,6 +249,9 @@
 
 void WorkScheduler::initialize()
 {
+       g_highlightedNodesRead = 0;
+       g_highlightedNodes = 0;
+       COM_startReadHighlights();
 #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
        int numberOfCPUThreads = BLI_system_thread_count();
 
@@ -313,3 +346,4 @@
 #endif
 #endif
 }
+


Property changes on: 
branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-48793
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-48802

Modified: 
branches/soc-2011-tomato/source/blender/editors/space_node/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_node/CMakeLists.txt   
2012-07-10 12:57:09 UTC (rev 48802)
+++ branches/soc-2011-tomato/source/blender/editors/space_node/CMakeLists.txt   
2012-07-10 13:24:29 UTC (rev 48803)
@@ -31,6 +31,7 @@
        ../../nodes
        ../../render/extern/include
        ../../windowmanager
+       ../../compositor
        ../../../../intern/guardedalloc
        ../../../../intern/opennl/extern
 )

Modified: branches/soc-2011-tomato/source/blender/editors/space_node/SConscript
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_node/SConscript       
2012-07-10 12:57:09 UTC (rev 48802)
+++ branches/soc-2011-tomato/source/blender/editors/space_node/SConscript       
2012-07-10 13:24:29 UTC (rev 48803)
@@ -4,7 +4,7 @@
 sources = env.Glob('*.c')
 
 incs = '../include ../../blenfont ../../blenlib ../../blenkernel 
../../makesdna ../../makesrna ../../imbuf'
-incs += ' ../../nodes ../../render/extern/include ../../blenloader ../../gpu'
+incs += ' ../../nodes ../../render/extern/include ../../blenloader ../../gpu 
../../compositor'
 incs += ' ../../windowmanager #intern/guardedalloc #extern/glew/include'
 defs = []
 cf = []

Modified: branches/soc-2011-tomato/source/blender/editors/space_node/node_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_node/node_draw.c      
2012-07-10 12:57:09 UTC (rev 48802)
+++ branches/soc-2011-tomato/source/blender/editors/space_node/node_draw.c      
2012-07-10 13:24:29 UTC (rev 48803)
@@ -80,6 +80,7 @@
 #include "intern/node_util.h"
 
 #include "node_intern.h"
+#include "COM_compositor.h"
 
 /* width of socket columns in group display */
 #define NODE_GROUP_FRAME  120
@@ -726,9 +727,8 @@
                UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
 
        if (ntree->type == NTREE_COMPOSIT && (snode->flag & 
SNODE_SHOW_HIGHLIGHT)) {
-               if (node->highlight) {
+               if (COM_isHighlightedbNode(node)) {
                        UI_ThemeColorBlend(color_id, TH_ACTIVE, 0.5f);
-                       node->highlight = 0;
                }
        }
        uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
@@ -893,9 +893,8 @@
                UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
 
        if (ntree->type == NTREE_COMPOSIT && (snode->flag & 
SNODE_SHOW_HIGHLIGHT)) {
-               if (node->highlight) {
+               if (COM_isHighlightedbNode(node)) {
                        UI_ThemeColorBlend(color_id, TH_ACTIVE, 0.5f);
-                       node->highlight = 0;
                }
        }
        
@@ -1131,6 +1130,7 @@
        
        if (snode->nodetree) {
                bNode *node;
+               /* void** highlights = 0; */ /* UNUSED */
                
                node_uiblocks_init(C, snode->nodetree);
                
@@ -1143,6 +1143,9 @@
                }
                
                node_update_nodetree(C, snode->nodetree, 0.0f, 0.0f);
+               if (snode->nodetree->type == NTREE_COMPOSIT) {
+                       COM_startReadHighlights();
+               } 
                node_draw_nodetree(C, ar, snode, snode->nodetree);
                
                #if 0

Modified: branches/soc-2011-tomato/source/blender/editors/space_node/node_edit.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_node/node_edit.c      
2012-07-10 12:57:09 UTC (rev 48802)
+++ branches/soc-2011-tomato/source/blender/editors/space_node/node_edit.c      
2012-07-10 13:24:29 UTC (rev 48803)
@@ -1157,6 +1157,9 @@
                BLI_remlink(&wgroup->nodes, node);
                BLI_addtail(&ntree->nodes, node);
                
+               /* ensure unique node name in the nodee tree */
+               nodeUniqueName(ntree, node);
+               
                node->locx += gnode->locx;
                node->locy += gnode->locy;
                
@@ -1370,6 +1373,9 @@
                BLI_remlink(&ngroup->nodes, newnode);
                BLI_addtail(&ntree->nodes, newnode);
                
+               /* ensure unique node name in the node tree */
+               nodeUniqueName(ntree, newnode);
+               
                newnode->locx += gnode->locx;
                newnode->locy += gnode->locy;
        }
@@ -3710,11 +3716,14 @@
                        BLI_remlink(&ntree->nodes, node);
                        BLI_addtail(&ngroup->nodes, node);
                        
+                       /* ensure unique node name in the ngroup */
+                       nodeUniqueName(ngroup, node);
+                       
                        node->locx -= 0.5f * (min[0] + max[0]);
                        node->locy -= 0.5f * (min[1] + max[1]);
                }
        }
-
+       
        /* move animation data over */
        if (ntree->adt) {
                LinkData *ld, *ldn = NULL;


Property changes on: 
branches/soc-2011-tomato/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
   - 
/branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-48793
   + 
/branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845

@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to