relay the original node to a different place holder to resolve some
authorJeroen Bakker <j.bakker@atmind.nl>
Wed, 4 Jul 2012 12:30:17 +0000 (12:30 +0000)
committerJeroen Bakker <j.bakker@atmind.nl>
Wed, 4 Jul 2012 12:30:17 +0000 (12:30 +0000)
crashes.

source/blender/compositor/nodes/COM_BilateralBlurNode.cpp
source/blender/compositor/operations/COM_WriteBufferOperation.cpp
source/blender/makesdna/DNA_node_types.h
source/blender/nodes/composite/node_composite_tree.c

index f96a92068f40c16567be9529b5bb5d4ec568bf4f..683093302c19567f4329a0dab12dfd8abedf89b2 100644 (file)
@@ -35,6 +35,7 @@ void BilateralBlurNode::convertToOperations(ExecutionSystem *graph, CompositorCo
 {
        NodeBilateralBlurData *data = (NodeBilateralBlurData *)this->getbNode()->storage;
        BilateralBlurOperation *operation = new BilateralBlurOperation();
+       operation->setbNode(this->getbNode());
        operation->setQuality(context->getQuality());
        operation->setData(data);
        this->getInputSocket(0)->relinkConnections(operation->getInputSocket(0), 0, graph);
index b23c1a02b9f97220ae6f2fd4dbbe0439076c4b25..b8c7478b2f7f4e686017f5b4dd023e47049a6b14 100644 (file)
@@ -64,7 +64,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber, Me
        float *buffer = memoryBuffer->getBuffer();
        if (this->m_input->isComplex()) {
                bNode* bnode = this->m_input->getbNode();
-//             if (bnode&& bnode->new_node) bnode->new_node->highlight++;
+               if (bnode&& bnode->original) bnode->original->highlight++;
 
                void *data = this->m_input->initializeTileData(rect, memoryBuffers);
                int x1 = rect->xmin;
@@ -90,7 +90,7 @@ void WriteBufferOperation::executeRegion(rcti *rect, unsigned int tileNumber, Me
                        this->m_input->deinitializeTileData(rect, memoryBuffers, data);
                        data = NULL;
                }
-//             if (bnode&& bnode->new_node) bnode->new_node->highlight++;
+               if (bnode&& bnode->original) bnode->original->highlight++;
        }
        else {
                int x1 = rect->xmin;
@@ -144,7 +144,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice* device, rcti *rect,
        clMemToCleanUp->push_back(clOutputBuffer);
        list<cl_kernel> *clKernelsToCleanUp = new list<cl_kernel>();
        bNode* bnode = this->m_input->getbNode();
-//     if (bnode&& bnode->new_node) bnode->new_node->highlight++;
+       if (bnode&& bnode->original) bnode->original->highlight++;
 
        this->m_input->executeOpenCL(device, outputBuffer, clOutputBuffer, inputMemoryBuffers, clMemToCleanUp, clKernelsToCleanUp);
 
@@ -163,7 +163,7 @@ void WriteBufferOperation::executeOpenCLRegion(OpenCLDevice* device, rcti *rect,
        
        this->getMemoryProxy()->getBuffer()->copyContentFrom(outputBuffer);
 
-//     if (bnode&& bnode->new_node) bnode->new_node->highlight++;
+       if (bnode&& bnode->original) bnode->original->highlight++;
        // STEP 4
 
        
index 21cf142d1cd4b98e362512a7902d461992014d81..e4b5a264ba34a7af5788502c5b84e8dad80ee5f3 100644 (file)
@@ -166,6 +166,7 @@ typedef struct bNode {
        struct bNode *parent;   /* parent node */
        struct ID *id;                  /* optional link to libdata */
        void *storage;                  /* custom data, must be struct, for storage in file */
+       struct bNode *original; /* the original node in the tree (for localized tree) */
        
        float locx, locy;               /* root offset for drawing */
        float width, height;    /* node custom width and height */
index 58357bdd59d087553633b77de77b5b15d013ccc2..b9acf821efe590879eeb79f17e394c563a9f21f3 100644 (file)
@@ -132,6 +132,7 @@ static void localize(bNodeTree *localtree, bNodeTree *ntree)
        for (node= ntree->nodes.first; node; node= node->next) {
                /* ensure new user input gets handled ok */
                node->need_exec= 0;
+               node->new_node->original = node;
                
                /* move over the compbufs */
                /* right after ntreeCopyTree() oldsock pointers are valid */
@@ -191,8 +192,6 @@ static void local_sync(bNodeTree *localtree, bNodeTree *ntree)
        
        /* move over the compbufs and previews */
        for (lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
-               lnode->new_node->new_node = lnode;
-               lnode->highlight = 0;
                if ( (lnode->exec & NODE_READY) && !(lnode->exec & NODE_SKIPPED) ) {
                        if (ntreeNodeExists(ntree, lnode->new_node)) {
                                
@@ -214,7 +213,6 @@ static void local_merge(bNodeTree *localtree, bNodeTree *ntree)
        
        /* move over the compbufs and previews */
        for (lnode= localtree->nodes.first; lnode; lnode= lnode->next) {
-               lnode->highlight = 0;
                if (ntreeNodeExists(ntree, lnode->new_node)) {
                        if (ELEM(lnode->type, CMP_NODE_VIEWER, CMP_NODE_SPLITVIEWER)) {
                                if (lnode->id && (lnode->flag & NODE_DO_OUTPUT)) {