Revision: 45370
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45370
Author:   jbakker
Date:     2012-04-03 11:56:01 +0000 (Tue, 03 Apr 2012)
Log Message:
-----------
Tile branch
 * added debug info (dot graph) during debugging;
 * fixed issue in the movieclip node, where wrong connections where created

Modified Paths:
--------------
    branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.cpp
    branches/tile/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
    branches/tile/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
    branches/tile/source/blender/compositor/nodes/COM_MovieClipNode.cpp

Modified: branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.cpp
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.cpp      
2012-04-03 11:55:39 UTC (rev 45369)
+++ branches/tile/source/blender/compositor/intern/COM_ExecutionSystem.cpp      
2012-04-03 11:56:01 UTC (rev 45370)
@@ -69,6 +69,9 @@
                        executionGroup->determineResolution(resolution);
                }
        }
+#ifdef DEBUG
+       ExecutionSystemHelper::debugDump(this);
+#endif
 }
 
 ExecutionSystem::~ExecutionSystem() {

Modified: 
branches/tile/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp
===================================================================
--- 
branches/tile/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp    
    2012-04-03 11:55:39 UTC (rev 45369)
+++ 
branches/tile/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp    
    2012-04-03 11:56:01 UTC (rev 45370)
@@ -172,3 +172,140 @@
        links.push_back(newconnection);
        return newconnection;
 }
+
+void ExecutionSystemHelper::debugDump(ExecutionSystem* system) {
+       Node* node;
+       NodeOperation* operation;
+       ExecutionGroup* group;
+       SocketConnection* connection; 
+       int tot, tot2;
+       printf("-- BEGIN COMPOSITOR DUMP --\r\n");
+       printf("digraph compositorexecution {\r\n");
+       tot = system->getNodes().size();
+       for (int i = 0 ; i < tot ; i ++) {
+               node = system->getNodes()[i];
+               printf("// NODE: %s\r\n", node->getbNode()->typeinfo->name);
+       }
+       tot = system->getOperations().size();
+       for (int i = 0 ; i < tot ; i ++) {
+               operation = system->getOperations()[i];
+               printf("// OPERATION: %p\r\n", operation);
+               printf("\t\"O_%p\"", operation);
+               printf(" [shape=record,label=\"{");
+               printf("");
+               tot2 = operation->getNumberOfInputSockets();
+               if (tot2 != 0) {
+                       printf("{");
+                       for (int j = 0 ; j < tot2 ; j ++) {
+                               InputSocket *socket = 
operation->getInputSocket(j);
+                               if (j != 0) {
+                                       printf("|");
+                               }
+                               printf("<IN_%p>", socket);
+                               switch (socket->getActualDataType()) {
+                               case COM_DT_VALUE:
+                                       printf("Value");
+                                       break;
+                               case COM_DT_VECTOR:
+                                       printf("Vector");
+                                       break;
+                               case COM_DT_COLOR:
+                                       printf("Color");
+                                       break;
+                               case COM_DT_UNKNOWN:
+                                       printf("Unknown");
+                                       break;
+                               }
+                       }
+                       printf("}");
+                       printf("|");
+               }
+               if (operation->isViewerOperation()) {
+                       printf("Viewer");
+               } else if 
(operation->isOutputOperation(system->getContext().isRendering())) {
+                       printf("Output");
+               } else if (operation->isSetOperation()) {
+                       printf("Set");
+               } else if (operation->isReadBufferOperation()) {
+                       printf("ReadBuffer");
+               } else if (operation->isWriteBufferOperation()) {
+                       printf("WriteBuffer");
+               } else {
+                       printf("O_%p", operation);
+               }
+               tot2 = operation->getNumberOfOutputSockets();
+               if (tot2 != 0) {
+                       printf("|");
+                       printf("{");
+                       for (int j = 0 ; j < tot2 ; j ++) {
+                               OutputSocket *socket = 
operation->getOutputSocket(j);
+                               if (j != 0) {
+                                       printf("|");
+                               }
+                               printf("<OUT_%p>", socket);
+                               switch (socket->getActualDataType()) {
+                               case COM_DT_VALUE:
+                                       printf("Value");
+                                       break;
+                               case COM_DT_VECTOR:
+                                       printf("Vector");
+                                       break;
+                               case COM_DT_COLOR:
+                                       printf("Color");
+                                       break;
+                               case COM_DT_UNKNOWN:
+                                       printf("Unknown");
+                                       break;
+                               }
+                       }
+                       printf("}");
+               }
+               printf("}\"]");
+               printf("\r\n");
+       }
+       tot = system->getExecutionGroups().size();
+       for (int i = 0 ; i < tot ; i ++) {
+               group = system->getExecutionGroups()[i];
+               printf("// GROUP: %d\r\n", i);
+               printf("subgraph {\r\n");
+               printf("//  OUTPUTOPERATION: %p\r\n", 
group->getOutputNodeOperation());
+               printf(" O_%p\r\n", group->getOutputNodeOperation());
+               printf("}\r\n");
+       }
+       tot = system->getOperations().size();
+       for (int i = 0 ; i < tot ; i ++) {
+               operation = system->getOperations()[i];
+               if (operation->isReadBufferOperation()) {
+                       ReadBufferOperation * read = 
(ReadBufferOperation*)operation;
+                       WriteBufferOperation * write= 
read->getMemoryProxy()->getWriteBufferOperation();
+                       printf("\t\"O_%p\" -> \"O_%p\" [style=dotted]\r\n", 
write, read);
+               }
+       }
+       tot = system->getConnections().size();
+       for (int i = 0 ; i < tot ; i ++) {
+               connection = system->getConnections()[i];
+               printf("// CONNECTION: %d.%d -> %d.%d\r\n", 
connection->getFromNode(), connection->getFromSocket(), 
connection->getToNode(), connection->getToSocket());
+               printf("\t\"O_%p\":\"OUT_%p\" -> \"O_%p\":\"IN_%p\"", 
connection->getFromNode(), connection->getFromSocket(), 
connection->getToNode(), connection->getToSocket());
+               if (!connection->isValid()) {
+                       printf(" [color=red]");
+               } else {
+                       switch 
(connection->getFromSocket()->getActualDataType()) {
+                       case COM_DT_VALUE:
+                               printf(" [color=grey]");
+                               break;
+                       case COM_DT_VECTOR:
+                               printf(" [color=blue]");
+                               break;
+                       case COM_DT_COLOR:
+                               printf(" [color=orange]");
+                               break;
+                       case COM_DT_UNKNOWN:
+                               printf(" [color=black]");
+                               break;
+                       }
+               }
+               printf("\r\n");
+       }
+       printf("}\r\n");
+       printf("-- END COMPOSITOR DUMP --\r\n");
+}

Modified: 
branches/tile/source/blender/compositor/intern/COM_ExecutionSystemHelper.h
===================================================================
--- branches/tile/source/blender/compositor/intern/COM_ExecutionSystemHelper.h  
2012-04-03 11:55:39 UTC (rev 45369)
+++ branches/tile/source/blender/compositor/intern/COM_ExecutionSystemHelper.h  
2012-04-03 11:56:01 UTC (rev 45370)
@@ -117,5 +117,11 @@
          * @return the new created SocketConnection
          */
        static SocketConnection* addLink(vector<SocketConnection*>& links, 
OutputSocket* fromSocket, InputSocket* toSocket);
+       
+       /**
+         * @brief dumps the content of the execution system to standard out
+         * @param system the execution system to dump
+         */
+       static void debugDump(ExecutionSystem* system);
 };
 #endif

Modified: branches/tile/source/blender/compositor/nodes/COM_MovieClipNode.cpp
===================================================================
--- branches/tile/source/blender/compositor/nodes/COM_MovieClipNode.cpp 
2012-04-03 11:55:39 UTC (rev 45369)
+++ branches/tile/source/blender/compositor/nodes/COM_MovieClipNode.cpp 
2012-04-03 11:56:01 UTC (rev 45370)
@@ -94,25 +94,25 @@
        if (offsetXMovieClip->isConnected()) {
                SetValueOperation * operationSetValue = new SetValueOperation();
                operationSetValue->setValue(loc[0]);
-               
offsetXMovieClip->relinkConnections(operation->getOutputSocket());
+               
offsetXMovieClip->relinkConnections(operationSetValue->getOutputSocket());
                graph->addOperation(operationSetValue);
        }
        if (offsetYMovieClip->isConnected()) {
                SetValueOperation * operationSetValue = new SetValueOperation();
                operationSetValue->setValue(loc[1]);
-               
offsetYMovieClip->relinkConnections(operation->getOutputSocket());
+               
offsetYMovieClip->relinkConnections(operationSetValue->getOutputSocket());
                graph->addOperation(operationSetValue);
        }
        if (scaleMovieClip->isConnected()) {
                SetValueOperation * operationSetValue = new SetValueOperation();
                operationSetValue->setValue(scale);
-               scaleMovieClip->relinkConnections(operation->getOutputSocket());
+               
scaleMovieClip->relinkConnections(operationSetValue->getOutputSocket());
                graph->addOperation(operationSetValue);
        }
        if (angleMovieClip->isConnected()) {
                SetValueOperation * operationSetValue = new SetValueOperation();
                operationSetValue->setValue(angle);
-               angleMovieClip->relinkConnections(operation->getOutputSocket());
+               
angleMovieClip->relinkConnections(operationSetValue->getOutputSocket());
                graph->addOperation(operationSetValue);
        }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to